Created
August 30, 2020 15:33
-
-
Save bbachi/80ad10846af719045e5058e5d20613bd to your computer and use it in GitHub Desktop.
nginx pod
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: v1 | |
kind: Pod | |
metadata: | |
name: init-container-demo | |
spec: | |
containers: | |
- name: nginx | |
image: nginx | |
ports: | |
- containerPort: 80 | |
volumeMounts: | |
- name: workdir | |
mountPath: /usr/share/nginx/html | |
# These containers are run during pod initialization | |
initContainers: | |
- name: busybox | |
image: busybox | |
command: ["/bin/sh"] | |
args: ["-c", "echo '<html><h1>Hi I am from Init container</h1><html>' >> /work-dir/index.html"] | |
volumeMounts: | |
- name: workdir | |
mountPath: "/work-dir" | |
dnsPolicy: Default | |
volumes: | |
- name: workdir | |
emptyDir: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment