Merge "Update versions of addons"
[icn.git] / deploy / nodus / base / ovn4nfv-k8s-plugin.yaml
1 ---
2 apiVersion: apiextensions.k8s.io/v1
3 kind: CustomResourceDefinition
4 metadata:
5   name: networkchainings.k8s.plugin.opnfv.org
6 spec:
7   group: k8s.plugin.opnfv.org
8   names:
9     kind: NetworkChaining
10     listKind: NetworkChainingList
11     plural: networkchainings
12     singular: networkchaining
13   scope: Namespaced
14   versions:
15     - name: v1alpha1
16       schema:
17         openAPIV3Schema:
18           description: NetworkChaining is the Schema for the networkchainings API
19           properties:
20             apiVersion:
21               description:
22                 "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:
28                 "Kind is a string value representing the REST resource this
29                 object represents. Servers may infer this from the endpoint the client
30                 submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
31               type: string
32             metadata:
33               type: object
34             spec:
35               description: NetworkChainingSpec defines the desired state of NetworkChaining
36               properties:
37                 chainType:
38                   type: string
39                 routingSpec:
40                   properties:
41                     left:
42                       items:
43                         properties:
44                           gatewayIp:
45                             type: string
46                           networkName:
47                             type: string
48                           subnet:
49                             type: string
50                           podSelector:
51                             type: object
52                             properties:
53                               matchExpressions:
54                                 type: array
55                                 items:
56                                   type: object
57                                   properties:
58                                     key:
59                                       type: string
60                                     operator:
61                                       enum:
62                                         - In
63                                         - NotIn
64                                         - Exists
65                                         - DoesNotExist
66                                       type: string
67                                     values:
68                                       type: array
69                                       items:
70                                         type: string
71                                         pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$"
72                               matchLabels:
73                                 x-kubernetes-preserve-unknown-fields: true
74                           namespaceSelector:
75                             type: object
76                             properties:
77                               matchExpressions:
78                                 type: array
79                                 items:
80                                   type: object
81                                   properties:
82                                     key:
83                                       type: string
84                                     operator:
85                                       enum:
86                                         - In
87                                         - NotIn
88                                         - Exists
89                                         - DoesNotExist
90                                       type: string
91                                     values:
92                                       type: array
93                                       items:
94                                         type: string
95                                         pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$"
96                               matchLabels:
97                                 x-kubernetes-preserve-unknown-fields: true
98                         required:
99                           - gatewayIp
100                           - networkName
101                         type: object
102                       type: array
103                     namespace:
104                       type: string
105                     networkChain:
106                       type: string
107                     right:
108                       items:
109                         properties:
110                           gatewayIp:
111                             type: string
112                           networkName:
113                             type: string
114                           subnet:
115                             type: string
116                           podSelector:
117                             type: object
118                             properties:
119                               matchExpressions:
120                                 type: array
121                                 items:
122                                   type: object
123                                   properties:
124                                     key:
125                                       type: string
126                                     operator:
127                                       enum:
128                                         - In
129                                         - NotIn
130                                         - Exists
131                                         - DoesNotExist
132                                       type: string
133                                     values:
134                                       type: array
135                                       items:
136                                         type: string
137                                         pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$"
138                               matchLabels:
139                                 x-kubernetes-preserve-unknown-fields: true
140                           namespaceSelector:
141                             type: object
142                             properties:
143                               matchExpressions:
144                                 type: array
145                                 items:
146                                   type: object
147                                   properties:
148                                     key:
149                                       type: string
150                                     operator:
151                                       enum:
152                                         - In
153                                         - NotIn
154                                         - Exists
155                                         - DoesNotExist
156                                       type: string
157                                     values:
158                                       type: array
159                                       items:
160                                         type: string
161                                         pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$"
162                               matchLabels:
163                                 x-kubernetes-preserve-unknown-fields: true
164                         required:
165                           - gatewayIp
166                           - networkName
167                         type: object
168                       type: array
169                   required:
170                     - left
171                     - namespace
172                     - networkChain
173                     - right
174                   type: object
175               required:
176                 - chainType
177                 - routingSpec
178               type: object
179             status:
180               description: NetworkChainingStatus defines the observed state of NetworkChaining
181               properties:
182                 state:
183                   type: string
184               required:
185                 - state
186               type: object
187           type: object
188       served: true
189       storage: true
190       subresources:
191         status: {}
192 ---
193 apiVersion: apiextensions.k8s.io/v1
194 kind: CustomResourceDefinition
195 metadata:
196   name: networks.k8s.plugin.opnfv.org
197 spec:
198   group: k8s.plugin.opnfv.org
199   names:
200     kind: Network
201     listKind: NetworkList
202     plural: networks
203     singular: network
204   scope: Namespaced
205   versions:
206     - name: v1alpha1
207       schema:
208         openAPIV3Schema:
209           properties:
210             apiVersion:
211               description:
212                 "APIVersion defines the versioned schema of this representation
213                 of an object. Servers should convert recognized schemas to the latest
214                 internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"
215               type: string
216             kind:
217               description:
218                 "Kind is a string value representing the REST resource this
219                 object represents. Servers may infer this from the endpoint the client
220                 submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
221               type: string
222             metadata:
223               type: object
224             spec:
225               properties:
226                 cniType:
227                   description:
228                     'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
229                     Important: Run "operator-sdk generate k8s" to regenerate code after
230                     modifying this file Add custom validation using kubebuilder tags:
231                     https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
232                   type: string
233                 dns:
234                   properties:
235                     domain:
236                       type: string
237                     nameservers:
238                       items:
239                         type: string
240                       type: array
241                     options:
242                       items:
243                         type: string
244                       type: array
245                     search:
246                       items:
247                         type: string
248                       type: array
249                   type: object
250                 ipv4Subnets:
251                   items:
252                     properties:
253                       excludeIps:
254                         type: string
255                       gateway:
256                         type: string
257                       name:
258                         type: string
259                       subnet:
260                         type: string
261                     required:
262                       - name
263                       - subnet
264                     type: object
265                   type: array
266                 ipv6Subnets:
267                   items:
268                     properties:
269                       excludeIps:
270                         type: string
271                       gateway:
272                         type: string
273                       name:
274                         type: string
275                       subnet:
276                         type: string
277                     required:
278                       - name
279                       - subnet
280                     type: object
281                   type: array
282                 routes:
283                   items:
284                     properties:
285                       dst:
286                         type: string
287                       gw:
288                         type: string
289                     required:
290                       - dst
291                     type: object
292                   type: array
293               required:
294                 - cniType
295                 - ipv4Subnets
296               type: object
297             status:
298               properties:
299                 state:
300                   description:
301                     'INSERT ADDITIONAL STATUS FIELD - define observed state
302                     of cluster Important: Run "operator-sdk generate k8s" to regenerate
303                     code after modifying this file Add custom validation using kubebuilder
304                     tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
305                   type: string
306               required:
307                 - state
308               type: object
309           type: object
310       served: true
311       storage: true
312       subresources:
313         status: {}
314 ---
315 apiVersion: apiextensions.k8s.io/v1
316 kind: CustomResourceDefinition
317 metadata:
318   name: providernetworks.k8s.plugin.opnfv.org
319 spec:
320   group: k8s.plugin.opnfv.org
321   names:
322     kind: ProviderNetwork
323     listKind: ProviderNetworkList
324     plural: providernetworks
325     singular: providernetwork
326   scope: Namespaced
327   versions:
328     - name: v1alpha1
329       schema:
330         openAPIV3Schema:
331           description: ProviderNetwork is the Schema for the providernetworks API
332           properties:
333             apiVersion:
334               description:
335                 "APIVersion defines the versioned schema of this representation
336                 of an object. Servers should convert recognized schemas to the latest
337                 internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
338               type: string
339             kind:
340               description:
341                 "Kind is a string value representing the REST resource this
342                 object represents. Servers may infer this from the endpoint the client
343                 submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
344               type: string
345             metadata:
346               type: object
347             spec:
348               description: ProviderNetworkSpec defines the desired state of ProviderNetwork
349               properties:
350                 cniType:
351                   description:
352                     'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
353                     Important: Run "operator-sdk generate k8s" to regenerate code after
354                     modifying this file Add custom validation using kubebuilder tags:
355                     https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
356                   type: string
357                 direct:
358                   properties:
359                     directNodeSelector:
360                       type: string
361                     nodeLabelList:
362                       items:
363                         type: string
364                       type: array
365                     providerInterfaceName:
366                       type: string
367                   required:
368                     - directNodeSelector
369                     - providerInterfaceName
370                   type: object
371                 dns:
372                   properties:
373                     domain:
374                       type: string
375                     nameservers:
376                       items:
377                         type: string
378                       type: array
379                     options:
380                       items:
381                         type: string
382                       type: array
383                     search:
384                       items:
385                         type: string
386                       type: array
387                   type: object
388                 ipv4Subnets:
389                   items:
390                     properties:
391                       excludeIps:
392                         type: string
393                       gateway:
394                         type: string
395                       name:
396                         type: string
397                       subnet:
398                         type: string
399                     required:
400                       - name
401                       - subnet
402                     type: object
403                   type: array
404                 ipv6Subnets:
405                   items:
406                     properties:
407                       excludeIps:
408                         type: string
409                       gateway:
410                         type: string
411                       name:
412                         type: string
413                       subnet:
414                         type: string
415                     required:
416                       - name
417                       - subnet
418                     type: object
419                   type: array
420                 providerNetType:
421                   type: string
422                 routes:
423                   items:
424                     properties:
425                       dst:
426                         type: string
427                       gw:
428                         type: string
429                     required:
430                       - dst
431                     type: object
432                   type: array
433                 vlan:
434                   properties:
435                     logicalInterfaceName:
436                       type: string
437                     nodeLabelList:
438                       items:
439                         type: string
440                       type: array
441                     providerInterfaceName:
442                       type: string
443                     vlanId:
444                       type: string
445                     vlanNodeSelector:
446                       type: string
447                   required:
448                     - providerInterfaceName
449                     - vlanId
450                     - vlanNodeSelector
451                   type: object
452               required:
453                 - cniType
454                 - ipv4Subnets
455                 - providerNetType
456               type: object
457             status:
458               description: ProviderNetworkStatus defines the observed state of ProviderNetwork
459               properties:
460                 state:
461                   description:
462                     'INSERT ADDITIONAL STATUS FIELD - define observed state
463                     of cluster Important: Run "operator-sdk generate k8s" to regenerate
464                     code after modifying this file Add custom validation using kubebuilder
465                     tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
466                   type: string
467               required:
468                 - state
469               type: object
470           type: object
471       served: true
472       storage: true
473       subresources:
474         status: {}
475 ---
476 apiVersion: v1
477 kind: ServiceAccount
478 metadata:
479   name: k8s-nfn-sa
480   namespace: kube-system
481
482 ---
483 apiVersion: rbac.authorization.k8s.io/v1
484 kind: ClusterRole
485 metadata:
486   creationTimestamp: null
487   name: k8s-nfn-cr
488 rules:
489   - apiGroups:
490       - ""
491     resources:
492       - pods
493       - pods/status
494       - services
495       - endpoints
496       - persistentvolumeclaims
497       - events
498       - configmaps
499       - secrets
500       - nodes
501       - namespaces
502     verbs:
503       - "*"
504   - apiGroups:
505       - apps
506     resources:
507       - deployments
508       - daemonsets
509       - replicasets
510       - statefulsets
511     verbs:
512       - "*"
513   - apiGroups:
514       - monitoring.coreos.com
515     resources:
516       - servicemonitors
517     verbs:
518       - get
519       - create
520   - apiGroups:
521       - apps
522     resourceNames:
523       - nfn-operator
524     resources:
525       - deployments/finalizers
526     verbs:
527       - update
528   - apiGroups:
529       - k8s.plugin.opnfv.org
530     resources:
531       - "*"
532       - providernetworks
533     verbs:
534       - "*"
535
536 ---
537 kind: ClusterRoleBinding
538 apiVersion: rbac.authorization.k8s.io/v1
539 metadata:
540   name: k8s-nfn-crb
541 subjects:
542   - kind: Group
543     name: system:serviceaccounts
544     apiGroup: rbac.authorization.k8s.io
545 roleRef:
546   kind: ClusterRole
547   name: k8s-nfn-cr
548   apiGroup: rbac.authorization.k8s.io
549
550 ---
551 apiVersion: v1
552 kind: Service
553 metadata:
554   name: nfn-operator
555   namespace: kube-system
556 spec:
557   type: NodePort
558   ports:
559     - port: 50000
560       protocol: TCP
561       targetPort: 50000
562   selector:
563     name: nfn-operator
564
565 ---
566 apiVersion: v1
567 kind: ConfigMap
568 metadata:
569   name: ovn-controller-network
570   namespace: kube-system
571 data:
572   OVN_SUBNET: "10.151.142.0/18"
573   OVN_GATEWAYIP: "10.151.142.1/18"
574
575 ---
576 apiVersion: apps/v1
577 kind: Deployment
578 metadata:
579   name: nfn-operator
580   namespace: kube-system
581 spec:
582   replicas: 1
583   selector:
584     matchLabels:
585       name: nfn-operator
586   template:
587     metadata:
588       labels:
589         name: nfn-operator
590     spec:
591       hostNetwork: true
592       affinity:
593         nodeAffinity:
594           requiredDuringSchedulingIgnoredDuringExecution:
595             nodeSelectorTerms:
596               - matchExpressions:
597                   - key: ovn4nfv-k8s-plugin
598                     operator: In
599                     values:
600                       - ovn-control-plane
601       tolerations:
602         - key: "node-role.kubernetes.io/master"
603           effect: "NoSchedule"
604           operator: "Exists"
605       serviceAccountName: k8s-nfn-sa
606       containers:
607         - name: nfn-operator
608           image: docker.io/integratedcloudnative/ovn4nfv-k8s-plugin:v5.0.0
609           command: ["/usr/local/bin/entrypoint", "operator"]
610           imagePullPolicy: IfNotPresent
611           envFrom:
612             - configMapRef:
613                 name: ovn-controller-network
614           ports:
615             - containerPort: 50000
616               protocol: TCP
617           env:
618             - name: POD_NAME
619               valueFrom:
620                 fieldRef:
621                   fieldPath: metadata.name
622             - name: OPERATOR_NAME
623               value: "nfn-operator"
624
625 ---
626 kind: ConfigMap
627 apiVersion: v1
628 metadata:
629   name: ovn4nfv-cni-config
630   namespace: kube-system
631   labels:
632     app: ovn4nfv
633 data:
634   ovn4nfv_k8s.conf: |
635     [logging]
636     loglevel=5
637     logfile=/var/log/openvswitch/ovn4k8s.log
638
639     [cni]
640     conf-dir=/etc/cni/net.d
641     plugin=ovn4nfvk8s-cni
642
643     [kubernetes]
644     kubeconfig=/etc/cni/net.d/ovn4nfv-k8s.d/ovn4nfv-k8s.kubeconfig
645   20-network.conf: |
646     {
647       "name": "ovn4nfv-k8s-plugin",
648       "type": "ovn4nfvk8s-cni",
649       "cniVersion": "0.3.1"
650     }
651
652 ---
653 apiVersion: apps/v1
654 kind: DaemonSet
655 metadata:
656   name: ovn4nfv-cni
657   namespace: kube-system
658   labels:
659     app: ovn4nfv
660 spec:
661   updateStrategy:
662     type: RollingUpdate
663   selector:
664     matchLabels:
665       app: ovn4nfv
666   template:
667     metadata:
668       labels:
669         app: ovn4nfv
670     spec:
671       hostNetwork: true
672       nodeSelector:
673         beta.kubernetes.io/arch: amd64
674       tolerations:
675         - operator: Exists
676           effect: NoSchedule
677       serviceAccountName: k8s-nfn-sa
678       containers:
679         - name: ovn4nfv
680           image: docker.io/integratedcloudnative/ovn4nfv-k8s-plugin:v5.0.0
681           command: ["/usr/local/bin/entrypoint", "cni"]
682           imagePullPolicy: IfNotPresent
683           resources:
684             requests:
685               cpu: 100m
686               memory: 50Mi
687             limits:
688               cpu: 100m
689               memory: 50Mi
690           securityContext:
691             privileged: true
692           volumeMounts:
693             - name: cni
694               mountPath: /host/etc/cni/net.d
695             - name: cnibin
696               mountPath: /host/opt/cni/bin
697             - name: cniconf
698               mountPath: /host/etc/openvswitch
699             - name: ovn4nfv-cfg
700               mountPath: /tmp/ovn4nfv-conf
701             - name: ovn4nfv-cni-net-conf
702               mountPath: /tmp/ovn4nfv-cni
703       volumes:
704         - name: cni
705           hostPath:
706             path: /etc/cni/net.d
707         - name: cnibin
708           hostPath:
709             path: /opt/cni/bin
710         - name: cniconf
711           hostPath:
712             path: /etc/openvswitch
713         - name: ovn4nfv-cfg
714           configMap:
715             name: ovn4nfv-cni-config
716             items:
717               - key: ovn4nfv_k8s.conf
718                 path: ovn4nfv_k8s.conf
719         - name: ovn4nfv-cni-net-conf
720           configMap:
721             name: ovn4nfv-cni-config
722             items:
723               - key: 20-network.conf
724                 path: 20-network.conf
725 ---
726 apiVersion: apps/v1
727 kind: DaemonSet
728 metadata:
729   name: nfn-agent
730   namespace: kube-system
731   labels:
732     app: nfn-agent
733 spec:
734   selector:
735     matchLabels:
736       app: nfn-agent
737   updateStrategy:
738     type: RollingUpdate
739   template:
740     metadata:
741       labels:
742         app: nfn-agent
743     spec:
744       hostNetwork: true
745       hostPID: true
746       nodeSelector:
747         beta.kubernetes.io/arch: amd64
748       tolerations:
749         - operator: Exists
750           effect: NoSchedule
751       serviceAccountName: k8s-nfn-sa
752       containers:
753         - name: nfn-agent
754           image: docker.io/integratedcloudnative/ovn4nfv-k8s-plugin:v5.0.0
755           command: ["/usr/local/bin/entrypoint", "agent"]
756           imagePullPolicy: IfNotPresent
757           envFrom:
758             - configMapRef:
759                 name: ovn-controller-network
760           resources:
761             requests:
762               cpu: 100m
763               memory: 50Mi
764             limits:
765               cpu: 100m
766               memory: 50Mi
767           env:
768             - name: NFN_NODE_NAME
769               valueFrom:
770                 fieldRef:
771                   fieldPath: spec.nodeName
772           securityContext:
773             runAsUser: 0
774             capabilities:
775               add: ["NET_ADMIN", "SYS_ADMIN", "SYS_PTRACE"]
776             privileged: true
777           volumeMounts:
778             - mountPath: /var/run/dbus/
779               name: host-var-run-dbus
780               readOnly: true
781             - mountPath: /run/openvswitch
782               name: host-run-ovs
783             - mountPath: /var/run/openvswitch
784               name: host-var-run-ovs
785             - mountPath: /var/run
786               name: host-var-run
787             - mountPath: /host/proc
788               name: host-proc
789             - mountPath: /host/sys
790               name: host-sys
791             - mountPath: /var/run/ovn4nfv-k8s-plugin
792               name: host-var-cniserver-socket-dir
793       volumes:
794         - name: host-run-ovs
795           hostPath:
796             path: /run/openvswitch
797         - name: host-var-run-ovs
798           hostPath:
799             path: /var/run/openvswitch
800         - name: host-var-run-dbus
801           hostPath:
802             path: /var/run/dbus
803         - name: host-var-cniserver-socket-dir
804           hostPath:
805             path: /var/run/ovn4nfv-k8s-plugin
806         - name: host-var-run
807           hostPath:
808             path: /var/run
809         - name: host-proc
810           hostPath:
811             path: /proc
812         - name: host-sys
813           hostPath:
814             path: /sys