From c8c8e0521b28264046ba55c81dbbee9cf5f94e24 Mon Sep 17 00:00:00 2001 From: Payback159 Date: Mon, 19 Dec 2022 19:16:25 +0100 Subject: [PATCH] add extra variable for OCCM cluster-name for separated naming --- .../external_cloud_controller/openstack/defaults/main.yml | 4 ++++ .../external-openstack-cloud-controller-manager-ds.yml.j2 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/roles/kubernetes-apps/external_cloud_controller/openstack/defaults/main.yml b/roles/kubernetes-apps/external_cloud_controller/openstack/defaults/main.yml index 71af4b4d8..706c83c05 100644 --- a/roles/kubernetes-apps/external_cloud_controller/openstack/defaults/main.yml +++ b/roles/kubernetes-apps/external_cloud_controller/openstack/defaults/main.yml @@ -21,4 +21,8 @@ external_openstack_cacert: "{{ lookup('env','OS_CACERT') }}" ## arg1: "value1" ## arg2: "value2" external_openstack_cloud_controller_extra_args: {} +## By default the value of cluster_name variable is taken. +## If you want to give the OCCM identifier a different value, +## you can set the external_openstack_cloud_controller_cluster_name. +## external_openstack_cloud_controller_cluster_name: "cluster-name" external_openstack_cloud_controller_image_tag: "v1.25.3" diff --git a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-controller-manager-ds.yml.j2 b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-controller-manager-ds.yml.j2 index 4596f92f7..0998a2c9f 100644 --- a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-controller-manager-ds.yml.j2 +++ b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-controller-manager-ds.yml.j2 @@ -44,7 +44,11 @@ spec: - --v=1 - --cloud-config=$(CLOUD_CONFIG) - --cloud-provider=openstack +{% if external_openstack_cloud_controller_cluster_name is defined %} + - --cluster-name={{ external_openstack_cloud_controller_cluster_name }} +{% else %} - --cluster-name={{ cluster_name }} +{% endif %} - --use-service-account-credentials=true - --bind-address=127.0.0.1 {% for key, value in external_openstack_cloud_controller_extra_args.items() %}