Created
January 28, 2018 15:03
-
-
Save allanlei/2c85d81e12d544ce3a9651c75aa577fb to your computer and use it in GitHub Desktop.
Install kubectl into a Kubernetes Pod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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