-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotherdeployment.yaml
64 lines (62 loc) · 1.65 KB
/
otherdeployment.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
apiVersion: v1
kind: Namespace
metadata:
name: regdev
---
apiVersion: v1
kind: ConfigMap
metadata:
name: newconfig
namespace: regdev
data:
# props like keys
reg_data: "reg-data-test"
# File like keys
conf.yaml: |
file_data: "file-data-test"
# More file like keys
config.properties: |
file_prop.data="file-prop-data-test"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: otherdeployment
namespace: regdev
labels:
team: dev
spec:
replicas: 3
selector: # deployment selector
matchLabels: # deployment selects "app:frontend" pods, monitors and traces these pods
app: myotherdeployment # if one of the pod is killed, K8s looks at the desire state (replica:3), it recreats another pods to protect number of replicas
template:
metadata:
labels: # pod labels, if the deployment selector is same with these labels, deployment follows pods that have these labels
app: myotherdeployment # key: value
spec:
containers:
- name: nginx
image: nginx:latest # image download from DockerHub
ports:
- containerPort: 80 # open following ports
resources:
limits:
memory: 512Mi
cpu: "1"
requests:
memory: 256Mi
cpu: "0.2"
volumeMounts:
- name: config
mountPath: "/config"
readOnly: false
volumes:
- name: config
configMap:
name: newconfig
items:
- key: "conf.yaml"
path: "conf.yaml"
- key: "config.properties"
path: "config.properties"