forked from cncamp/101
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multiple-container-pod.yaml
58 lines (58 loc) · 1.15 KB
/
multiple-container-pod.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
apiVersion: v1
kind: Pod
metadata:
name: multi-container-pod
spec:
containers:
- command:
- /bin/sh
- -c
- sleep 60
image: nginx
name: sleep
volumeMounts:
- mountPath: /shared-folder
name: shared-folder
- image: nginx
name: nginx
volumeMounts:
- mountPath: /shared-folder
name: shared-folder
- mountPath: /mnt
name: my-annotations
readOnly: true
dnsPolicy: Default
initContainers:
- command:
- /bin/sh
- -c
- touch /shared-folder/tmp-file
- sleep 10
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
image: nginx
name: nginx-init
volumeMounts:
- mountPath: /shared-folder
name: shared-folder
restartPolicy: Always
volumes:
- emptyDir:
name: shared-folder
- downwardAPI:
defaultMode: 420
items:
- fieldRef:
apiVersion: v1
fieldPath: metadata.annotations
path: annotations
name: my-annotations