-
Notifications
You must be signed in to change notification settings - Fork 482
/
Copy pathpod-gitclone.yaml
34 lines (34 loc) · 873 Bytes
/
pod-gitclone.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# https://kubernetes.io/docs/tutorials/k8s101/
# https://gist.github.com/tallclair/849601a16cebeee581ef2be50c351841
# https://cheatsheet.dennyzhang.com/kubernetes-yaml-templates
apiVersion: v1
kind: Pod
metadata:
name: www
spec:
initContainers:
- name: git-clone
image: alpine/git
args:
- clone
- --single-branch
- --
- https://github.com/dennyzhang/challenges-kubernetes.git
- /data/challenges-kubernetes
securityContext:
runAsUser: 1 # Any non-root user will do. Match to the workload.
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /data
name: www-data
containers:
- name: nginx
image: nginx
volumeMounts:
- mountPath: /srv/www
name: www-data
readOnly: true
volumes:
- name: www-data
emptyDir: {}