Openstack-Cloud-Controller-Manager doesn't use the cluster-name

Bug #2039886 reported by Adam Dyess
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
CDK Addons
Fix Released
High
Adam Dyess
Openstack Cloud Controller Charm
Fix Released
High
Adam Dyess

Bug Description

As demonstrated in https://pastebin.canonical.com/p/NFk9k9zgTF/ the args of openstack-cloud-controller-manager

    Args:
      /bin/openstack-cloud-controller-manager
      --cluster-name=kubernetes-fu6ks9empuz38g7utkc1n6unudbn9dc1
      --v=1
      --cluster-name=$(CLUSTER_NAME)
      --cloud-config=$(CLOUD_CONFIG)
      --cloud-provider=openstack
      --use-service-account-credentials=true
      --bind-address=127.0.0.1

set the cluster-name twice -- which ends up using the environment set name instead since it comes second in the argument list.

The DaemonSet default value for cluster-name is `kubernetes` -- meaning that if you were to use two or more clusters attached to the same openstack cloud project, all the resources intended to be unique for your cluster would clash with the second cluster.

for example:

A loadbalancer for the hello service in the default domain might be named kube_service_kubernetes-default-hello

Both clusters would attempt to use this same load-balancer for the different services each named hello

Tags: sts
Revision history for this message
Adam Dyess (addyess) wrote :

Affects
* cdk-addons 1.28
* cdk-addons 1.27
* cdk-addons 1.26

Does not affect cdk-addons 1.25 or Prior

Changed in cdk-addons:
milestone: none → 1.29
status: New → In Progress
assignee: nobody → Adam Dyess (addyess)
tags: added: backport-needed
Revision history for this message
Adam Dyess (addyess) wrote :
Revision history for this message
Pedro Victor Lourenço Fragola (pedrovlf) wrote :

I tested a workaround by changing the daemonset "kubectl edit daemonset -n kube-system openstack-cloud-controller-manager" to use the correct cluster name:

1001 345683 345576 9 20:44 ? 00:00:01 /bin/openstack-cloud-controller-manager --cluster-name=kubernetes-fu6ks9empuz38g7utkc1n6unudbn9dc1 --v=1 --cluster-name=kubernetes-fu6ks9empuz38g7utkc1n6unudbn9dc1 --cloud-config=/etc/config/cloud.conf --cloud-provider=openstack --use-service-account-credentials=true --bind-address=127.0.0.1

With this, the LB is created with the right name:

| 03f1a0e3-68cf-45da-ab76-10c45b5f01e4 | kube_service_kubernetes-fu6ks9empuz38g7utkc1n6unudbn9dc1_default_microbot-service-test | f98f4210a9764fff93ed4bd58b710025 | 10.6.1.117 | PENDING_CREATE | OFFLINE | amphora |

Revision history for this message
Adam Dyess (addyess) wrote :

We will likely need to target backport fixes for 1.28, 1.27, and 1.26

tags: added: sts
Revision history for this message
Adam Dyess (addyess) wrote :
Changed in charm-openstack-cloud-controller:
milestone: none → 1.29
status: New → In Progress
assignee: nobody → Adam Dyess (addyess)
Changed in charm-openstack-cloud-controller:
importance: Undecided → High
status: In Progress → Fix Committed
Changed in cdk-addons:
status: In Progress → Fix Committed
importance: Undecided → High
Adam Dyess (addyess)
Changed in cdk-addons:
milestone: 1.29 → 1.28+ck2
Changed in charm-openstack-cloud-controller:
milestone: 1.29 → 1.28+ck2
Revision history for this message
Adam Dyess (addyess) wrote :
tags: removed: backport-needed
Adam Dyess (addyess)
Changed in cdk-addons:
status: Fix Committed → Fix Released
Changed in charm-openstack-cloud-controller:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.