-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
325 lines (325 loc) · 12 KB
/
deploy.yml
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: bridge-configurations.openshift.io
spec:
group: openshift.io
names:
plural: bridge-configurations
singular: bridge-configuration
kind: BridgeConfiguration
listKind: BridgeConfigurationList
shortNames:
- br-config
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
schema:
openAPIV3Schema:
description: BridgeConfiguration is the schema for bridgeconfiguration API
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: 'BridgeConfiguration spec defines the desired state of a bridge'
type: object
properties:
nodeSelector:
description: 'NodeSelector is a selector which must be true for the
bridge to fit on a node. Selector which must match a node''s
labels for the pod to be scheduled on that node. More info:
https://kubernetes.io/docs/concepts/configuration/assign-pod-node/'
properties:
matchExpressions:
description: 'matchExpressions is a list of label selector
requirements. The requirements are ANDed.'
items:
description: 'A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.'
properties:
key:
description: 'key is the label key that the selector
applies to.'
type: string
operator:
description: "operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist."
type: string
values:
description: 'values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.'
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: "matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is 'key', the operator is 'In', and the values array
contains only 'value'. The requirements are ANDed."
type: object
type: object
egressVlanInterfaces:
description: 'EgressVlanInterfaces represents egress interfaces of bridge with specific vlan,
which will be created by bridge-operator'
type: array
items:
type: object
properties:
name:
description: 'name represents parent interfaces of vlan interface'
type: string
protocol:
description: 'protocol specifies vlan protocol (802.1q or 802.1ad). default: 802.1q.'
type: string
id:
description: 'id specifies vlan id of given protocol'
type: integer
minimum: 0
maximum: 4095
egressInterfaces:
description: 'EgressInterfaces represents egress interfaces of bridge'
type: array
items:
type: object
properties:
name:
description: 'name represents interface to be added into the bridge'
type: string
#---
#apiVersion: apiextensions.k8s.io/v1
#kind: CustomResourceDefinition
#metadata:
# name: bridge-node-statuses.openshift.io
#spec:
# group: openshift.io
# names:
# plural: bridge-node-statuses
# singular: bridge-node-status
# kind: BridgeNodeStatus
# listKind: BridgeNodeStatusList
# shortNames:
# - br-node-status
# scope: Cluster
# versions:
# - name: v1alpha1
# served: true
# storage: true
# schema:
# openAPIV3Schema:
# description: BridgeNodeStatus is the schema for bridge node status API
# type: object
# properties:
# apiVersion:
# description: 'APIVersion defines the versioned schema of this representation
# of an object. Servers should convert recognized schemas to the latest
# internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
# type: string
# kind:
# description: 'Kind is a string value representing the REST resource this
# object represents. Servers may infer this from the endpoint the client
# submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
# type: string
# metadata:
# type: object
# status:
# description: 'status represents per node bridge status'
# type: object
# properties:
# bridges:
# type: array
# items:
# type: object
# properties:
# name:
# type: string
# description: 'name specifies bridge name managed by bridge-operator'
# message:
# type: string
# description: 'message shows status message from bridge-operator'
# lastUpdatedTime:
# type: string
# description: 'lastUpdatedTime represents the last updated time of the message'
# format: date-time
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: bridge-informations.openshift.io
spec:
group: openshift.io
names:
plural: bridge-informations
singular: bridge-information
kind: BridgeInformation
listKind: BridgeInformationList
shortNames:
- br-info
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
schema:
openAPIV3Schema:
description: BridgeInformation is the schema for bridge node status API
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
status:
description: 'status represents per node bridge status'
type: object
properties:
name:
type: string
description: 'name specifies bridge name'
node:
type: string
description: 'node specifies node name that runs the bridge'
managed:
type: boolean
description: 'managed specifies whether this bridge is manged by bridge-operator'
ports:
description: 'ports specifies bridge port managed by bridge-operator'
type: array
items:
type: object
properties:
name:
type: string
description: 'name specifies bridge port name, managed by bridge-operator'
managed:
type: boolean
description: 'managed specifies whether this port is manged by bridge-operator'
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: bridge-operator
rules:
- apiGroups: ["openshift.io"]
resources:
- 'bridge-configurations'
- 'bridge-informations'
verbs:
- '*'
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- get
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: bridge-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: bridge-operator
subjects:
- kind: ServiceAccount
name: bridge-operator
namespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: bridge-operator
namespace: kube-system
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: bridge-operator-ds-amd64
namespace: kube-system
labels:
tier: node
app: bridge-operator
name: bridge-operator
spec:
selector:
matchLabels:
name: bridge-operator
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
tier: node
app: bridge-operator
name: bridge-operator
spec:
hostNetwork: true
nodeSelector:
kubernetes.io/arch: amd64
tolerations:
- operator: Exists
effect: NoSchedule
serviceAccountName: bridge-operator
containers:
- name: bridge-operator
image: quay.io/s1061123/bridge-operator:latest
imagePullPolicy: Always
command: ["/usr/bin/bridge-operator-daemon"]
#args:
#- "--host-prefix=/host"
resources:
requests:
cpu: "100m"
memory: "80Mi"
limits:
cpu: "100m"
memory: "150Mi"
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN", "NET_ADMIN"]
volumeMounts:
- name: host
mountPath: /host
volumes:
- name: host
hostPath:
path: /