From 002f4f6e9f602c69ce0d8e39e8dc1eabfdb5d9bf Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Mon, 23 Feb 2026 17:30:26 -0600 Subject: [PATCH] [OVS] Add .Values.openvswitch.extraContainers hook This is aligned with the Helm best practices when users can inject optional snippets into template. E.g exporter sidecar suits this use case. Change-Id: I5e0f7784f740a16314382d63717f1b749ef7903a Signed-off-by: Vladimir Kozhukalov --- openvswitch/templates/daemonset.yaml | 3 ++ openvswitch/values.yaml | 4 ++ .../notes/openvswitch-3401ba2f0dc8e1f6.yaml | 7 ++++ values_overrides/openvswitch/exporter.yaml | 38 +++++++++++++++++++ zuul.d/base.yaml | 4 +- 5 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/openvswitch-3401ba2f0dc8e1f6.yaml create mode 100644 values_overrides/openvswitch/exporter.yaml diff --git a/openvswitch/templates/daemonset.yaml b/openvswitch/templates/daemonset.yaml index 34f19312ca..f93b004be2 100644 --- a/openvswitch/templates/daemonset.yaml +++ b/openvswitch/templates/daemonset.yaml @@ -223,6 +223,9 @@ It should be handled through lcore and pmd core masks. */}} - name: var-tmp mountPath: /var/tmp {{- end }} + {{- with .Values.openvswitch.extraContainers }} + {{- tpl (toYaml .) $envAll | nindent 8 }} + {{- end }} volumes: - name: pod-tmp emptyDir: {} diff --git a/openvswitch/values.yaml b/openvswitch/values.yaml index 46cc22c636..8552290eb6 100644 --- a/openvswitch/values.yaml +++ b/openvswitch/values.yaml @@ -104,6 +104,7 @@ pod: - NET_ADMIN readOnlyRootFilesystem: true dns_policy: "ClusterFirstWithHostNet" + lifecycle: upgrades: daemonsets: @@ -209,6 +210,9 @@ manifests: network_policy: false secret_registry: true +openvswitch: + extraContainers: [] + conf: poststart: timeout: 5 diff --git a/releasenotes/notes/openvswitch-3401ba2f0dc8e1f6.yaml b/releasenotes/notes/openvswitch-3401ba2f0dc8e1f6.yaml new file mode 100644 index 0000000000..067da45bf5 --- /dev/null +++ b/releasenotes/notes/openvswitch-3401ba2f0dc8e1f6.yaml @@ -0,0 +1,7 @@ +--- +openvswitch: + - | + Introduce .Values.openvswitch.extraContainers hook to make it possible to + add extra containers to openvswitch daemonset, e.g. for monitoring + purposes. +... diff --git a/values_overrides/openvswitch/exporter.yaml b/values_overrides/openvswitch/exporter.yaml new file mode 100644 index 0000000000..271eb50d9e --- /dev/null +++ b/values_overrides/openvswitch/exporter.yaml @@ -0,0 +1,38 @@ +--- +openvswitch: + extraContainers: + - name: ovs-exporter + image: ghcr.io/saeed-mcu/ovs_exporter/openvswitch_exporter:v2.3.2 + imagePullPolicy: IfNotPresent + ports: + - name: metrics + containerPort: 9475 + protocol: TCP + livenessProbe: + httpGet: + path: /metrics + port: 9475 + initialDelaySeconds: 30 + periodSeconds: 60 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /metrics + port: 9475 + initialDelaySeconds: 15 + periodSeconds: 30 + timeoutSeconds: 5 + securityContext: + readOnlyRootFilesystem: true + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "256Mi" + cpu: "500m" + volumeMounts: + - name: run + mountPath: /run + readOnly: true +... diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index ced498f412..d63c5902fd 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -149,7 +149,9 @@ - ./tools/deployment/component/keystone/keystone.sh - ./tools/deployment/component/heat/heat.sh - export GLANCE_BACKEND=local; ./tools/deployment/component/glance/glance.sh - - ./tools/deployment/component/compute-kit/openvswitch.sh + - >- + export OSH_EXTRA_HELM_ARGS="--values ../openstack-helm/values_overrides/openvswitch/exporter.yaml"; + ./tools/deployment/component/compute-kit/openvswitch.sh - >- export OSH_EXTRA_HELM_ARGS="--values ../openstack-helm/values_overrides/libvirt/inovex_exporter.yaml"; ./tools/deployment/component/compute-kit/libvirt.sh