Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install kubectl into a Kubernetes Pod
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
volumes:
- name: kubectl
emptyDir: {}
initContainers:
- name: install-kubectl
image: allanlei/kubectl
volumeMounts:
- name: kubectl
mountPath: /data
command: ["cp", "/usr/local/bin/kubectl", "/data/kubectl"]
containers:
- name: redis
image: redis:4.0.7-alpine
command: ["redis-server"]
volumeMounts:
- name: kubectl
subPath: kubectl
mountPath: /usr/local/bin/kubectl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.