-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdeploy.yaml
89 lines (89 loc) · 3.18 KB
/
deploy.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
86
87
88
89
apiVersion: apps/v1
kind: Deployment
metadata:
name: multi-cluster-operator
namespace: default
spec:
replicas: 2
selector:
matchLabels:
app: multi-cluster-operator
template:
metadata:
labels:
app: multi-cluster-operator
spec:
serviceAccountName: multi-cluster-operator-sa
nodeName: vm-0-16-centos # 只调度到这个节点上,因为测试集群只有此node,请自行修改
containers:
- name: multi-cluster-operator
image: multi-cluster-operator:v1
imagePullPolicy: IfNotPresent
# args 启动参数请自行修改
args:
- --db-user=root # db 用户
- --db-password=123456 # db 用户密码
- --db-endpoint=10.0.0.16:30110 # db 地址
- --db-database=resources # db 数据库
- --debug-mode=true # 模式
- --config=/app/file/config.yaml # 配置文件路径
- --ctl-port=31888 # 命令行读取的端口
- --lease-name=multi-cluster-operator-lease # 分布式锁名
- --lease-namespace=default # 分布式锁 namespace
- --lease-mode=true # 是否启动选主模式
env:
- name: "Release"
value: "1"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
volumeMounts:
# 挂载不同集群的 kubeconfig,请自行修改
- name: tencent1
mountPath: /app/file/config-tencent1
- name: tencent2
mountPath: /app/file/config-tencent2
- name: tencent4
mountPath: /app/file/config-tencent4
# 配置文件 config.yaml
- name: config
mountPath: /app/file/config.yaml
- name: migrate
mountPath: /app/migrations
# 需要挂载用户自己监听的 kubeconfig 文件
# 请自行修改
volumes:
- name: tencent1
hostPath:
path: /root/multi_resource_operator/resources/config-tencent1
- name: tencent2
hostPath:
path: /root/multi_resource_operator/resources/config-tencent2
- name: tencent4
hostPath:
path: /root/multi_resource_operator/resources/config-tencent4
- name: config
hostPath:
path: /root/multi_resource_operator/config.yaml
- name: migrate
hostPath:
path: /root/multi_resource_operator/migrations
---
apiVersion: v1
kind: Service
metadata:
name: multi-cluster-operator-svc
namespace: default
spec:
type: NodePort
ports:
- port: 8888 # 容器端口
nodePort: 31888 # 对外暴露的端口
name: server
- port: 29999 # 健康检查端口
nodePort: 31889 # 对外暴露的端口
name: health
selector:
app: multi-cluster-operator