-
Notifications
You must be signed in to change notification settings - Fork 39
/
galaxy.yaml
196 lines (196 loc) · 5.34 KB
/
galaxy.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
---
apiVersion: rbac.authorization.k8s.io/v1
# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: galaxy
rules:
- apiGroups: [""]
resources:
- pods
- namespaces
- nodes
- pods/binding
verbs: ["list", "watch", "get", "patch", "create", "update"]
- apiGroups: ["apps", "extensions"]
resources:
- statefulsets
- deployments
verbs: ["list", "watch"]
- apiGroups: [""]
resources:
- configmaps
- endpoints
- events
verbs: ["get", "list", "watch", "update", "create", "patch"]
- apiGroups: ["galaxy.k8s.io"]
resources:
- pools
- floatingips
verbs: ["get", "list", "watch", "update", "create", "patch", "delete"]
- apiGroups: ["apiextensions.k8s.io"]
resources:
- customresourcedefinitions
verbs:
- "*"
- apiGroups: ["networking.k8s.io"]
resources:
- networkpolicies
verbs: ["get", "list", "watch"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: galaxy
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: galaxy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: galaxy
subjects:
- kind: ServiceAccount
name: galaxy
namespace: kube-system
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: galaxy
name: galaxy
namespace: kube-system
spec:
selector:
matchLabels:
app: galaxy
template:
metadata:
labels:
app: galaxy
spec:
priorityClassName: system-node-critical
serviceAccountName: galaxy
hostNetwork: true
hostPID: true
containers:
# mirrors.tencent.com/tkestack/galaxy-amd64:v1.0.8.3.g494cfa14
- image: ccr.ccs.tencentyun.com/paas-test/jacksontong:galaxy-26f7e1d0
command: ["/bin/sh"]
# qcloud galaxy should run with --route-eni
args: ["-c", "cp -p /etc/galaxy/cni/00-galaxy.conf /etc/cni/net.d/; cp -p /opt/cni/galaxy/bin/galaxy-sdn /opt/cni/galaxy/bin/loopback /opt/cni/bin/; /usr/bin/galaxy --logtostderr=true --v=3 --route-eni"]
# private-cloud should run without --route-eni
# args: ["-c", "cp -p /etc/galaxy/cni/00-galaxy.conf /etc/cni/net.d/; cp -p /opt/cni/galaxy/bin/galaxy-sdn /opt/cni/galaxy/bin/loopback /opt/cni/bin/; /usr/bin/galaxy --logtostderr=true --v=3"]
imagePullPolicy: Always
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: DOCKER_HOST
value: unix:///host/run/docker.sock
name: galaxy
resources:
requests:
cpu: 100m
memory: 200Mi
securityContext:
privileged: true
volumeMounts:
- name: galaxy-run
mountPath: /var/run/galaxy/
- name: containerd-run
mountPath: /var/run/netns
mountPropagation: Bidirectional
- name: flannel-run
mountPath: /run/flannel
- name: galaxy-etc
mountPath: /etc/galaxy
- name: cni-config
mountPath: /etc/cni/net.d/
- name: cni-bin
mountPath: /opt/cni/bin
- name: cni-etc
mountPath: /etc/galaxy/cni
- name: cni-state
mountPath: /var/lib/cni
- name: docker-sock
mountPath: /host/run/
- name: tz-config
mountPath: /etc/localtime
terminationGracePeriodSeconds: 30
tolerations:
- operator: Exists
volumes:
- name: galaxy-run
hostPath:
path: /var/run/galaxy
- name: containerd-run
hostPath:
path: /var/run/netns
- name: flannel-run
hostPath:
path: /run/flannel
- configMap:
defaultMode: 420
name: galaxy-etc
name: galaxy-etc
- name: cni-config
hostPath:
path: /etc/cni/net.d/
- name: cni-bin
hostPath:
path: /opt/cni/bin
- name: cni-state
hostPath:
path: /var/lib/cni
- configMap:
defaultMode: 420
name: cni-etc
name: cni-etc
- name: docker-sock
# in case of docker restart, /run/docker.sock may change, we have to mount the /run directory
hostPath:
path: /run/
- name: tz-config
hostPath:
path: /etc/localtime
---
apiVersion: v1
kind: ConfigMap
metadata:
name: galaxy-etc
namespace: kube-system
data:
# update network card name in "galaxy-k8s-vlan" and "galaxy-k8s-sriov" if necessary
# update vf_num in "galaxy-k8s-sriov" according to demand
# update ENIIPNetwork to tke-route-eni if running on qcloud
galaxy.json: |
{
"NetworkConf":[
{"name":"tke-route-eni","type":"tke-route-eni","eni":"eth1","routeTable":1},
{"name":"galaxy-flannel","type":"galaxy-flannel", "delegate":{"type":"galaxy-veth"},"subnetFile":"/run/flannel/subnet.env"},
{"name":"galaxy-k8s-vlan","type":"galaxy-underlay-veth", "device":"eth0"}
],
"DefaultNetworks": ["galaxy-flannel"],
"ENIIPNetwork": "galaxy-k8s-vlan"
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cni-etc
namespace: kube-system
data:
00-galaxy.conf: |
{
"name": "galaxy-sdn",
"type": "galaxy-sdn",
"capabilities": {"portMappings": true},
"cniVersion": "1.2.0"
}