-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathdeployment.yml
More file actions
37 lines (37 loc) · 1.21 KB
/
deployment.yml
File metadata and controls
37 lines (37 loc) · 1.21 KB
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: deploy
labels:
app: depapp
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2 # Maximum number of pods that can be created over the desired replicas
maxUnavailable: 2 # Maximum number of pods that can be unavailable during the update
selector:
matchExpressions:
#- { key: app, operator: In , values: [replicasetapp, new-app]}
#- { key: app, operator: Exists}
#- { key: app, operator: NotIn , values: [replicasetapp, new-app]}
matchLabels:
app: replicasetapp
replicas: 10
template:
metadata:
labels:
name: new-app
app: replicasetapp #replicasetapp1 change when using NotIn exp
spec:
containers:
- name: nginx
image: nginx:latest
resources:
requests:
cpu: "100m"
memory: "128Mi"
ports:
- containerPort: 80
name: http
protocol: TCP