From 5aed17d744ca87a5fb1703c8dc0bdbe395064a38 Mon Sep 17 00:00:00 2001 From: okozachenko1203 Date: Fri, 25 Oct 2024 02:54:46 +1100 Subject: [PATCH] ovn: make gateway label configurable Change-Id: I88ab77e61e9766e12eb3aff899e0d6dd24a8d3c0 --- ovn/Chart.yaml | 2 +- ovn/templates/bin/_ovn-controller-init.sh.tpl | 2 +- ovn/templates/daemonset-controller.yaml | 6 +++--- ovn/templates/statefulset-ovsdb-nb.yaml | 2 +- ovn/templates/statefulset-ovsdb-sb.yaml | 2 +- ovn/values.yaml | 4 +++- releasenotes/notes/ovn.yaml | 1 + 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ovn/Chart.yaml b/ovn/Chart.yaml index 38837da43..0caaabd48 100644 --- a/ovn/Chart.yaml +++ b/ovn/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v23.3.0 description: OpenStack-Helm OVN name: ovn -version: 0.1.13 +version: 0.1.14 home: https://www.ovn.org icon: https://www.ovn.org/images/ovn-logo.png sources: diff --git a/ovn/templates/bin/_ovn-controller-init.sh.tpl b/ovn/templates/bin/_ovn-controller-init.sh.tpl index 55cc2ecba..585e2fcae 100644 --- a/ovn/templates/bin/_ovn-controller-init.sh.tpl +++ b/ovn/templates/bin/_ovn-controller-init.sh.tpl @@ -119,7 +119,7 @@ ovs-vsctl set open . external-ids:ovn-bridge="{{ .Values.conf.ovn_bridge }}" ovs-vsctl set open . external-ids:ovn-bridge-mappings="{{ .Values.conf.ovn_bridge_mappings }}" GW_ENABLED=$(cat /tmp/gw-enabled/gw-enabled) -if [[ ${GW_ENABLED} == enabled ]]; then +if [[ ${GW_ENABLED} == {{ .Values.labels.ovn_controller_gw.node_selector_value }} ]]; then ovs-vsctl set open . external-ids:ovn-cms-options={{ .Values.conf.ovn_cms_options_gw_enabled }} else ovs-vsctl set open . external-ids:ovn-cms-options={{ .Values.conf.ovn_cms_options }} diff --git a/ovn/templates/daemonset-controller.yaml b/ovn/templates/daemonset-controller.yaml index f27903fca..e3acfadde 100644 --- a/ovn/templates/daemonset-controller.yaml +++ b/ovn/templates/daemonset-controller.yaml @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.daemonset_controller }} +{{- if .Values.manifests.daemonset_ovn_controller }} {{- $envAll := . }} {{- $configMapName := "ovn-etc" }} @@ -71,7 +71,7 @@ spec: hostNetwork: true hostPID: true hostIPC: true - dnsPolicy: ClusterFirstWithHostNet + dnsPolicy: {{ .Values.pod.dns_policy }} nodeSelector: {{ .Values.labels.ovn_controller.node_selector_key }}: {{ .Values.labels.ovn_controller.node_selector_value }} initContainers: @@ -82,7 +82,7 @@ spec: - /bin/bash - -c - | - kubectl get node ${NODENAME} -o jsonpath='{.metadata.labels.l3-agent}' > /tmp/gw-enabled/gw-enabled + kubectl get node ${NODENAME} -o jsonpath='{.metadata.labels.{{ .Values.labels.ovn_controller_gw.node_selector_key }}}' > /tmp/gw-enabled/gw-enabled env: - name: NODENAME valueFrom: diff --git a/ovn/templates/statefulset-ovsdb-nb.yaml b/ovn/templates/statefulset-ovsdb-nb.yaml index 95a33b1bf..04958165d 100644 --- a/ovn/templates/statefulset-ovsdb-nb.yaml +++ b/ovn/templates/statefulset-ovsdb-nb.yaml @@ -58,7 +58,7 @@ spec: - name: OVS_DATABASE value: nb - name: OVS_PORT - value: "{{ tuple "ovn-ovsdb-nb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" + value: {{ tuple "ovn-ovsdb-nb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} command: - /tmp/ovsdb-server.sh - start diff --git a/ovn/templates/statefulset-ovsdb-sb.yaml b/ovn/templates/statefulset-ovsdb-sb.yaml index d300d3f90..9e7b66702 100644 --- a/ovn/templates/statefulset-ovsdb-sb.yaml +++ b/ovn/templates/statefulset-ovsdb-sb.yaml @@ -58,7 +58,7 @@ spec: - name: OVS_DATABASE value: sb - name: OVS_PORT - value: "{{ tuple "ovn-ovsdb-sb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" + value: {{ tuple "ovn-ovsdb-sb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} command: - /tmp/ovsdb-server.sh - start diff --git a/ovn/values.yaml b/ovn/values.yaml index 8c3dc5a34..65e602e6f 100644 --- a/ovn/values.yaml +++ b/ovn/values.yaml @@ -47,6 +47,9 @@ labels: ovn_controller: node_selector_key: openvswitch node_selector_value: enabled + ovn_controller_gw: + node_selector_key: l3-agent + node_selector_value: enabled volume: ovn_ovsdb_nb: @@ -312,7 +315,6 @@ manifests: configmap_bin: true configmap_etc: true deployment_northd: true - daemonset_controller: true service_ovn_ovsdb_nb: true service_ovn_ovsdb_sb: true statefulset_ovn_ovsdb_nb: true diff --git a/releasenotes/notes/ovn.yaml b/releasenotes/notes/ovn.yaml index fb7b6efc0..acc205206 100644 --- a/releasenotes/notes/ovn.yaml +++ b/releasenotes/notes/ovn.yaml @@ -14,4 +14,5 @@ ovn: - 0.1.11 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default - 0.1.12 Fix oci_image_registry secret name - 0.1.13 Allow share OVN DB NB/SB socket + - 0.1.14 Make the label for OVN controller gateway configurable ...