-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-depl.yaml
104 lines (94 loc) · 2.45 KB
/
my-depl.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
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: my-depl
name: my-depl
spec:
#### Rolling update ####
minReadySeconds: 30
strategy: # updateStrategy in case of DaemonSet of StatefulSet
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
########################
replicas: 1
selector:
matchLabels:
run: my-depl
template:
metadata:
labels:
run: my-depl
spec:
#### Tolerations ####
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
- key: "key"
operator: "Equal"
value: "value"
effect: "NoSchedule"
########################
#### Init Containers ####
initContainers:
- image: busybox
name: init-my-depl
command: ['sh', '-c','echo "Serving from pod $HOSTNAME" > /my-volume/index.html']
volumeMounts:
- mountPath: /my-volume
name: my-vol
########################
containers:
- image: nginx
name: my-depl
volumeMounts:
- mountPath: /usr/share/nginx/html
name: my-vol
readOnly: true
#serviceAccountName: operator # By Default, "default" service account in the NS is used by pods to make api calls.
#### Environment variable from Secret ####
#env:
#- name: SECRET_USERNAME
# valueFrom:
# secretKeyRef: # configMapKeyRef
# name: mysecret
# key: username
########################
#### Liveness Probe ####
livenessProbe:
httpGet:
path: /index.html
port: 80
httpHeaders:
- name: Host
value: abc.example.com
initialDelaySeconds: 5
periodSeconds: 10
########################
#### Readness Probe ####
readinessProbe:
exec:
command:
- cat
- /usr/share/nginx/html/index.html
initialDelaySeconds: 3
periodSeconds: 1
failureThreshold: 3
########################
#### Volumes ####
volumes:
- name: my-vol
hostPath:
path: /mnt
type: Directory
########################
#### Volumes from secret ####
- name: foo
secret: # configMap
secretName: mysecret
items:
- key: username
path: my-group/my-username
mode: 511 # Decimal of 777
########################