-
Notifications
You must be signed in to change notification settings - Fork 7
/
matchExpression-pod.yaml
46 lines (46 loc) · 1.18 KB
/
matchExpression-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
kind: Deployment
metadata:
name: expert
labels:
run: app
apiVersion: apps/v1
spec:
replicas: 4
selector:
matchLabels:
ver: v1
matchExpressions:
# - {key: "kernel", operator: Exists, values: } # In case of Exists,DoesNotExist value must be empty. It will fix later on patch.
# - {key: "kernel", operator: NotIn, values: ["v1","v2"]} # kernel value is not v1, v2.
- {key: "kernel", operator: In, values: ["latest","new"]}
- {key: "env", operator: In, values: ["server","app"]}
template:
metadata:
name: rush
labels:
ver: v1
kernel: latest
env: server
spec:
volumes:
- name: vamp
emptyDir: {}
containers:
- image: nginx
name: web-app
ports:
- containerPort: 80
volumeMounts:
- name: vamp
mountPath: /usr/share/nginx/html
initContainers:
- image: busybox
name: helper
command:
- sh
- -c
args:
- echo "This is your web page" > /tmp/index.html
volumeMounts:
- name: vamp
mountPath: /tmp/