-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller-deployment.yaml
More file actions
50 lines (47 loc) · 1.13 KB
/
controller-deployment.yaml
File metadata and controls
50 lines (47 loc) · 1.13 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
38
39
40
41
42
43
44
45
46
47
48
49
50
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: controller
template:
metadata:
labels:
app: controller
spec:
# 1️⃣ 只在 master / control-plane 节点运行
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
# 2️⃣ master 默认有 taint,需要容忍
tolerations:
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
containers:
- name: traffic-controller
image: crpi-eznd6trr9hw3vfgt.cn-beijing.personal.cr.aliyuncs.com/ericxiaozj/traffic-controller:1.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: controller
namespace: default
spec:
selector:
app: controller
ports:
- protocol: TCP
port: 8080
targetPort: 8080