diff --git a/charts/neutron/templates/bin/_neutron-ovn-maintenance-worker.sh.tpl b/charts/neutron/templates/bin/_neutron-ovn-maintenance-worker.sh.tpl new file mode 100644 index 00000000..a73d9a9c --- /dev/null +++ b/charts/neutron/templates/bin/_neutron-ovn-maintenance-worker.sh.tpl @@ -0,0 +1,49 @@ +#!/bin/bash + +{{/* +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. +*/}} + +set -ex +COMMAND="${@:-start}" + +function start () { + exec neutron-ovn-maintenance-worker \ + --config-file /etc/neutron/neutron.conf \ + --config-file /tmp/pod-shared/ovn.ini \ +{{- if contains "vpnaas" .Values.conf.neutron.DEFAULT.service_plugins }} + --config-file /etc/neutron/neutron_vpnaas.conf \ +{{- end }} +{{- if contains "ovn-vpnaas" .Values.conf.neutron.DEFAULT.service_plugins }} + --config-file /etc/neutron/neutron_ovn_vpn_agent.ini \ +{{- end }} +{{- if contains "firewall_v2" .Values.conf.neutron.DEFAULT.service_plugins }} + --config-file /etc/neutron/neutron_fwaas.conf \ +{{- end }} +{{- if .Values.conf.plugins.taas.taas.enabled }} + --config-file /etc/neutron/taas_plugin.ini \ +{{- end }} +{{- if ( has "sriov" .Values.network.backend ) }} + --config-file /etc/neutron/plugins/ml2/sriov_agent.ini \ +{{- end }} +{{- if .Values.conf.plugins.l2gateway }} + --config-file /etc/neutron/l2gw_plugin.ini \ +{{- end }} + --config-file /etc/neutron/plugins/ml2/ml2_conf.ini +} + +function stop () { + kill -TERM 1 +} + +$COMMAND diff --git a/charts/neutron/templates/bin/_neutron-periodic-worker.sh.tpl b/charts/neutron/templates/bin/_neutron-periodic-worker.sh.tpl new file mode 100644 index 00000000..5b7dd87d --- /dev/null +++ b/charts/neutron/templates/bin/_neutron-periodic-worker.sh.tpl @@ -0,0 +1,51 @@ +#!/bin/bash + +{{/* +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. +*/}} + +set -ex +COMMAND="${@:-start}" + +function start () { + exec neutron-periodic-workers \ + --config-file /etc/neutron/neutron.conf \ +{{- if ( has "ovn" .Values.network.backend ) }} + --config-file /tmp/pod-shared/ovn.ini \ +{{- end }} +{{- if contains "vpnaas" .Values.conf.neutron.DEFAULT.service_plugins }} + --config-file /etc/neutron/neutron_vpnaas.conf \ +{{- end }} +{{- if contains "ovn-vpnaas" .Values.conf.neutron.DEFAULT.service_plugins }} + --config-file /etc/neutron/neutron_ovn_vpn_agent.ini \ +{{- end }} +{{- if contains "firewall_v2" .Values.conf.neutron.DEFAULT.service_plugins }} + --config-file /etc/neutron/neutron_fwaas.conf \ +{{- end }} +{{- if .Values.conf.plugins.taas.taas.enabled }} + --config-file /etc/neutron/taas_plugin.ini \ +{{- end }} +{{- if ( has "sriov" .Values.network.backend ) }} + --config-file /etc/neutron/plugins/ml2/sriov_agent.ini \ +{{- end }} +{{- if .Values.conf.plugins.l2gateway }} + --config-file /etc/neutron/l2gw_plugin.ini \ +{{- end }} + --config-file /etc/neutron/plugins/ml2/ml2_conf.ini +} + +function stop () { + kill -TERM 1 +} + +$COMMAND diff --git a/charts/neutron/templates/configmap-bin.yaml b/charts/neutron/templates/configmap-bin.yaml index 393491ca..c699ae6c 100644 --- a/charts/neutron/templates/configmap-bin.yaml +++ b/charts/neutron/templates/configmap-bin.yaml @@ -93,6 +93,10 @@ data: {{ tuple "bin/_neutron-server.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} neutron-rpc-server.sh: | {{ tuple "bin/_neutron-rpc-server.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + neutron-periodic-worker.sh: | +{{ tuple "bin/_neutron-periodic-worker.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + neutron-ovn-maintenance-worker.sh: | +{{ tuple "bin/_neutron-ovn-maintenance-worker.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} neutron-ironic-agent-init.sh: | {{ tuple "bin/_neutron-ironic-agent-init.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} neutron-ironic-agent.sh: | diff --git a/charts/neutron/templates/deployment-workers.yaml b/charts/neutron/templates/deployment-workers.yaml new file mode 100644 index 00000000..547f81b8 --- /dev/null +++ b/charts/neutron/templates/deployment-workers.yaml @@ -0,0 +1,198 @@ +{{/* +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. +*/}} + +{{- define "neutron.server_worker.deployment" }} +{{- $envAll := .envAll }} +{{- $component := .component }} +{{- $dependencyOpts := dict "envAll" $envAll "dependencyMixinParam" $envAll.Values.network.backend "dependencyKey" $component }} +{{- $_ := include "helm-toolkit.utils.dependency_resolver" $dependencyOpts | toString | fromYaml }} +{{- $application := .application }} +{{- $container := .container }} +{{- $script := .script }} +{{- $mounts := index $envAll.Values.pod.mounts $application $application }} +{{- $mountsInit := index $envAll.Values.pod.mounts $application "init_container" }} +{{- $labels := index $envAll.Values.labels $component }} +{{- $resources := index $envAll.Values.pod.resources $component }} +{{- $replicas := index $envAll.Values.pod.replicas $component }} +{{- $terminationGracePeriod := index $envAll.Values.pod.lifecycle.termination_grace_period $component "timeout" }} +{{- $serviceAccountName := printf "neutron-%s" (replace "_" "-" $component) }} +{{ tuple $envAll "pod_dependency" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ $serviceAccountName }} + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} + labels: +{{ tuple $envAll "neutron" $component | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} +spec: + replicas: {{ $replicas }} + selector: + matchLabels: +{{ tuple $envAll "neutron" $component | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} + template: + metadata: + labels: +{{ tuple $envAll "neutron" $component | 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" $envAll | include "helm-toolkit.utils.hash" }} + configmap-etc-hash: {{ tuple "configmap-etc.yaml" $envAll | include "helm-toolkit.utils.hash" }} +{{ dict "envAll" $envAll "podName" $serviceAccountName "containerNames" (list $container "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} + spec: +{{ dict "envAll" $envAll "application" $application | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} +{{ tuple $application $envAll | include "helm-toolkit.snippets.kubernetes_pod_priority_class" | indent 6 }} +{{ tuple $application $envAll | include "helm-toolkit.snippets.kubernetes_pod_runtime_class" | indent 6 }} + serviceAccountName: {{ $serviceAccountName }} + affinity: +{{ tuple $envAll "neutron" $component | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} + nodeSelector: + {{ $labels.node_selector_key }}: {{ $labels.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.neutron.enabled }} +{{ tuple $envAll "neutron" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} + terminationGracePeriodSeconds: {{ $terminationGracePeriod | default "30" }} + initContainers: +{{ tuple $envAll "pod_dependency" $mountsInit | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{- if has "ovn" $envAll.Values.network.backend }} + - name: ovn-neutron-init +{{ tuple $envAll $application | include "helm-toolkit.snippets.image" | indent 10 }} + command: + - /tmp/neutron-ovn-init.sh + volumeMounts: + - name: pod-shared + mountPath: /tmp/pod-shared + - name: neutron-bin + mountPath: /tmp/neutron-ovn-init.sh + subPath: neutron-ovn-init.sh + readOnly: true +{{- end }} + containers: + - name: {{ $container }} +{{ tuple $envAll $application | include "helm-toolkit.snippets.image" | indent 10 }} +{{ tuple $envAll $resources | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} +{{ dict "envAll" $envAll "application" $application "container" $application | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} + command: + - /tmp/{{ $script }}.sh + - start +{{- if or $envAll.Values.manifests.certificates $envAll.Values.tls.identity }} + env: + - name: REQUESTS_CA_BUNDLE + value: "/etc/neutron/certs/ca.crt" +{{- end }} + lifecycle: + preStop: + exec: + command: + - /tmp/{{ $script }}.sh + - stop + volumeMounts: + - name: pod-tmp + mountPath: /tmp + - name: pod-shared + mountPath: /tmp/pod-shared + - name: pod-var-neutron + mountPath: {{ $envAll.Values.conf.neutron.DEFAULT.state_path }} + - name: neutron-bin + mountPath: /tmp/{{ $script }}.sh + subPath: {{ $script }}.sh + readOnly: true + - name: neutron-etc + mountPath: /etc/neutron/neutron.conf + subPath: neutron.conf + readOnly: true + - name: neutron-etc + mountPath: /etc/neutron/plugins/ml2/ml2_conf.ini + subPath: ml2_conf.ini + readOnly: true +{{- if has "sriov" $envAll.Values.network.backend }} + - name: neutron-etc + mountPath: /etc/neutron/plugins/ml2/sriov_agent.ini + subPath: sriov_agent.ini + readOnly: true +{{- end }} +{{- if $envAll.Values.conf.plugins.taas.taas.enabled }} + - name: neutron-etc + mountPath: /etc/neutron/taas_plugin.ini + subPath: taas_plugin.ini + readOnly: true +{{- end }} +{{- if $envAll.Values.conf.plugins.l2gateway }} + - name: neutron-etc + mountPath: /etc/neutron/l2gw_plugin.ini + subPath: l2gw_plugin.ini + readOnly: true +{{- end }} + - name: neutron-etc + mountPath: /etc/neutron/policy.yaml + subPath: policy.yaml + readOnly: true +{{- if contains "vpnaas" $envAll.Values.conf.neutron.DEFAULT.service_plugins }} + - name: neutron-etc + mountPath: /etc/neutron/neutron_vpnaas.conf + subPath: neutron_vpnaas.conf + readOnly: true +{{- end }} +{{- if contains "ovn-vpnaas" $envAll.Values.conf.neutron.DEFAULT.service_plugins }} + - name: neutron-etc + mountPath: /etc/neutron/neutron_ovn_vpn_agent.ini + subPath: neutron_ovn_vpn_agent.ini + readOnly: true +{{- end }} +{{- if contains "firewall_v2" $envAll.Values.conf.neutron.DEFAULT.service_plugins }} + - name: neutron-etc + mountPath: /etc/neutron/neutron_fwaas.conf + subPath: neutron_fwaas.conf + readOnly: true +{{- end }} +{{- if $envAll.Values.conf.neutron.DEFAULT.log_config_append }} + - name: neutron-etc + mountPath: {{ $envAll.Values.conf.neutron.DEFAULT.log_config_append }} + subPath: {{ base $envAll.Values.conf.neutron.DEFAULT.log_config_append }} + readOnly: true +{{- end }} +{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} +{{- dict "enabled" (or $envAll.Values.manifests.certificates $envAll.Values.tls.identity) "name" $envAll.Values.secrets.tls.network.server.internal "path" "/etc/neutron/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} +{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal "path" "/etc/rabbitmq/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} +{{ if $mounts.volumeMounts }}{{ toYaml $mounts.volumeMounts | indent 12 }}{{ end }} + volumes: + - name: pod-tmp + emptyDir: {} + - name: pod-shared + emptyDir: {} + - name: pod-var-neutron + emptyDir: {} + - name: neutron-bin + configMap: + name: neutron-bin + defaultMode: 0555 + - name: neutron-etc + secret: + secretName: neutron-etc + defaultMode: 0444 +{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} +{{- dict "enabled" (or $envAll.Values.manifests.certificates $envAll.Values.tls.identity) "name" $envAll.Values.secrets.tls.network.server.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} +{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} +{{ if $mounts.volumes }}{{ toYaml $mounts.volumes | indent 8 }}{{ end }} +{{- end }} + +{{- if and .Values.manifests.deployment_periodic_worker (eq .Values.conf.neutron.DEFAULT.core_plugin "ml2") }} +{{- include "neutron.server_worker.deployment" (dict "envAll" . "component" "periodic_worker" "application" "neutron_periodic_worker" "container" "neutron-periodic-worker" "script" "neutron-periodic-worker") }} +{{- end }} + +{{- if and .Values.manifests.deployment_ovn_maintenance_worker (has "ovn" .Values.network.backend) }} +{{- include "neutron.server_worker.deployment" (dict "envAll" . "component" "ovn_maintenance_worker" "application" "neutron_ovn_maintenance_worker" "container" "neutron-ovn-maintenance-worker" "script" "neutron-ovn-maintenance-worker") }} +{{- end }} diff --git a/charts/neutron/values.yaml b/charts/neutron/values.yaml index bc075e7c..a4a86776 100644 --- a/charts/neutron/values.yaml +++ b/charts/neutron/values.yaml @@ -33,6 +33,8 @@ images: netoffload: ghcr.io/vexxhost/netoffload:v1.0.1 neutron_server: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy neutron_rpc_server: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy + neutron_periodic_worker: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy + neutron_ovn_maintenance_worker: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy neutron_dhcp: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy neutron_metadata: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy neutron_ovn_metadata: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy @@ -102,6 +104,12 @@ labels: rpc_server: node_selector_key: openstack-control-plane node_selector_value: enabled + periodic_worker: + node_selector_key: openstack-control-plane + node_selector_value: enabled + ovn_maintenance_worker: + node_selector_key: openstack-control-plane + node_selector_value: enabled ironic_agent: node_selector_key: openstack-control-plane node_selector_value: enabled @@ -361,6 +369,32 @@ dependencies: service: oslo_cache - endpoint: internal service: identity + periodic_worker: + jobs: + - neutron-db-sync + - neutron-rabbit-init + services: + - endpoint: internal + service: oslo_db + - endpoint: internal + service: oslo_messaging + - endpoint: internal + service: oslo_cache + - endpoint: internal + service: identity + ovn_maintenance_worker: + jobs: + - neutron-db-sync + - neutron-rabbit-init + services: + - endpoint: internal + service: oslo_db + - endpoint: internal + service: oslo_messaging + - endpoint: internal + service: oslo_cache + - endpoint: internal + service: identity ironic_agent: jobs: - neutron-db-sync @@ -659,6 +693,20 @@ pod: neutron_rpc_server: allowPrivilegeEscalation: false readOnlyRootFilesystem: true + neutron_periodic_worker: + pod: + runAsUser: 42424 + container: + neutron_periodic_worker: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + neutron_ovn_maintenance_worker: + pod: + runAsUser: 42424 + container: + neutron_ovn_maintenance_worker: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true neutron_sriov_agent: pod: runAsUser: 42424 @@ -716,6 +764,16 @@ pod: neutron_rpc_server: volumeMounts: volumes: + neutron_periodic_worker: + init_container: null + neutron_periodic_worker: + volumeMounts: + volumes: + neutron_ovn_maintenance_worker: + init_container: null + neutron_ovn_maintenance_worker: + volumeMounts: + volumes: neutron_dhcp_agent: init_container: null neutron_dhcp_agent: @@ -802,6 +860,8 @@ pod: replicas: server: 1 rpc_server: 1 + periodic_worker: 1 + ovn_maintenance_worker: 1 ironic_agent: 1 lifecycle: upgrades: @@ -857,6 +917,10 @@ pod: timeout: 30 rpc_server: timeout: 30 + periodic_worker: + timeout: 30 + ovn_maintenance_worker: + timeout: 30 ironic_agent: timeout: 30 resources: @@ -946,6 +1010,20 @@ pod: limits: memory: "1024Mi" cpu: "2000m" + periodic_worker: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ovn_maintenance_worker: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" ironic_agent: requests: memory: "128Mi" @@ -2666,6 +2744,8 @@ manifests: deployment_ironic_agent: false deployment_server: true deployment_rpc_server: true + deployment_periodic_worker: false + deployment_ovn_maintenance_worker: false ingress_server: true job_bootstrap: true job_db_init: true diff --git a/charts/patches/neutron/0010-deploy-neutron-periodic-and-ovn-maintenance-workers.patch b/charts/patches/neutron/0010-deploy-neutron-periodic-and-ovn-maintenance-workers.patch new file mode 100644 index 00000000..1e6dd3c4 --- /dev/null +++ b/charts/patches/neutron/0010-deploy-neutron-periodic-and-ovn-maintenance-workers.patch @@ -0,0 +1,492 @@ +From: Dong Ma +Subject: [PATCH] fix(neutron): deploy periodic and OVN maintenance workers + +Backport of https://review.opendev.org/c/openstack/openstack-helm/+/1001717 +adapted to the vendored 0.3.47 chart. Drop this patch once the chart is +bumped to a release that includes the upstream change. +--- + neutron/templates/bin/_neutron-ovn-maintenance-worker.sh.tpl | 49 +++++ + neutron/templates/bin/_neutron-periodic-worker.sh.tpl | 51 ++++++ + neutron/templates/configmap-bin.yaml | 4 + + neutron/templates/deployment-workers.yaml | 198 +++++++++++++++++ + neutron/values.yaml | 80 +++++++ + 5 files changed, 382 insertions(+) + +diff --git a/neutron/templates/bin/_neutron-ovn-maintenance-worker.sh.tpl b/neutron/templates/bin/_neutron-ovn-maintenance-worker.sh.tpl +new file mode 100644 +index 0000000..a73d9a9 +--- /dev/null ++++ b/neutron/templates/bin/_neutron-ovn-maintenance-worker.sh.tpl +@@ -0,0 +1,49 @@ ++#!/bin/bash ++ ++{{/* ++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. ++*/}} ++ ++set -ex ++COMMAND="${@:-start}" ++ ++function start () { ++ exec neutron-ovn-maintenance-worker \ ++ --config-file /etc/neutron/neutron.conf \ ++ --config-file /tmp/pod-shared/ovn.ini \ ++{{- if contains "vpnaas" .Values.conf.neutron.DEFAULT.service_plugins }} ++ --config-file /etc/neutron/neutron_vpnaas.conf \ ++{{- end }} ++{{- if contains "ovn-vpnaas" .Values.conf.neutron.DEFAULT.service_plugins }} ++ --config-file /etc/neutron/neutron_ovn_vpn_agent.ini \ ++{{- end }} ++{{- if contains "firewall_v2" .Values.conf.neutron.DEFAULT.service_plugins }} ++ --config-file /etc/neutron/neutron_fwaas.conf \ ++{{- end }} ++{{- if .Values.conf.plugins.taas.taas.enabled }} ++ --config-file /etc/neutron/taas_plugin.ini \ ++{{- end }} ++{{- if ( has "sriov" .Values.network.backend ) }} ++ --config-file /etc/neutron/plugins/ml2/sriov_agent.ini \ ++{{- end }} ++{{- if .Values.conf.plugins.l2gateway }} ++ --config-file /etc/neutron/l2gw_plugin.ini \ ++{{- end }} ++ --config-file /etc/neutron/plugins/ml2/ml2_conf.ini ++} ++ ++function stop () { ++ kill -TERM 1 ++} ++ ++$COMMAND +diff --git a/neutron/templates/bin/_neutron-periodic-worker.sh.tpl b/neutron/templates/bin/_neutron-periodic-worker.sh.tpl +new file mode 100644 +index 0000000..5b7dd87 +--- /dev/null ++++ b/neutron/templates/bin/_neutron-periodic-worker.sh.tpl +@@ -0,0 +1,51 @@ ++#!/bin/bash ++ ++{{/* ++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. ++*/}} ++ ++set -ex ++COMMAND="${@:-start}" ++ ++function start () { ++ exec neutron-periodic-workers \ ++ --config-file /etc/neutron/neutron.conf \ ++{{- if ( has "ovn" .Values.network.backend ) }} ++ --config-file /tmp/pod-shared/ovn.ini \ ++{{- end }} ++{{- if contains "vpnaas" .Values.conf.neutron.DEFAULT.service_plugins }} ++ --config-file /etc/neutron/neutron_vpnaas.conf \ ++{{- end }} ++{{- if contains "ovn-vpnaas" .Values.conf.neutron.DEFAULT.service_plugins }} ++ --config-file /etc/neutron/neutron_ovn_vpn_agent.ini \ ++{{- end }} ++{{- if contains "firewall_v2" .Values.conf.neutron.DEFAULT.service_plugins }} ++ --config-file /etc/neutron/neutron_fwaas.conf \ ++{{- end }} ++{{- if .Values.conf.plugins.taas.taas.enabled }} ++ --config-file /etc/neutron/taas_plugin.ini \ ++{{- end }} ++{{- if ( has "sriov" .Values.network.backend ) }} ++ --config-file /etc/neutron/plugins/ml2/sriov_agent.ini \ ++{{- end }} ++{{- if .Values.conf.plugins.l2gateway }} ++ --config-file /etc/neutron/l2gw_plugin.ini \ ++{{- end }} ++ --config-file /etc/neutron/plugins/ml2/ml2_conf.ini ++} ++ ++function stop () { ++ kill -TERM 1 ++} ++ ++$COMMAND +diff --git a/neutron/templates/configmap-bin.yaml b/neutron/templates/configmap-bin.yaml +index 393491c..c699ae6 100644 +--- a/neutron/templates/configmap-bin.yaml ++++ b/neutron/templates/configmap-bin.yaml +@@ -93,6 +93,10 @@ data: + {{ tuple "bin/_neutron-server.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + neutron-rpc-server.sh: | + {{ tuple "bin/_neutron-rpc-server.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} ++ neutron-periodic-worker.sh: | ++{{ tuple "bin/_neutron-periodic-worker.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} ++ neutron-ovn-maintenance-worker.sh: | ++{{ tuple "bin/_neutron-ovn-maintenance-worker.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + neutron-ironic-agent-init.sh: | + {{ tuple "bin/_neutron-ironic-agent-init.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + neutron-ironic-agent.sh: | +diff --git a/neutron/templates/deployment-workers.yaml b/neutron/templates/deployment-workers.yaml +new file mode 100644 +index 0000000..547f81b +--- /dev/null ++++ b/neutron/templates/deployment-workers.yaml +@@ -0,0 +1,198 @@ ++{{/* ++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. ++*/}} ++ ++{{- define "neutron.server_worker.deployment" }} ++{{- $envAll := .envAll }} ++{{- $component := .component }} ++{{- $dependencyOpts := dict "envAll" $envAll "dependencyMixinParam" $envAll.Values.network.backend "dependencyKey" $component }} ++{{- $_ := include "helm-toolkit.utils.dependency_resolver" $dependencyOpts | toString | fromYaml }} ++{{- $application := .application }} ++{{- $container := .container }} ++{{- $script := .script }} ++{{- $mounts := index $envAll.Values.pod.mounts $application $application }} ++{{- $mountsInit := index $envAll.Values.pod.mounts $application "init_container" }} ++{{- $labels := index $envAll.Values.labels $component }} ++{{- $resources := index $envAll.Values.pod.resources $component }} ++{{- $replicas := index $envAll.Values.pod.replicas $component }} ++{{- $terminationGracePeriod := index $envAll.Values.pod.lifecycle.termination_grace_period $component "timeout" }} ++{{- $serviceAccountName := printf "neutron-%s" (replace "_" "-" $component) }} ++{{ tuple $envAll "pod_dependency" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ++--- ++apiVersion: apps/v1 ++kind: Deployment ++metadata: ++ name: {{ $serviceAccountName }} ++ annotations: ++ {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} ++ labels: ++{{ tuple $envAll "neutron" $component | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} ++spec: ++ replicas: {{ $replicas }} ++ selector: ++ matchLabels: ++{{ tuple $envAll "neutron" $component | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} ++{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} ++ template: ++ metadata: ++ labels: ++{{ tuple $envAll "neutron" $component | 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" $envAll | include "helm-toolkit.utils.hash" }} ++ configmap-etc-hash: {{ tuple "configmap-etc.yaml" $envAll | include "helm-toolkit.utils.hash" }} ++{{ dict "envAll" $envAll "podName" $serviceAccountName "containerNames" (list $container "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} ++ spec: ++{{ dict "envAll" $envAll "application" $application | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} ++{{ tuple $application $envAll | include "helm-toolkit.snippets.kubernetes_pod_priority_class" | indent 6 }} ++{{ tuple $application $envAll | include "helm-toolkit.snippets.kubernetes_pod_runtime_class" | indent 6 }} ++ serviceAccountName: {{ $serviceAccountName }} ++ affinity: ++{{ tuple $envAll "neutron" $component | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} ++ nodeSelector: ++ {{ $labels.node_selector_key }}: {{ $labels.node_selector_value }} ++{{ if $envAll.Values.pod.tolerations.neutron.enabled }} ++{{ tuple $envAll "neutron" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} ++{{ end }} ++ terminationGracePeriodSeconds: {{ $terminationGracePeriod | default "30" }} ++ initContainers: ++{{ tuple $envAll "pod_dependency" $mountsInit | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} ++{{- if has "ovn" $envAll.Values.network.backend }} ++ - name: ovn-neutron-init ++{{ tuple $envAll $application | include "helm-toolkit.snippets.image" | indent 10 }} ++ command: ++ - /tmp/neutron-ovn-init.sh ++ volumeMounts: ++ - name: pod-shared ++ mountPath: /tmp/pod-shared ++ - name: neutron-bin ++ mountPath: /tmp/neutron-ovn-init.sh ++ subPath: neutron-ovn-init.sh ++ readOnly: true ++{{- end }} ++ containers: ++ - name: {{ $container }} ++{{ tuple $envAll $application | include "helm-toolkit.snippets.image" | indent 10 }} ++{{ tuple $envAll $resources | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} ++{{ dict "envAll" $envAll "application" $application "container" $application | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} ++ command: ++ - /tmp/{{ $script }}.sh ++ - start ++{{- if or $envAll.Values.manifests.certificates $envAll.Values.tls.identity }} ++ env: ++ - name: REQUESTS_CA_BUNDLE ++ value: "/etc/neutron/certs/ca.crt" ++{{- end }} ++ lifecycle: ++ preStop: ++ exec: ++ command: ++ - /tmp/{{ $script }}.sh ++ - stop ++ volumeMounts: ++ - name: pod-tmp ++ mountPath: /tmp ++ - name: pod-shared ++ mountPath: /tmp/pod-shared ++ - name: pod-var-neutron ++ mountPath: {{ $envAll.Values.conf.neutron.DEFAULT.state_path }} ++ - name: neutron-bin ++ mountPath: /tmp/{{ $script }}.sh ++ subPath: {{ $script }}.sh ++ readOnly: true ++ - name: neutron-etc ++ mountPath: /etc/neutron/neutron.conf ++ subPath: neutron.conf ++ readOnly: true ++ - name: neutron-etc ++ mountPath: /etc/neutron/plugins/ml2/ml2_conf.ini ++ subPath: ml2_conf.ini ++ readOnly: true ++{{- if has "sriov" $envAll.Values.network.backend }} ++ - name: neutron-etc ++ mountPath: /etc/neutron/plugins/ml2/sriov_agent.ini ++ subPath: sriov_agent.ini ++ readOnly: true ++{{- end }} ++{{- if $envAll.Values.conf.plugins.taas.taas.enabled }} ++ - name: neutron-etc ++ mountPath: /etc/neutron/taas_plugin.ini ++ subPath: taas_plugin.ini ++ readOnly: true ++{{- end }} ++{{- if $envAll.Values.conf.plugins.l2gateway }} ++ - name: neutron-etc ++ mountPath: /etc/neutron/l2gw_plugin.ini ++ subPath: l2gw_plugin.ini ++ readOnly: true ++{{- end }} ++ - name: neutron-etc ++ mountPath: /etc/neutron/policy.yaml ++ subPath: policy.yaml ++ readOnly: true ++{{- if contains "vpnaas" $envAll.Values.conf.neutron.DEFAULT.service_plugins }} ++ - name: neutron-etc ++ mountPath: /etc/neutron/neutron_vpnaas.conf ++ subPath: neutron_vpnaas.conf ++ readOnly: true ++{{- end }} ++{{- if contains "ovn-vpnaas" $envAll.Values.conf.neutron.DEFAULT.service_plugins }} ++ - name: neutron-etc ++ mountPath: /etc/neutron/neutron_ovn_vpn_agent.ini ++ subPath: neutron_ovn_vpn_agent.ini ++ readOnly: true ++{{- end }} ++{{- if contains "firewall_v2" $envAll.Values.conf.neutron.DEFAULT.service_plugins }} ++ - name: neutron-etc ++ mountPath: /etc/neutron/neutron_fwaas.conf ++ subPath: neutron_fwaas.conf ++ readOnly: true ++{{- end }} ++{{- if $envAll.Values.conf.neutron.DEFAULT.log_config_append }} ++ - name: neutron-etc ++ mountPath: {{ $envAll.Values.conf.neutron.DEFAULT.log_config_append }} ++ subPath: {{ base $envAll.Values.conf.neutron.DEFAULT.log_config_append }} ++ readOnly: true ++{{- end }} ++{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} ++{{- dict "enabled" (or $envAll.Values.manifests.certificates $envAll.Values.tls.identity) "name" $envAll.Values.secrets.tls.network.server.internal "path" "/etc/neutron/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} ++{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal "path" "/etc/rabbitmq/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} ++{{ if $mounts.volumeMounts }}{{ toYaml $mounts.volumeMounts | indent 12 }}{{ end }} ++ volumes: ++ - name: pod-tmp ++ emptyDir: {} ++ - name: pod-shared ++ emptyDir: {} ++ - name: pod-var-neutron ++ emptyDir: {} ++ - name: neutron-bin ++ configMap: ++ name: neutron-bin ++ defaultMode: 0555 ++ - name: neutron-etc ++ secret: ++ secretName: neutron-etc ++ defaultMode: 0444 ++{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} ++{{- dict "enabled" (or $envAll.Values.manifests.certificates $envAll.Values.tls.identity) "name" $envAll.Values.secrets.tls.network.server.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} ++{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} ++{{ if $mounts.volumes }}{{ toYaml $mounts.volumes | indent 8 }}{{ end }} ++{{- end }} ++ ++{{- if and .Values.manifests.deployment_periodic_worker (eq .Values.conf.neutron.DEFAULT.core_plugin "ml2") }} ++{{- include "neutron.server_worker.deployment" (dict "envAll" . "component" "periodic_worker" "application" "neutron_periodic_worker" "container" "neutron-periodic-worker" "script" "neutron-periodic-worker") }} ++{{- end }} ++ ++{{- if and .Values.manifests.deployment_ovn_maintenance_worker (has "ovn" .Values.network.backend) }} ++{{- include "neutron.server_worker.deployment" (dict "envAll" . "component" "ovn_maintenance_worker" "application" "neutron_ovn_maintenance_worker" "container" "neutron-ovn-maintenance-worker" "script" "neutron-ovn-maintenance-worker") }} ++{{- end }} +diff --git a/neutron/values.yaml b/neutron/values.yaml +index bc075e7..a4a8677 100644 +--- a/neutron/values.yaml ++++ b/neutron/values.yaml +@@ -33,6 +33,8 @@ images: + netoffload: ghcr.io/vexxhost/netoffload:v1.0.1 + neutron_server: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy + neutron_rpc_server: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy ++ neutron_periodic_worker: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy ++ neutron_ovn_maintenance_worker: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy + neutron_dhcp: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy + neutron_metadata: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy + neutron_ovn_metadata: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy +@@ -102,6 +104,12 @@ labels: + rpc_server: + node_selector_key: openstack-control-plane + node_selector_value: enabled ++ periodic_worker: ++ node_selector_key: openstack-control-plane ++ node_selector_value: enabled ++ ovn_maintenance_worker: ++ node_selector_key: openstack-control-plane ++ node_selector_value: enabled + ironic_agent: + node_selector_key: openstack-control-plane + node_selector_value: enabled +@@ -361,6 +369,32 @@ dependencies: + service: oslo_cache + - endpoint: internal + service: identity ++ periodic_worker: ++ jobs: ++ - neutron-db-sync ++ - neutron-rabbit-init ++ services: ++ - endpoint: internal ++ service: oslo_db ++ - endpoint: internal ++ service: oslo_messaging ++ - endpoint: internal ++ service: oslo_cache ++ - endpoint: internal ++ service: identity ++ ovn_maintenance_worker: ++ jobs: ++ - neutron-db-sync ++ - neutron-rabbit-init ++ services: ++ - endpoint: internal ++ service: oslo_db ++ - endpoint: internal ++ service: oslo_messaging ++ - endpoint: internal ++ service: oslo_cache ++ - endpoint: internal ++ service: identity + ironic_agent: + jobs: + - neutron-db-sync +@@ -659,6 +693,20 @@ pod: + neutron_rpc_server: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true ++ neutron_periodic_worker: ++ pod: ++ runAsUser: 42424 ++ container: ++ neutron_periodic_worker: ++ allowPrivilegeEscalation: false ++ readOnlyRootFilesystem: true ++ neutron_ovn_maintenance_worker: ++ pod: ++ runAsUser: 42424 ++ container: ++ neutron_ovn_maintenance_worker: ++ allowPrivilegeEscalation: false ++ readOnlyRootFilesystem: true + neutron_sriov_agent: + pod: + runAsUser: 42424 +@@ -716,6 +764,16 @@ pod: + neutron_rpc_server: + volumeMounts: + volumes: ++ neutron_periodic_worker: ++ init_container: null ++ neutron_periodic_worker: ++ volumeMounts: ++ volumes: ++ neutron_ovn_maintenance_worker: ++ init_container: null ++ neutron_ovn_maintenance_worker: ++ volumeMounts: ++ volumes: + neutron_dhcp_agent: + init_container: null + neutron_dhcp_agent: +@@ -802,6 +860,8 @@ pod: + replicas: + server: 1 + rpc_server: 1 ++ periodic_worker: 1 ++ ovn_maintenance_worker: 1 + ironic_agent: 1 + lifecycle: + upgrades: +@@ -857,6 +917,10 @@ pod: + timeout: 30 + rpc_server: + timeout: 30 ++ periodic_worker: ++ timeout: 30 ++ ovn_maintenance_worker: ++ timeout: 30 + ironic_agent: + timeout: 30 + resources: +@@ -946,6 +1010,20 @@ pod: + limits: + memory: "1024Mi" + cpu: "2000m" ++ periodic_worker: ++ requests: ++ memory: "128Mi" ++ cpu: "100m" ++ limits: ++ memory: "1024Mi" ++ cpu: "2000m" ++ ovn_maintenance_worker: ++ requests: ++ memory: "128Mi" ++ cpu: "100m" ++ limits: ++ memory: "1024Mi" ++ cpu: "2000m" + ironic_agent: + requests: + memory: "128Mi" +@@ -2666,6 +2744,8 @@ manifests: + deployment_ironic_agent: false + deployment_server: true + deployment_rpc_server: true ++ deployment_periodic_worker: false ++ deployment_ovn_maintenance_worker: false + ingress_server: true + job_bootstrap: true + job_db_init: true diff --git a/releasenotes/notes/neutron-ovn-maintenance-worker-3b7e3f6a72c2a6ef.yaml b/releasenotes/notes/neutron-ovn-maintenance-worker-3b7e3f6a72c2a6ef.yaml new file mode 100644 index 00000000..9c2d105e --- /dev/null +++ b/releasenotes/notes/neutron-ovn-maintenance-worker-3b7e3f6a72c2a6ef.yaml @@ -0,0 +1,13 @@ +--- +fixes: + - | + Deploys the dedicated ``neutron-periodic-workers`` process for ML2 + environments and the ``neutron-ovn-maintenance-worker`` process for OVN + environments. Neutron API processes run under uWSGI and do not schedule + these background tasks themselves, so the workers are required for plugin + periodic tasks, OVN consistency checks, and one-time data migrations. + + The chart-level manifests remain disabled by default for compatibility + with its default Neutron 2024.1 image. The Atmosphere Neutron role enables + the periodic worker for ML2 deployments and the maintenance worker for OVN + deployments. diff --git a/roles/defaults/vars/main.yml b/roles/defaults/vars/main.yml index efd4edf4..d0bbdb09 100644 --- a/roles/defaults/vars/main.yml +++ b/roles/defaults/vars/main.yml @@ -171,6 +171,8 @@ _atmosphere_images: neutron_metadata: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/neutron:2026.1@sha256:12c7181b8f1bb650de1d0c60bb4f382c71bf56a89191400203e0077ed5aec791" neutron_netns_cleanup_cron: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/neutron:2026.1@sha256:12c7181b8f1bb650de1d0c60bb4f382c71bf56a89191400203e0077ed5aec791" neutron_openvswitch_agent: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/neutron:2026.1@sha256:12c7181b8f1bb650de1d0c60bb4f382c71bf56a89191400203e0077ed5aec791" + neutron_periodic_worker: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/neutron:2026.1@sha256:12c7181b8f1bb650de1d0c60bb4f382c71bf56a89191400203e0077ed5aec791" + neutron_ovn_maintenance_worker: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/neutron:2026.1@sha256:12c7181b8f1bb650de1d0c60bb4f382c71bf56a89191400203e0077ed5aec791" neutron_ovn_metadata: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/neutron:2026.1@sha256:12c7181b8f1bb650de1d0c60bb4f382c71bf56a89191400203e0077ed5aec791" neutron_ovn_vpn: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/neutron:2026.1@sha256:12c7181b8f1bb650de1d0c60bb4f382c71bf56a89191400203e0077ed5aec791" neutron_server: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/neutron:2026.1@sha256:12c7181b8f1bb650de1d0c60bb4f382c71bf56a89191400203e0077ed5aec791" diff --git a/roles/neutron/tests/fwaas_test.yaml b/roles/neutron/tests/fwaas_test.yaml index 04fac4e5..9868022e 100644 --- a/roles/neutron/tests/fwaas_test.yaml +++ b/roles/neutron/tests/fwaas_test.yaml @@ -23,6 +23,50 @@ tests: - matchRegex: path: data["neutron-rpc-server.sh"] pattern: --config-file /etc/neutron/neutron_fwaas[.]conf + - matchRegex: + path: data["neutron-periodic-worker.sh"] + pattern: --config-file /etc/neutron/neutron_fwaas[.]conf + - matchRegex: + path: data["neutron-ovn-maintenance-worker.sh"] + pattern: --config-file /etc/neutron/neutron_fwaas[.]conf + + - it: should mount neutron_fwaas.conf in the periodic and OVN maintenance workers when firewall_v2 is enabled + templates: + - templates/deployment-workers.yaml + set: + manifests: + deployment_periodic_worker: true + deployment_ovn_maintenance_worker: true + network: + backend: + - ovn + conf: + neutron: + DEFAULT: + service_plugins: qos,ovn-router,segments,trunk,log,ovn-vpnaas,firewall_v2,taas,tapmirror + asserts: + - hasDocuments: + count: 8 + - documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-periodic-worker + contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: neutron-etc + mountPath: /etc/neutron/neutron_fwaas.conf + subPath: neutron_fwaas.conf + readOnly: true + - documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-ovn-maintenance-worker + contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: neutron-etc + mountPath: /etc/neutron/neutron_fwaas.conf + subPath: neutron_fwaas.conf + readOnly: true - it: should mount neutron_fwaas.conf in neutron-rpc-server when firewall_v2 is enabled templates: diff --git a/roles/neutron/tests/priorityclass_test.yaml b/roles/neutron/tests/priorityclass_test.yaml index 27e52b32..43400c47 100644 --- a/roles/neutron/tests/priorityclass_test.yaml +++ b/roles/neutron/tests/priorityclass_test.yaml @@ -15,6 +15,7 @@ tests: - templates/daemonset-ovs-agent.yaml - templates/daemonset-sriov-agent.yaml - templates/deployment-ironic-agent.yaml + - templates/deployment-workers.yaml - templates/deployment-rpc_server.yaml - templates/deployment-server.yaml - templates/pod-rally-test.yaml @@ -26,6 +27,7 @@ tests: network: backend: - openvswitch + - ovn - sriov - linuxbridge manifests: @@ -35,6 +37,8 @@ tests: daemonset_ovn_metadata_agent: true daemonset_ovn_vpn_agent: true deployment_ironic_agent: true + deployment_periodic_worker: true + deployment_ovn_maintenance_worker: true asserts: - template: templates/daemonset-bagpipe-bgp.yaml documentIndex: 2 @@ -88,6 +92,18 @@ tests: documentIndex: 3 notExists: path: spec.template.spec.priorityClassName + - template: templates/deployment-workers.yaml + documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-periodic-worker + notExists: + path: spec.template.spec.priorityClassName + - template: templates/deployment-workers.yaml + documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-ovn-maintenance-worker + notExists: + path: spec.template.spec.priorityClassName - template: templates/deployment-rpc_server.yaml documentIndex: 3 notExists: @@ -124,6 +140,7 @@ tests: - templates/daemonset-ovs-agent.yaml - templates/daemonset-sriov-agent.yaml - templates/deployment-ironic-agent.yaml + - templates/deployment-workers.yaml - templates/deployment-rpc_server.yaml - templates/deployment-server.yaml - templates/pod-rally-test.yaml @@ -135,6 +152,7 @@ tests: network: backend: - openvswitch + - ovn - sriov - linuxbridge pod: @@ -149,6 +167,8 @@ tests: neutron_netns_cleanup_cron: platform ovn_vpn_agent: platform neutron_ovn_metadata_agent: platform + neutron_ovn_maintenance_worker: platform + neutron_periodic_worker: platform neutron_ovs_agent: platform neutron_sriov_agent: platform neutron_ironic_agent: platform @@ -164,6 +184,8 @@ tests: daemonset_ovn_metadata_agent: true daemonset_ovn_vpn_agent: true deployment_ironic_agent: true + deployment_periodic_worker: true + deployment_ovn_maintenance_worker: true asserts: - template: templates/daemonset-bagpipe-bgp.yaml documentIndex: 2 @@ -230,6 +252,20 @@ tests: equal: path: spec.template.spec.priorityClassName value: platform + - template: templates/deployment-workers.yaml + documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-periodic-worker + equal: + path: spec.template.spec.priorityClassName + value: platform + - template: templates/deployment-workers.yaml + documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-ovn-maintenance-worker + equal: + path: spec.template.spec.priorityClassName + value: platform - template: templates/deployment-rpc_server.yaml documentIndex: 3 equal: diff --git a/roles/neutron/tests/runtimeclass_test.yaml b/roles/neutron/tests/runtimeclass_test.yaml index c4efae70..cb2e75b2 100644 --- a/roles/neutron/tests/runtimeclass_test.yaml +++ b/roles/neutron/tests/runtimeclass_test.yaml @@ -15,6 +15,7 @@ tests: - templates/daemonset-ovs-agent.yaml - templates/daemonset-sriov-agent.yaml - templates/deployment-ironic-agent.yaml + - templates/deployment-workers.yaml - templates/deployment-rpc_server.yaml - templates/deployment-server.yaml - templates/pod-rally-test.yaml @@ -26,6 +27,7 @@ tests: network: backend: - openvswitch + - ovn - sriov - linuxbridge manifests: @@ -35,6 +37,8 @@ tests: daemonset_ovn_metadata_agent: true daemonset_ovn_vpn_agent: true deployment_ironic_agent: true + deployment_periodic_worker: true + deployment_ovn_maintenance_worker: true asserts: - template: templates/daemonset-bagpipe-bgp.yaml documentIndex: 2 @@ -88,6 +92,18 @@ tests: documentIndex: 3 notExists: path: spec.template.spec.runtimeClassName + - template: templates/deployment-workers.yaml + documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-periodic-worker + notExists: + path: spec.template.spec.runtimeClassName + - template: templates/deployment-workers.yaml + documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-ovn-maintenance-worker + notExists: + path: spec.template.spec.runtimeClassName - template: templates/deployment-rpc_server.yaml documentIndex: 3 notExists: @@ -124,6 +140,7 @@ tests: - templates/daemonset-ovs-agent.yaml - templates/daemonset-sriov-agent.yaml - templates/deployment-ironic-agent.yaml + - templates/deployment-workers.yaml - templates/deployment-rpc_server.yaml - templates/deployment-server.yaml - templates/pod-rally-test.yaml @@ -135,6 +152,7 @@ tests: network: backend: - openvswitch + - ovn - sriov - linuxbridge pod: @@ -149,6 +167,8 @@ tests: neutron_netns_cleanup_cron: kata-clh ovn_vpn_agent: kata-clh neutron_ovn_metadata_agent: kata-clh + neutron_ovn_maintenance_worker: kata-clh + neutron_periodic_worker: kata-clh neutron_ovs_agent: kata-clh neutron_sriov_agent: kata-clh neutron_ironic_agent: kata-clh @@ -164,6 +184,8 @@ tests: daemonset_ovn_metadata_agent: true daemonset_ovn_vpn_agent: true deployment_ironic_agent: true + deployment_periodic_worker: true + deployment_ovn_maintenance_worker: true asserts: - template: templates/daemonset-bagpipe-bgp.yaml documentIndex: 2 @@ -230,6 +252,20 @@ tests: equal: path: spec.template.spec.runtimeClassName value: kata-clh + - template: templates/deployment-workers.yaml + documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-periodic-worker + equal: + path: spec.template.spec.runtimeClassName + value: kata-clh + - template: templates/deployment-workers.yaml + documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-ovn-maintenance-worker + equal: + path: spec.template.spec.runtimeClassName + value: kata-clh - template: templates/deployment-rpc_server.yaml documentIndex: 3 equal: diff --git a/roles/neutron/tests/server_workers_test.yaml b/roles/neutron/tests/server_workers_test.yaml new file mode 100644 index 00000000..9e4ed434 --- /dev/null +++ b/roles/neutron/tests/server_workers_test.yaml @@ -0,0 +1,66 @@ +suite: Neutron server workers +tests: + - it: should not deploy the OVN worker for a non-OVN backend + templates: + - templates/deployment-workers.yaml + set: + network: + backend: + - openvswitch + manifests: + deployment_periodic_worker: true + deployment_ovn_maintenance_worker: true + asserts: + - hasDocuments: + count: 4 + - documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-periodic-worker + isKind: + of: Deployment + - notExists: + path: spec.template.spec.containers[?(@.name == "neutron-ovn-maintenance-worker")] + + - it: should deploy both dedicated workers for an OVN backend + templates: + - templates/deployment-workers.yaml + set: + network: + backend: + - ovn + manifests: + deployment_periodic_worker: true + deployment_ovn_maintenance_worker: true + asserts: + - hasDocuments: + count: 8 + - documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-periodic-worker + equal: + path: spec.replicas + value: 1 + - documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-periodic-worker + equal: + path: spec.template.spec.containers[0].command[0] + value: /tmp/neutron-periodic-worker.sh + - documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-ovn-maintenance-worker + equal: + path: spec.replicas + value: 1 + - documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-ovn-maintenance-worker + equal: + path: spec.template.spec.initContainers[1].command[0] + value: /tmp/neutron-ovn-init.sh + - documentSelector: + path: spec.template.spec.serviceAccountName + value: neutron-ovn-maintenance-worker + equal: + path: spec.template.spec.containers[0].command[0] + value: /tmp/neutron-ovn-maintenance-worker.sh diff --git a/roles/neutron/vars/main.yml b/roles/neutron/vars/main.yml index 78ac2b38..2c230add 100644 --- a/roles/neutron/vars/main.yml +++ b/roles/neutron/vars/main.yml @@ -25,6 +25,8 @@ __neutron_helm_values: replicas: server: 3 rpc_server: 3 + periodic_worker: 1 + ovn_maintenance_worker: 1 conf: neutron: DEFAULT: @@ -99,6 +101,7 @@ __neutron_helm_values: apply-to: all pattern: '^(?!(amq\.|reply_)).*' manifests: + deployment_periodic_worker: true ingress_server: false service_ingress_server: false @@ -158,6 +161,7 @@ __neutron_ovn_helm_values: daemonset_ovn_metadata_agent: true daemonset_ovn_vpn_agent: true daemonset_ovs_agent: false + deployment_ovn_maintenance_worker: true # NOTE: The ``address_pair``, ``port_update``, ``port_delete`` and ``quarantine`` # checks are provided by ``neutron-policy-server``, which is installed in diff --git a/roles/neutron/vars_test.go b/roles/neutron/vars_test.go index 6d76ac4f..03e4fa44 100644 --- a/roles/neutron/vars_test.go +++ b/roles/neutron/vars_test.go @@ -50,6 +50,8 @@ func TestHelmValues(t *testing.T) { "neutron_netns_cleanup_cron": "high-priority", "ovn_vpn_agent": "high-priority", "neutron_ovn_metadata_agent": "high-priority", + "neutron_ovn_maintenance_worker": "high-priority", + "neutron_periodic_worker": "high-priority", "neutron_ovs_agent": "high-priority", "neutron_sriov_agent": "high-priority", "neutron_ironic_agent": "high-priority", @@ -75,6 +77,8 @@ func TestHelmValues(t *testing.T) { "neutron_netns_cleanup_cron": "kata-clh", "ovn_vpn_agent": "kata-clh", "neutron_ovn_metadata_agent": "kata-clh", + "neutron_ovn_maintenance_worker": "kata-clh", + "neutron_periodic_worker": "kata-clh", "neutron_ovs_agent": "kata-clh", "neutron_sriov_agent": "kata-clh", "neutron_ironic_agent": "kata-clh",