X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ffoundation%2Fscripts%2Fcni%2Fovn-kubernetes%2Fyaml%2Fovnkube-db.yaml;fp=src%2Ffoundation%2Fscripts%2Fcni%2Fovn-kubernetes%2Fyaml%2Fovnkube-db.yaml;h=602e27be9ef7e90dfd2498910a0cb3bd03ef3d4f;hb=a4546182269b01038a1e672cb16b081930bd11bb;hp=0000000000000000000000000000000000000000;hpb=59b4dc71733209d00625e0ed2f342417fd09d998;p=iec.git diff --git a/src/foundation/scripts/cni/ovn-kubernetes/yaml/ovnkube-db.yaml b/src/foundation/scripts/cni/ovn-kubernetes/yaml/ovnkube-db.yaml new file mode 100644 index 0000000..602e27b --- /dev/null +++ b/src/foundation/scripts/cni/ovn-kubernetes/yaml/ovnkube-db.yaml @@ -0,0 +1,162 @@ +# yamllint disable rule:hyphens rule:commas rule:indentation +# ovnkube-db +# daemonset version 3 +# starts ovn NB/SB ovsdb daemons, each in a separate container +# it is running on master node for now, but does not need to be the case +kind: Deployment +apiVersion: apps/v1 +metadata: + name: ovnkube-db + # namespace set up by install + namespace: ovn-kubernetes + annotations: + kubernetes.io/description: | + This daemonset launches the OVN NB/SB ovsdb service components. +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + name: ovnkube-db + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + labels: + name: ovnkube-db + component: network + type: infra + openshift.io/component: network + beta.kubernetes.io/os: "linux" + annotations: + scheduler.alpha.kubernetes.io/critical-pod: '' + spec: + # Requires fairly broad permissions - ability to read all services and network functions as well + # as all pods. + serviceAccountName: ovn + hostNetwork: true + containers: + # firewall rules for ovn - assumed to be setup + # iptables -A OS_FIREWALL_ALLOW -p tcp -m state --state NEW -m tcp --dport 6641 -j ACCEPT + # iptables -A OS_FIREWALL_ALLOW -p tcp -m state --state NEW -m tcp --dport 6642 -j ACCEPT + + # nb-ovsdb - v3 + - name: nb-ovsdb + image: "iecedge/ovn-daemonset:latest" + imagePullPolicy: "IfNotPresent" + + command: ["/root/ovnkube.sh", "nb-ovsdb"] + + securityContext: + runAsUser: 0 + capabilities: + add: ["NET_ADMIN"] + + volumeMounts: + # ovn db is stored in the pod in /etc/openvswitch + # and on the host in /var/lib/openvswitch/ + - mountPath: /etc/openvswitch/ + name: host-var-lib-ovs + - mountPath: /var/log/openvswitch/ + name: host-var-log-ovs + + resources: + requests: + cpu: 100m + memory: 300Mi + env: + - name: OVN_DAEMONSET_VERSION + value: "3" + - name: OVN_LOG_NB + value: "-vconsole:info -vfile:info" + - name: K8S_APISERVER + valueFrom: + configMapKeyRef: + name: ovn-config + key: k8s_apiserver + - name: OVN_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + ports: + - name: healthz + containerPort: 10256 + # TODO: Temporarily disabled until we determine how to wait for clean default + # config + # livenessProbe: + # initialDelaySeconds: 10 + # httpGet: + # path: /healthz + # port: 10256 + # scheme: HTTP + lifecycle: + # end of container + + # sb-ovsdb - v3 + - name: sb-ovsdb + image: "iecedge/ovn-daemonset:latest" + imagePullPolicy: "IfNotPresent" + + command: ["/root/ovnkube.sh", "sb-ovsdb"] + + securityContext: + runAsUser: 0 + capabilities: + add: ["NET_ADMIN"] + + volumeMounts: + # ovn db is stored in the pod in /etc/openvswitch + # and on the host in /var/lib/openvswitch/ + - mountPath: /etc/openvswitch/ + name: host-var-lib-ovs + - mountPath: /var/log/openvswitch/ + name: host-var-log-ovs + + resources: + requests: + cpu: 100m + memory: 300Mi + env: + - name: OVN_DAEMONSET_VERSION + value: "3" + - name: OVN_LOG_SB + value: "-vconsole:info -vfile:info" + - name: K8S_APISERVER + valueFrom: + configMapKeyRef: + name: ovn-config + key: k8s_apiserver + - name: OVN_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + ports: + - name: healthz + containerPort: 10255 + # TODO: Temporarily disabled until we determine how to wait for clean default + # config + # livenessProbe: + # initialDelaySeconds: 10 + # httpGet: + # path: /healthz + # port: 10255 + # scheme: HTTP + lifecycle: + # end of container + + nodeSelector: + node-role.kubernetes.io/master: "" + beta.kubernetes.io/os: "linux" + volumes: + - name: host-var-lib-ovs + hostPath: + path: /var/lib/openvswitch + - name: host-var-log-ovs + hostPath: + path: /var/log/openvswitch + tolerations: + - operator: "Exists"