Last active
April 29, 2020 22:49
-
-
Save mikesparr/e64b3677af21273da83ca1e6c55bfbd5 to your computer and use it in GitHub Desktop.
Article content for InitContainers
This file contains 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: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: test-app | |
name: test-app | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: test-app | |
template: | |
metadata: | |
labels: | |
app: test-app | |
spec: | |
volumes: | |
- name: test-volume | |
persistentVolumeClaim: | |
claimName: test-pvc | |
containers: | |
- name: myapp-container | |
image: busybox:1.28 | |
command: ['sh', '-c', "cat /tmp/hello.txt | xargs -I % echo File content: % && sleep 3600"] | |
volumeMounts: | |
- name: test-volume | |
mountPath: /tmp | |
initContainers: | |
- name: init-myservice | |
image: busybox:1.28 | |
command: ['sh', '-c', "echo 'Hello, World!' > /tmp/hello.txt"] | |
volumeMounts: | |
- name: test-volume | |
mountPath: /tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment