-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathdeployment-v2.yaml
49 lines (49 loc) · 1.25 KB
/
deployment-v2.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: go-multiroute-v2
labels:
app: web-backend # 可能有多个Deployment拥有相同的app名称,例如,后端服务通常由多个应用组成。
app/env: prod # 由cd脚本更新
spec:
replicas: 2
selector:
matchLabels:
app: go-multiroute
version: v2
template:
metadata:
labels:
app: go-multiroute
version: v2
spec:
containers:
- image: docker.io/leigg/go_multiroute:v1
name: go-multiroute
command: [ "/main","-config", "/config/config.yml" ]
resources:
requests:
cpu: 100m
memory: 10Mi
limits:
cpu: 100m
memory: 15Mi
volumeMounts:
- name: config
mountPath: "/config"
env:
- name: VERSION
value: v2
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: DB_PASS
valueFrom:
secretKeyRef:
key: db_pass
name: go-multiroute-v1
volumes:
- name: config
configMap:
name: go-multiroute-v1