-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-containers.yaml
107 lines (107 loc) · 1.98 KB
/
init-containers.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
apiVersion: v1
kind: Pod
metadata:
name: init-demo-pod
labels:
app: blueapp
spec:
containers:
- name: blueapp-container
image: busybox
command: ['sh', '-c', 'echo The database is up, git is cloned and the app is running! && sleep 3600']
initContainers:
- name: init-mydb
image: busybox
command: ['sh', '-c', 'echo I could be waiting for a database to be available using an until nslookup mydb command; sleep 2']
- name: init-git-clone
image: busybox
command: ['sh', '-c', 'echo Cloning git YOUR_GIT_HERE; sleep 2']
---
apiVersion: v1
kind: Pod
metadata:
name: blue
spec:
containers:
- command:
- sh
- -c
- echo The app is running! && sleep 3600
image: busybox:1.28
imagePullPolicy: IfNotPresent
name: green-container-1
initContainers:
- command:
- sh
- -c
- sleep 5
image: busybox
imagePullPolicy: Always
name: init-myservice
restartPolicy: Always
---
apiVersion: v1
kind: Pod
metadata:
name: purple
spec:
containers:
- command:
- sh
- -c
- echo The app is running! && sleep 3600
image: busybox:1.28
imagePullPolicy: IfNotPresent
name: purple-container
resources: {}
initContainers:
- command:
- sh
- -c
- sleep 600
image: busybox:1.28
name: warm-up-1
- command:
- sh
- -c
- sleep 1200
image: busybox:1.28
name: warm-up-2
resources: {}
---
apiVersion: v1
kind: Pod
metadata:
name: red
spec:
containers:
- command:
- sh
- -c
- echo The app is running! && sleep 3600
image: busybox:1.28
name: red-container
resources: {}
---
apiVersion: v1
kind: Pod
metadata:
name: orange
spec:
containers:
- command:
- sh
- -c
- echo The app is running! && sleep 3600
image: busybox:1.28
imagePullPolicy: IfNotPresent
name: orange-container
initContainers:
- command:
- sh
- -c
- sleeeep 2;
image: busybox
imagePullPolicy: Always
name: init-myservice
resources: {}