mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-02-14 09:39:56 +00:00
It can be tricky to illustrate what's going on here, since installing git and cloning the repo can be so fast. So we're sleeping a few seconds to help with this demo and make it easier to show the race condition.
21 lines
429 B
YAML
21 lines
429 B
YAML
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: nginx-with-init
|
|
spec:
|
|
volumes:
|
|
- name: www
|
|
containers:
|
|
- name: nginx
|
|
image: nginx
|
|
volumeMounts:
|
|
- name: www
|
|
mountPath: /usr/share/nginx/html/
|
|
initContainers:
|
|
- name: git
|
|
image: alpine
|
|
command: [ "sh", "-c", "apk add git && sleep 5 && git clone https://github.com/octocat/Spoon-Knife /www" ]
|
|
volumeMounts:
|
|
- name: www
|
|
mountPath: /www/
|