diff --git a/charts/templates/ovn-dpdk-ds.yaml b/charts/templates/ovn-dpdk-ds.yaml new file mode 100644 index 00000000000..9be3d6bf99d --- /dev/null +++ b/charts/templates/ovn-dpdk-ds.yaml @@ -0,0 +1,157 @@ +{{- if .Values.HYBRID_DPDK }} +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: ovs-ovn-dpdk + namespace: kube-system + annotations: + kubernetes.io/description: | + This daemon set launches the openvswitch daemon. +spec: + selector: + matchLabels: + app: ovs-dpdk + updateStrategy: + type: OnDelete + template: + metadata: + labels: + app: ovs-dpdk + component: network + type: infra + spec: + tolerations: + - operator: Exists + priorityClassName: system-node-critical + serviceAccountName: ovn-ovs + hostNetwork: true + hostPID: true + containers: + - name: openvswitch + image: {{ .Values.global.registry.address }}/{{ .Values.global.images.kubeovn.repository }}:{{ .Values.global.images.kubeovn.tag }}-dpdk + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["/kube-ovn/start-ovs-dpdk-v2.sh"] + securityContext: + runAsUser: 0 + privileged: true + env: + - name: ENABLE_SSL + value: "{{ .Values.networking.ENABLE_SSL }}" + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: HW_OFFLOAD + value: "{{- .Values.func.HW_OFFLOAD }}" + - name: TUNNEL_TYPE + value: "{{- .Values.networking.TUNNEL_TYPE }}" + - name: DPDK_TUNNEL_IFACE + value: "{{- .Values.networking.DPDK_TUNNEL_IFACE }}" + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: OVN_DB_IPS + value: "{{ .Values.MASTER_NODES }}" + volumeMounts: + - mountPath: /opt/ovs-config + name: host-config-ovs + - name: shareddir + mountPath: {{ .Values.kubelet_conf.KUBELET_DIR }}/pods + - name: hugepage + mountPath: /dev/hugepages + - mountPath: /lib/modules + name: host-modules + readOnly: true + - mountPath: /var/run/openvswitch + name: host-run-ovs + mountPropagation: HostToContainer + - mountPath: /var/run/ovn + name: host-run-ovn + - mountPath: /sys + name: host-sys + - mountPath: /etc/openvswitch + name: host-config-openvswitch + - mountPath: /etc/ovn + name: host-config-ovn + - mountPath: /var/log/openvswitch + name: host-log-ovs + - mountPath: /var/log/ovn + name: host-log-ovn + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /var/run/tls + name: kube-ovn-tls + readinessProbe: + exec: + command: + - bash + - -c + - LOG_ROTATE=true /kube-ovn/ovs-healthcheck.sh + periodSeconds: 5 + timeoutSeconds: 45 + livenessProbe: + exec: + command: + - bash + - /kube-ovn/ovs-healthcheck.sh + initialDelaySeconds: 60 + periodSeconds: 5 + failureThreshold: 5 + timeoutSeconds: 45 + resources: + requests: + cpu: {{ index .Values "ovs-ovn" "requests" "cpu" }} + memory: {{ index .Values "ovs-ovn" "requests" "memory" }} + limits: + cpu: {{ index .Values "ovs-ovn" "limits" "cpu" }} + {{.Values.HUGEPAGE_SIZE_TYPE}}: {{.Values.HUGEPAGES}} + memory: {{ index .Values "ovs-ovn" "limits" "memory" }} + nodeSelector: + kubernetes.io/os: "linux" + ovn.kubernetes.io/ovs_dp_type: "userspace" + volumes: + - name: host-config-ovs + hostPath: + path: /opt/ovs-config + type: DirectoryOrCreate + - name: shareddir + hostPath: + path: {{ .Values.kubelet_conf.KUBELET_DIR }}/pods + type: '' + - name: hugepage + emptyDir: + medium: HugePages + - name: host-modules + hostPath: + path: /lib/modules + - name: host-run-ovs + hostPath: + path: /run/openvswitch + - name: host-run-ovn + hostPath: + path: /run/ovn + - name: host-sys + hostPath: + path: /sys + - name: host-config-openvswitch + hostPath: + path: /etc/origin/openvswitch + - name: host-config-ovn + hostPath: + path: /etc/origin/ovn + - name: host-log-ovs + hostPath: + path: /var/log/openvswitch + - name: host-log-ovn + hostPath: + path: /var/log/ovn + - name: localtime + hostPath: + path: /etc/localtime + - name: kube-ovn-tls + secret: + optional: true + secretName: kube-ovn-tls +{{- end }} diff --git a/charts/templates/ovsovn-ds.yaml b/charts/templates/ovsovn-ds.yaml index 165368920ae..14db9f41374 100644 --- a/charts/templates/ovsovn-ds.yaml +++ b/charts/templates/ovsovn-ds.yaml @@ -37,16 +37,12 @@ spec: - name: openvswitch {{- if .Values.DPDK }} image: {{ .Values.global.registry.address }}/{{ .Values.global.images.kubeovn.dpdkRepository }}:{{ .Values.DPDK_VERSION }}-{{ .Values.global.images.kubeovn.tag }} - {{- else if .Values.HYBRID_DPDK }} - image: {{ .Values.global.registry.address }}/{{ .Values.global.images.kubeovn.repository }}:{{ .Values.global.images.kubeovn.tag }}-dpdk {{- else }} image: {{ .Values.global.registry.address }}/{{ .Values.global.images.kubeovn.repository }}:{{ .Values.global.images.kubeovn.tag }} {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.DPDK }} command: ["/kube-ovn/start-ovs-dpdk.sh"] - {{- else if .Values.HYBRID_DPDK }} - command: ["/kube-ovn/start-ovs-dpdk-v2.sh"] {{- else }} command: ["/kube-ovn/start-ovs.sh"] {{- end }} @@ -78,10 +74,6 @@ spec: fieldPath: spec.nodeName - name: OVN_DB_IPS value: "{{ .Values.MASTER_NODES }}" - {{- if .Values.HYBRID_DPDK }} - - name: DPDK_TUNNEL_IFACE - value: "{{- .Values.networking.DPDK_TUNNEL_IFACE }}" - {{- end }} volumeMounts: - mountPath: /var/run/netns name: host-ns @@ -111,16 +103,12 @@ spec: name: kube-ovn-tls - mountPath: /var/run/containerd name: cruntime - {{- if or .Values.DPDK .Values.HYBRID_DPDK }} + {{- if .Values.DPDK }} - mountPath: /opt/ovs-config name: host-config-ovs - mountPath: /dev/hugepages name: hugepage {{- end }} - {{- if .Values.HYBRID_DPDK }} - - name: shareddir - mountPath: {{ .Values.kubelet_conf.KUBELET_DIR }}/pods - {{- end }} readinessProbe: exec: {{- if .Values.DPDK }} @@ -156,10 +144,6 @@ spec: {{- if .Values.DPDK }} cpu: {{ .Values.DPDK_CPU }} memory: {{ .Values.DPDK_MEMORY }} - {{- else if .Values.HYBRID_DPDK }} - cpu: {{ .Values.DPDK_CPU }} - memory: {{ .Values.DPDK_MEMORY }} - hugepages-2Mi: 1Gi {{- else }} cpu: {{ index .Values "ovs-ovn" "requests" "cpu" }} memory: {{ index .Values "ovs-ovn" "requests" "memory" }} @@ -169,10 +153,6 @@ spec: cpu: {{ .Values.DPDK_CPU }} memory: {{ .Values.DPDK_MEMORY }} hugepages-1Gi: 1Gi - {{- else if .Values.HYBRID_DPDK }} - cpu: {{ .Values.DPDK_CPU }} - memory: {{ .Values.DPDK_MEMORY }} - hugepages-2Mi: 1Gi {{- else }} cpu: {{ index .Values "ovs-ovn" "limits" "cpu" }} memory: {{ index .Values "ovs-ovn" "limits" "memory" }} @@ -218,7 +198,7 @@ spec: path: /var/run/containerd name: cruntime readOnly: true - {{- if or .Values.DPDK .Values.HYBRID_DPDK }} + {{- if .Values.DPDK }} - name: host-config-ovs hostPath: path: /opt/ovs-config @@ -227,9 +207,3 @@ spec: emptyDir: medium: HugePages {{- end }} - {{- if .Values.HYBRID_DPDK }} - - name: shareddir - hostPath: - path: /pods - type: '' - {{- end }} diff --git a/charts/values.yaml b/charts/values.yaml index f6a1cce7b2f..21ad153a8c3 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -113,6 +113,8 @@ restart_ovs: false # hybrid dpdk HYBRID_DPDK: false +HUGEPAGE_SIZE_TYPE: hugepages-2Mi # Default +HUGEPAGES: 1Gi # DPDK DPDK: false @@ -161,4 +163,4 @@ kube-ovn-monitor: memory: "200Mi" limits: cpu: "200m" - memory: "200Mi" \ No newline at end of file + memory: "200Mi"