chore(ovn): clean-up more code
diff --git a/charts/libvirt/values.yaml b/charts/libvirt/values.yaml
index c245c25..f21a100 100644
--- a/charts/libvirt/values.yaml
+++ b/charts/libvirt/values.yaml
@@ -179,6 +179,13 @@
- endpoint: node
service: local_image_registry
targeted:
+ ovn:
+ libvirt:
+ pod:
+ - requireSameNode: true
+ labels:
+ application: ovn
+ component: ovn-controller
openvswitch:
libvirt:
pod:
diff --git a/charts/neutron/values.yaml b/charts/neutron/values.yaml
index 114efa4..1b2c639 100644
--- a/charts/neutron/values.yaml
+++ b/charts/neutron/values.yaml
@@ -161,7 +161,13 @@
sriov: {}
l2gateway: {}
bagpipe_bgp: {}
- ovn: {}
+ ovn:
+ libvirt:
+ pod:
+ - requireSameNode: true
+ labels:
+ application: ovn
+ component: ovn-controller
openvswitch:
dhcp:
pod:
diff --git a/charts/nova/values.yaml b/charts/nova/values.yaml
index ec04358..d4ce127 100644
--- a/charts/nova/values.yaml
+++ b/charts/nova/values.yaml
@@ -269,6 +269,13 @@
- endpoint: node
service: local_image_registry
targeted:
+ ovn:
+ libvirt:
+ pod:
+ - requireSameNode: true
+ labels:
+ application: ovn
+ component: ovn-controller
openvswitch:
compute:
pod:
diff --git a/charts/ovn/templates/bin/_ovn-controller-init.sh.tpl b/charts/ovn/templates/bin/_ovn-controller-init.sh.tpl
index 248cfc9..aa3ff6d 100644
--- a/charts/ovn/templates/bin/_ovn-controller-init.sh.tpl
+++ b/charts/ovn/templates/bin/_ovn-controller-init.sh.tpl
@@ -49,7 +49,7 @@
{{- if empty .Values.conf.ovn_remote -}}
{{- $sb_svc_name := "ovn-ovsdb-sb" -}}
{{- $sb_svc := (tuple $sb_svc_name "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup") -}}
-{{- $sb_port := (tuple "ovn-ovsdb-sb" "internal" "raft" . | include "helm-toolkit.endpoints.endpoint_port_lookup") -}}
+{{- $sb_port := (tuple "ovn-ovsdb-sb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup") -}}
{{- $sb_service_list := list -}}
{{- range $i := until (.Values.pod.replicas.ovn_ovsdb_sb | int) -}}
{{- $sb_service_list = printf "tcp:%s-%d.%s:%s" $sb_svc_name $i $sb_svc $sb_port | append $sb_service_list -}}
diff --git a/charts/ovn/templates/bin/_ovn-northd.sh.tpl b/charts/ovn/templates/bin/_ovn-northd.sh.tpl
index bb61c58..fefd793 100644
--- a/charts/ovn/templates/bin/_ovn-northd.sh.tpl
+++ b/charts/ovn/templates/bin/_ovn-northd.sh.tpl
@@ -18,7 +18,7 @@
{{- $nb_svc_name := "ovn-ovsdb-nb" -}}
{{- $nb_svc := (tuple $nb_svc_name "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup") -}}
-{{- $nb_port := (tuple "ovn-ovsdb-nb" "internal" "raft" . | include "helm-toolkit.endpoints.endpoint_port_lookup") -}}
+{{- $nb_port := (tuple "ovn-ovsdb-nb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup") -}}
{{- $nb_service_list := list -}}
{{- range $i := until (.Values.pod.replicas.ovn_ovsdb_nb | int) -}}
{{- $nb_service_list = printf "tcp:%s-%d.%s:%s" $nb_svc_name $i $nb_svc $nb_port | append $nb_service_list -}}
@@ -26,7 +26,7 @@
{{- $sb_svc_name := "ovn-ovsdb-sb" -}}
{{- $sb_svc := (tuple $sb_svc_name "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup") -}}
-{{- $sb_port := (tuple "ovn-ovsdb-sb" "internal" "raft" . | include "helm-toolkit.endpoints.endpoint_port_lookup") -}}
+{{- $sb_port := (tuple "ovn-ovsdb-sb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup") -}}
{{- $sb_service_list := list -}}
{{- range $i := until (.Values.pod.replicas.ovn_ovsdb_sb | int) -}}
{{- $sb_service_list = printf "tcp:%s-%d.%s:%s" $sb_svc_name $i $sb_svc $sb_port | append $sb_service_list -}}
diff --git a/charts/ovn/templates/daemonset-controller.yaml b/charts/ovn/templates/daemonset-controller.yaml
index 32222ee..1c6596e 100644
--- a/charts/ovn/templates/daemonset-controller.yaml
+++ b/charts/ovn/templates/daemonset-controller.yaml
@@ -42,6 +42,8 @@
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
serviceAccountName: {{ $serviceAccountName }}
+ hostNetwork: true
+ dnsPolicy: {{ .Values.pod.dns_policy }}
nodeSelector:
{{ .Values.labels.ovn_controller.node_selector_key }}: {{ .Values.labels.ovn_controller.node_selector_value }}
initContainers:
diff --git a/charts/ovn/templates/statefulset-ovsdb-nb.yaml b/charts/ovn/templates/statefulset-ovsdb-nb.yaml
deleted file mode 100644
index bda1ab9..0000000
--- a/charts/ovn/templates/statefulset-ovsdb-nb.yaml
+++ /dev/null
@@ -1,102 +0,0 @@
-{{/*
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/}}
-
-{{- if .Values.manifests.statefulset_ovn_ovsdb_nb }}
-{{- $envAll := . }}
-
-{{- $serviceAccountName := "ovn-ovsdb-nb" }}
-{{ tuple $envAll "ovn_ovsdb_nb" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
----
-apiVersion: apps/v1
-kind: StatefulSet
-metadata:
- name: ovn-ovsdb-nb
- annotations:
- {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
- labels:
-{{ tuple $envAll "ovn" "ovn-ovsdb-nb" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
-spec:
- serviceName: {{ tuple "ovn-ovsdb-nb" "direct" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
- replicas: {{ .Values.pod.replicas.ovn_ovsdb_nb }}
- selector:
- matchLabels:
-{{ tuple $envAll "ovn" "ovn-ovsdb-nb" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
- template:
- metadata:
- labels:
-{{ tuple $envAll "ovn" "ovn-ovsdb-nb" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
- annotations:
-{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
- configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
- spec:
- serviceAccountName: {{ $serviceAccountName }}
- affinity:
-{{- tuple $envAll "ovn" "ovn-ovsdb-nb" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
- nodeSelector:
- {{ .Values.labels.ovn_ovsdb_nb.node_selector_key }}: {{ .Values.labels.ovn_ovsdb_nb.node_selector_value }}
- initContainers:
-{{- tuple $envAll "ovn_ovsdb_nb" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
- containers:
- - name: ovsdb
-{{ tuple $envAll "ovn_ovsdb_nb" | include "helm-toolkit.snippets.image" | indent 10 }}
-{{ tuple $envAll $envAll.Values.pod.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
- ports:
- - containerPort: {{ tuple "ovn-ovsdb-nb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- - containerPort: {{ tuple "ovn-ovsdb-nb" "internal" "raft" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- env:
- - name: OVS_DATABASE
- value: nb
- - name: OVS_PORT
- value: "{{ tuple "ovn-ovsdb-nb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}"
- command:
- - /tmp/ovsdb-server.sh
- - start
- lifecycle:
- preStop:
- exec:
- command:
- - /tmp/ovsdb-server.sh
- - stop
- volumeMounts:
- - name: ovn-bin
- mountPath: /tmp/ovsdb-server.sh
- subPath: ovsdb-server.sh
- readOnly: true
- - name: run-openvswitch
- mountPath: /run/openvswitch
- - name: data
- mountPath: /var/lib/ovn
- volumes:
- - name: run-openvswitch
- emptyDir: {}
- - name: ovn-bin
- configMap:
- name: ovn-bin
- defaultMode: 0555
-{{- if not .Values.volume.ovn_ovsdb_nb.enabled }}
- - name: data
- emptyDir: {}
-{{- else }}
- volumeClaimTemplates:
- - metadata:
- name: data
- spec:
- accessModes: ["ReadWriteOnce"]
- storageClassName: {{ $envAll.Values.volume.ovn_ovsdb_nb.class_name }}
- resources:
- requests:
- storage: {{ $envAll.Values.volume.ovn_ovsdb_nb.size }}
-{{- end }}
-
-{{- end }}
diff --git a/charts/ovn/templates/statefulset-ovsdb-sb.yaml b/charts/ovn/templates/statefulset-ovsdb-sb.yaml
deleted file mode 100644
index 3f4c6b9..0000000
--- a/charts/ovn/templates/statefulset-ovsdb-sb.yaml
+++ /dev/null
@@ -1,102 +0,0 @@
-{{/*
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/}}
-
-{{- if .Values.manifests.statefulset_ovn_ovsdb_sb }}
-{{- $envAll := . }}
-
-{{- $serviceAccountName := "ovn-ovsdb-sb" }}
-{{ tuple $envAll "ovn_ovsdb_sb" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
----
-apiVersion: apps/v1
-kind: StatefulSet
-metadata:
- name: ovn-ovsdb-sb
- annotations:
- {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
- labels:
-{{ tuple $envAll "ovn" "ovn-ovsdb-sb" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
-spec:
- serviceName: {{ tuple "ovn-ovsdb-sb" "direct" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
- replicas: {{ .Values.pod.replicas.ovn_ovsdb_sb }}
- selector:
- matchLabels:
-{{ tuple $envAll "ovn" "ovn-ovsdb-sb" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
- template:
- metadata:
- labels:
-{{ tuple $envAll "ovn" "ovn-ovsdb-sb" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
- annotations:
-{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
- configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
- spec:
- serviceAccountName: {{ $serviceAccountName }}
- affinity:
-{{- tuple $envAll "ovn" "ovn-ovsdb-sb" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
- nodeSelector:
- {{ .Values.labels.ovn_ovsdb_sb.node_selector_key }}: {{ .Values.labels.ovn_ovsdb_sb.node_selector_value }}
- initContainers:
-{{- tuple $envAll "ovn_ovsdb_sb" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
- containers:
- - name: ovsdb
-{{ tuple $envAll "ovn_ovsdb_sb" | include "helm-toolkit.snippets.image" | indent 10 }}
-{{ tuple $envAll $envAll.Values.pod.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
- ports:
- - containerPort: {{ tuple "ovn-ovsdb-sb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- - containerPort: {{ tuple "ovn-ovsdb-sb" "internal" "raft" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- env:
- - name: OVS_DATABASE
- value: sb
- - name: OVS_PORT
- value: "{{ tuple "ovn-ovsdb-sb" "internal" "ovsdb" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}"
- command:
- - /tmp/ovsdb-server.sh
- - start
- lifecycle:
- preStop:
- exec:
- command:
- - /tmp/ovsdb-server.sh
- - stop
- volumeMounts:
- - name: ovn-bin
- mountPath: /tmp/ovsdb-server.sh
- subPath: ovsdb-server.sh
- readOnly: true
- - name: run-openvswitch
- mountPath: /run/openvswitch
- - name: data
- mountPath: /var/lib/ovn
- volumes:
- - name: run-openvswitch
- emptyDir: {}
- - name: ovn-bin
- configMap:
- name: ovn-bin
- defaultMode: 0555
-{{- if not .Values.volume.ovn_ovsdb_sb.enabled }}
- - name: data
- emptyDir: {}
-{{- else }}
- volumeClaimTemplates:
- - metadata:
- name: data
- spec:
- accessModes: ["ReadWriteOnce"]
- resources:
- requests:
- storage: {{ $envAll.Values.volume.ovn_ovsdb_sb.size }}
- storageClassName: {{ $envAll.Values.volume.ovn_ovsdb_sb.class_name }}
-{{- end }}
-
-{{- end }}
diff --git a/roles/libvirt/vars/main.yml b/roles/libvirt/vars/main.yml
index a9bf991..6af7ad7 100644
--- a/roles/libvirt/vars/main.yml
+++ b/roles/libvirt/vars/main.yml
@@ -14,6 +14,9 @@
_libvirt_helm_values:
endpoints: "{{ openstack_helm_endpoints }}"
+ network:
+ backend:
+ - "{{ atmosphere_network_backend | default('openvswitch') }}"
images:
tags: "{{ atmosphere_images | vexxhost.atmosphere.openstack_helm_image_tags('libvirt') }}"
conf:
diff --git a/roles/nova/vars/main.yml b/roles/nova/vars/main.yml
index 8c1e66f..7984a38 100644
--- a/roles/nova/vars/main.yml
+++ b/roles/nova/vars/main.yml
@@ -22,6 +22,8 @@
images:
tags: "{{ atmosphere_images | vexxhost.atmosphere.openstack_helm_image_tags('nova') }}"
network:
+ backend:
+ - "{{ atmosphere_network_backend | default('openvswitch') }}"
ssh:
enabled: true
public_key: "{{ _nova_ssh_publickey.public_key }}"
@@ -92,6 +94,8 @@
metadata_proxy_shared_secret: "{{ openstack_helm_endpoints['compute_metadata']['secret'] }}"
oslo_messaging_notifications:
driver: noop
+ os_vif_ovs:
+ ovsdb_connection: unix:/run/openvswitch/db.sock
scheduler:
workers: 8
vnc: