-
Notifications
You must be signed in to change notification settings - Fork 0
/
Deployment.yaml
85 lines (77 loc) · 2.01 KB
/
Deployment.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
---
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: replica_set_name
labels:
key: value
spec:
replicas: no_of_pods
selector: #used to identify existing pods in env
matchLabels:
key: value
template:
metadata:
name: pod_name
labels:
key: value
spec:
containers:
- name: container_name
image: image_name
# k get rs
# k scale --replicas=new_number rs replica_set_name
# What happens when labels are same but other config diff?
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment_name
labels:
key: value
spec:
replicas: no_of_pods
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
selectors:
matchLabels:
key: value
template:
metadata:
name: pod_name
labels:
key: value
spec:
containers:
- name: container_name
image: image_name
ports:
- containerPort: 8080
# k create deploy deployment_name --image=image_name --replicas=no_of_pods
# k scale deploy deploy_name --replicas=no_of_pods
# k edit deploy deploy_name ----> edit any field of deployment
# k set image deploy deploy_name container_name=nginx:1.9.1 --record ----> changed image to different version with record flag capturing cmd used
# k rollout status deploy deploy_name
# k rollout history deploy deploy_name ----> show revisions of deployment
# k rollout undo deploy deploy_name ----> undo deployment to last revision
# k rollout history deploy deploy_name --revision=number ----> describe deployment of revision number
# k rollout undo deploy deploy_name --to-revision=number ----> rollback deployment to specific version
---
#NameSpace
apiVersion: v1
kind: ResourceQuota
metadata:
name: compute-quota
namespace: dev
spec:
hard:
pods: "10"
requests:
cpu: "4"
memory: "5Gi"
limits:
cpu: "10"
memory: 10Gi