forked from tkestack/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
galaxy.yaml
178 lines (178 loc) · 4.57 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
---
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:
- "*"
---
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:
serviceAccountName: galaxy
hostNetwork: true
hostPID: true
containers:
- image: tkestack/galaxy:v1.0.0
command: ["/bin/sh"]
# qcloud galaxy should run with --route-eni
args: ["-c", "cp -p /etc/cni/net.d/00-galaxy.conf /host/etc/cni/net.d/; cp -p /opt/cni/bin/* /host/opt/cni/bin/; /usr/bin/galaxy --logtostderr=true --v=3 --route-eni"]
# private-cloud should run without --route-eni
# args: ["-c", "cp -p /etc/cni/net.d/00-galaxy.conf /host/etc/cni/net.d/; cp -p /opt/cni/bin/* /host/opt/cni/bin/; /usr/bin/galaxy --logtostderr=true --v=3"]
imagePullPolicy: Always
name: galaxy
resources:
requests:
cpu: 100m
memory: 200Mi
securityContext:
privileged: true
volumeMounts:
- name: galaxy-run
mountPath: /var/run/galaxy/
- name: flannel-run
mountPath: /run/flannel
- name: kube-config
mountPath: /host/etc/kubernetes/
- name: galaxy-log
mountPath: /data/galaxy/logs
- name: galaxy-etc
mountPath: /etc/galaxy
- name: cni-config
mountPath: /host/etc/cni/net.d/
- name: cni-bin
mountPath: /host/opt/cni/bin
- name: cni-etc
mountPath: /etc/cni/net.d
- name: cni-state
mountPath: /var/lib/cni
- name: docker-sock
mountPath: /run/docker.sock
terminationGracePeriodSeconds: 30
volumes:
- name: galaxy-run
hostPath:
path: /var/run/galaxy
- name: flannel-run
hostPath:
path: /run/flannel
- name: kube-config
hostPath:
path: /etc/kubernetes/
- name: cni-bin-dir
hostPath:
path: /opt/cni/bin
- name: galaxy-log
emptyDir: {}
- 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
hostPath:
path: /run/docker.sock
---
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
galaxy.json: |
{
"NetworkConf":[
{"type":"tke-route-eni","eni":"eth1","routeTable":1},
{"type":"galaxy-flannel", "delegate":{"type":"galaxy-veth"},"subnetFile":"/run/flannel/subnet.env"},
{"type":"galaxy-k8s-vlan", "device":"eth1", "default_bridge_name": "br0"},
{"type": "galaxy-k8s-sriov", "device": "eth1", "vf_num": 10}
],
"DefaultNetworks": ["galaxy-flannel"]
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cni-etc
namespace: kube-system
data:
00-galaxy.conf: |
{
"type": "galaxy-sdn",
"capabilities": {"portMappings": true}
}