Merge "Change NCM for upstream change in orchestrator"
[multicloud/k8s.git] / kud / deployment_infra / images / nfn.yml
1
2 ---
3
4 apiVersion: apiextensions.k8s.io/v1beta1
5 kind: CustomResourceDefinition
6 metadata:
7   name: networks.k8s.plugin.opnfv.org
8 spec:
9   group: k8s.plugin.opnfv.org
10   names:
11     kind: Network
12     listKind: NetworkList
13     plural: networks
14     singular: network
15   scope: Namespaced
16   subresources:
17     status: {}
18   validation:
19     openAPIV3Schema:
20       properties:
21         apiVersion:
22           description: 'APIVersion defines the versioned schema of this representation
23             of an object. Servers should convert recognized schemas to the latest
24             internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
25           type: string
26         kind:
27           description: 'Kind is a string value representing the REST resource this
28             object represents. Servers may infer this from the endpoint the client
29             submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
30           type: string
31         metadata:
32           type: object
33         spec:
34           properties:
35             cniType:
36               description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
37                 Important: Run "operator-sdk generate k8s" to regenerate code after
38                 modifying this file Add custom validation using kubebuilder tags:
39                 https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
40               type: string
41             dns:
42               properties:
43                 domain:
44                   type: string
45                 nameservers:
46                   items:
47                     type: string
48                   type: array
49                 options:
50                   items:
51                     type: string
52                   type: array
53                 search:
54                   items:
55                     type: string
56                   type: array
57               type: object
58             ipv4Subnets:
59               items:
60                 properties:
61                   excludeIps:
62                     type: string
63                   gateway:
64                     type: string
65                   name:
66                     type: string
67                   subnet:
68                     type: string
69                 required:
70                 - name
71                 - subnet
72                 type: object
73               type: array
74             ipv6Subnets:
75               items:
76                 properties:
77                   excludeIps:
78                     type: string
79                   gateway:
80                     type: string
81                   name:
82                     type: string
83                   subnet:
84                     type: string
85                 required:
86                 - name
87                 - subnet
88                 type: object
89               type: array
90             routes:
91               items:
92                 properties:
93                   dst:
94                     type: string
95                   gw:
96                     type: string
97                 required:
98                 - dst
99                 type: object
100               type: array
101           required:
102           - cniType
103           - ipv4Subnets
104           type: object
105         status:
106           properties:
107             state:
108               description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
109                 of cluster Important: Run "operator-sdk generate k8s" to regenerate
110                 code after modifying this file Add custom validation using kubebuilder
111                 tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
112               type: string
113           required:
114           - state
115           type: object
116   version: v1alpha1
117   versions:
118   - name: v1alpha1
119     served: true
120     storage: true
121
122
123 ---
124
125 apiVersion: apiextensions.k8s.io/v1beta1
126 kind: CustomResourceDefinition
127 metadata:
128   name: providernetworks.k8s.plugin.opnfv.org
129 spec:
130   group: k8s.plugin.opnfv.org
131   names:
132     kind: ProviderNetwork
133     listKind: ProviderNetworkList
134     plural: providernetworks
135     singular: providernetwork
136   scope: Namespaced
137   subresources:
138     status: {}
139   validation:
140     openAPIV3Schema:
141       description: ProviderNetwork is the Schema for the providernetworks API
142       properties:
143         apiVersion:
144           description: 'APIVersion defines the versioned schema of this representation
145             of an object. Servers should convert recognized schemas to the latest
146             internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
147           type: string
148         kind:
149           description: 'Kind is a string value representing the REST resource this
150             object represents. Servers may infer this from the endpoint the client
151             submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
152           type: string
153         metadata:
154           type: object
155         spec:
156           description: ProviderNetworkSpec defines the desired state of ProviderNetwork
157           properties:
158             cniType:
159               description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
160                 Important: Run "operator-sdk generate k8s" to regenerate code after
161                 modifying this file Add custom validation using kubebuilder tags:
162                 https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
163               type: string
164             direct:
165               properties:
166                 directNodeSelector:
167                   type: string
168                 nodeLabelList:
169                   items:
170                     type: string
171                   type: array
172                 providerInterfaceName:
173                   type: string
174               required:
175               - directNodeSelector
176               - providerInterfaceName
177               type: object
178             dns:
179               properties:
180                 domain:
181                   type: string
182                 nameservers:
183                   items:
184                     type: string
185                   type: array
186                 options:
187                   items:
188                     type: string
189                   type: array
190                 search:
191                   items:
192                     type: string
193                   type: array
194               type: object
195             ipv4Subnets:
196               items:
197                 properties:
198                   excludeIps:
199                     type: string
200                   gateway:
201                     type: string
202                   name:
203                     type: string
204                   subnet:
205                     type: string
206                 required:
207                 - name
208                 - subnet
209                 type: object
210               type: array
211             ipv6Subnets:
212               items:
213                 properties:
214                   excludeIps:
215                     type: string
216                   gateway:
217                     type: string
218                   name:
219                     type: string
220                   subnet:
221                     type: string
222                 required:
223                 - name
224                 - subnet
225                 type: object
226               type: array
227             providerNetType:
228               type: string
229             routes:
230               items:
231                 properties:
232                   dst:
233                     type: string
234                   gw:
235                     type: string
236                 required:
237                 - dst
238                 type: object
239               type: array
240             vlan:
241               properties:
242                 logicalInterfaceName:
243                   type: string
244                 nodeLabelList:
245                   items:
246                     type: string
247                   type: array
248                 providerInterfaceName:
249                   type: string
250                 vlanId:
251                   type: string
252                 vlanNodeSelector:
253                   type: string
254               required:
255               - providerInterfaceName
256               - vlanId
257               - vlanNodeSelector
258               type: object
259           required:
260           - cniType
261           - ipv4Subnets
262           - providerNetType
263           type: object
264         status:
265           description: ProviderNetworkStatus defines the observed state of ProviderNetwork
266           properties:
267             state:
268               description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
269                 of cluster Important: Run "operator-sdk generate k8s" to regenerate
270                 code after modifying this file Add custom validation using kubebuilder
271                 tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
272               type: string
273           required:
274           - state
275           type: object
276       type: object
277   version: v1alpha1
278   versions:
279   - name: v1alpha1
280     served: true
281     storage: true
282
283
284 ---
285
286 apiVersion: v1
287 kind: ServiceAccount
288 metadata:
289   name: k8s-nfn-sa
290   namespace: operator
291
292 ---
293
294 apiVersion: rbac.authorization.k8s.io/v1
295 kind: ClusterRole
296 metadata:
297   creationTimestamp: null
298   name: k8s-nfn-cr
299 rules:
300 - apiGroups:
301   - ""
302   resources:
303   - pods
304   - services
305   - endpoints
306   - persistentvolumeclaims
307   - events
308   - configmaps
309   - secrets
310   - nodes
311   verbs:
312   - '*'
313 - apiGroups:
314   - apps
315   resources:
316   - deployments
317   - daemonsets
318   - replicasets
319   - statefulsets
320   verbs:
321   - '*'
322 - apiGroups:
323   - monitoring.coreos.com
324   resources:
325   - servicemonitors
326   verbs:
327   - get
328   - create
329 - apiGroups:
330   - apps
331   resourceNames:
332   - nfn-operator
333   resources:
334   - deployments/finalizers
335   verbs:
336   - update
337 - apiGroups:
338   - k8s.plugin.opnfv.org
339   resources:
340   - '*'
341   - providernetworks
342   verbs:
343   - '*'
344
345 ---
346
347 kind: ClusterRoleBinding
348 apiVersion: rbac.authorization.k8s.io/v1
349 metadata:
350   name: k8s-nfn-crb
351 subjects:
352 - kind: Group
353   name: system:serviceaccounts
354   apiGroup: rbac.authorization.k8s.io
355 roleRef:
356   kind: ClusterRole
357   name: k8s-nfn-cr
358   apiGroup: rbac.authorization.k8s.io
359
360
361 ---
362
363 apiVersion: v1
364 kind: Service
365 metadata:
366   name: nfn-operator
367   namespace: operator
368 spec:
369   type: NodePort
370   ports:
371   - port: 50000
372     protocol: TCP
373     targetPort: 50000
374   selector:
375     name: nfn-operator
376
377
378 ---
379
380 apiVersion: apps/v1
381 kind: Deployment
382 metadata:
383   name: nfn-operator
384   namespace: operator
385 spec:
386   replicas: 1
387   selector:
388     matchLabels:
389       name: nfn-operator
390   template:
391     metadata:
392       labels:
393         name: nfn-operator
394     spec:
395       affinity:
396         nodeAffinity:
397           requiredDuringSchedulingIgnoredDuringExecution:
398             nodeSelectorTerms:
399             - matchExpressions:
400               - key: nfnType
401                 operator: In
402                 values:
403                 - operator
404       tolerations:
405        - key: "node-role.kubernetes.io/master"
406          effect: "NoSchedule"
407          operator: "Exists"
408       serviceAccountName: k8s-nfn-sa
409       containers:
410         - name: nfn-operator
411           image: integratedcloudnative/ovn4nfv-k8s-plugin:0.9.0
412           command: ["/usr/local/bin/entrypoint", "operator"]
413           imagePullPolicy: IfNotPresent
414           ports:
415           - containerPort: 50000
416             protocol: TCP
417           env:
418             - name: HOST_IP
419               valueFrom:
420                 fieldRef:
421                   fieldPath: status.hostIP
422             - name: POD_NAME
423               valueFrom:
424                 fieldRef:
425                   fieldPath: metadata.name
426             - name: OPERATOR_NAME
427               value: "nfn-operator"
428
429 ---
430 kind: ConfigMap
431 apiVersion: v1
432 metadata:
433   name: ovn4nfv-cni-config
434   namespace: operator
435   labels:
436     app: ovn4nfv
437 data:
438   ovn4nfv_k8s.conf: |
439           [logging]
440           loglevel=5
441           logfile=/var/log/openvswitch/ovn4k8s.log
442
443           [cni]
444           conf-dir=/etc/cni/net.d
445           plugin=ovn4nfvk8s-cni
446
447           [kubernetes]
448           kubeconfig=/etc/kubernetes/admin.conf
449
450 ---
451 apiVersion: extensions/v1beta1
452 kind: DaemonSet
453 metadata:
454   name: ovn4nfv-cni
455   namespace: operator
456   labels:
457     app: ovn4nfv
458 spec:
459   updateStrategy:
460     type: RollingUpdate
461   template:
462     metadata:
463       labels:
464         app: ovn4nfv
465     spec:
466       hostNetwork: true
467       nodeSelector:
468         beta.kubernetes.io/arch: amd64
469       tolerations:
470       - operator: Exists
471         effect: NoSchedule
472       containers:
473       - name: ovn4nfv
474         image: integratedcloudnative/ovn4nfv-k8s-plugin:0.9.0
475         imagePullPolicy: IfNotPresent
476         command: ["/usr/local/bin/entrypoint", "cni"]
477         resources:
478           requests:
479             cpu: "100m"
480             memory: "50Mi"
481           limits:
482             cpu: "100m"
483             memory: "50Mi"
484         securityContext:
485           privileged: true
486         volumeMounts:
487         - name: cnibin
488           mountPath: /host/opt/cni/bin
489         - name: cniconf
490           mountPath: /host/etc/openvswitch
491         - name: ovn4nfv-cfg
492           mountPath: /tmp/ovn4nfv-conf
493       volumes:
494         - name: cnibin
495           hostPath:
496             path: /opt/cni/bin
497         - name: cniconf
498           hostPath:
499             path: /etc/openvswitch
500         - name: ovn4nfv-cfg
501           configMap:
502             name: ovn4nfv-cni-config
503             items:
504             - key: ovn4nfv_k8s.conf
505               path: ovn4nfv_k8s.conf
506
507 ---
508 apiVersion: extensions/v1beta1
509 kind: DaemonSet
510 metadata:
511   name: nfn-agent
512   namespace: operator
513   labels:
514     app: nfn-agent
515 spec:
516   updateStrategy:
517     type: RollingUpdate
518   template:
519     metadata:
520       labels:
521         app: nfn-agent
522     spec:
523       hostNetwork: true
524       nodeSelector:
525         beta.kubernetes.io/arch: amd64
526       tolerations:
527       - operator: Exists
528         effect: NoSchedule
529       containers:
530       - name: nfn-agent
531         image: integratedcloudnative/ovn4nfv-k8s-plugin:0.9.0
532         imagePullPolicy: IfNotPresent
533         command: ["/usr/local/bin/entrypoint", "agent"]
534         resources:
535           requests:
536             cpu: "100m"
537             memory: "50Mi"
538           limits:
539             cpu: "100m"
540             memory: "50Mi"
541         env:
542           - name: NFN_NODE_NAME
543             valueFrom:
544               fieldRef:
545                 fieldPath: spec.nodeName
546         securityContext:
547           privileged: true
548         volumeMounts:
549         - mountPath: /run/openvswitch
550           name: host-run-ovs
551         - mountPath: /var/run/openvswitch
552           name: host-var-run-ovs
553       volumes:
554       - name: host-run-ovs
555         hostPath:
556           path: /run/openvswitch
557       - name: host-var-run-ovs
558         hostPath:
559           path: /var/run/openvswitch
560