From d694af454ea620fbb25e9a7e3e36a69675a97c25 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 19 Jan 2026 10:46:08 +0100 Subject: [PATCH] feat(openstack-cloud-controller-manager): add option to change deployment type --- .../templates/daemonset.yaml | 15 ++++++++++++++- .../values.yaml | 14 +++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/charts/openstack-cloud-controller-manager/templates/daemonset.yaml b/charts/openstack-cloud-controller-manager/templates/daemonset.yaml index ae5da1059a..938cdb4e5f 100644 --- a/charts/openstack-cloud-controller-manager/templates/daemonset.yaml +++ b/charts/openstack-cloud-controller-manager/templates/daemonset.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: DaemonSet +kind: {{ .Values.controllerKind }} metadata: name: {{ include "occm.name" . }} labels: {{- include "occm.labels.standard" . | nindent 4 }} @@ -12,8 +12,14 @@ spec: selector: matchLabels: {{- include "occm.controllermanager.matchLabels" . | nindent 6 }} + {{- if eq .Values.controllerKind "Deployment" }} + replicas: {{ .Values.controllerReplicas }} + strategy: + type: RollingUpdate + {{- else }} updateStrategy: type: RollingUpdate + {{- end }} template: metadata: annotations: @@ -26,10 +32,17 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- if eq .Values.controllerKind "Deployment" }} + {{- with .Values.deploymentNodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- else }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + {{- end }} {{- with .Values.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/openstack-cloud-controller-manager/values.yaml b/charts/openstack-cloud-controller-manager/values.yaml index 39503d8d5e..5bc47c4645 100644 --- a/charts/openstack-cloud-controller-manager/values.yaml +++ b/charts/openstack-cloud-controller-manager/values.yaml @@ -2,6 +2,14 @@ # # Define deployment mode for the controller and provide cloud credentials in cloudConfig at the end of the file # +# Controller kind: DaemonSet or Deployment +# Use DaemonSet to run on all control-plane nodes (default) +# Use Deployment to run a specific number of replicas +controllerKind: DaemonSet + +# Number of replicas (only used when controllerKind is Deployment) +controllerReplicas: 2 + ## Annotations to apply to all resources commonAnnotations: {} # commonAnnotations: @@ -55,10 +63,14 @@ hostNetwork: true # Set to ClusterFirst if hostNetwork is disabled dnsPolicy: ClusterFirstWithHostNet -# Set nodeSelector where the controller should run, i.e. controlplane nodes +# Set nodeSelector where the controller should run, i.e. controlplane nodes (used for DaemonSet) nodeSelector: node-role.kubernetes.io/control-plane: "" +# Set nodeSelector for Deployment (used when controllerKind is Deployment) +# Defaults to empty (no node restriction) +deploymentNodeSelector: {} + # Set tolerations for nodes where the controller should run, i.e. node # should be uninitialized, controlplane... tolerations: