Skip to content

Connect the CloudStack CCM to CKS nodes - #14765

Open
bhouse-nexthop wants to merge 1 commit into
apache:4.22from
bhouse-nexthop:cks-ccm-external
Open

bhouse-nexthop wants to merge 1 commit into
apache:4.22from
bhouse-nexthop:cks-ccm-external

Conversation

@bhouse-nexthop

Copy link
Copy Markdown
Collaborator

Description

Fixes #14764

CKS deploys the CloudStack cloud controller manager but never starts the kubelets with --cloud-provider=external, so the CCM never initialises a node: no providerID, no zone or instance-type labels, and no cleanup of deleted VMs. This connects them, opt-in.

what how
kubelet --cloud-provider=external and --node-ip on control and worker nodes
setting cloud.kubernetes.cluster.external.cloud.provider.enabled, zone scope, default false
which clusters isolated and VPC networks only; direct-access networks get no CCM, so they never get the flag
existing clusters the flag is gated on a new externalCloudProvider cluster detail, set at create time; scale, add-node and upgrade of older clusters keep their nodes as they were
create order the CCM is deployed as soon as the kube-config is available, before the dashboard wait, because add-ons stay Pending until it clears the uninitialized taint; a failed deploy now fails the create
cloud config passes the zone name, so the CCM does not look up its own pod name as a VM
provider version deploy-provider and the binaries ISO builder pin the v1.3.0 release manifest instead of main, and set the image to v1.3.0 (the release manifest still names v1.2.0)

Why opt-in: ISOs built before provider v1.1.0 cannot schedule the CCM on tainted nodes, and the CCM has to reach endpoint.url before cluster DNS runs. That needs an IP address there, or a provider manifest with hostNetwork (apache/cloudstack-kubernetes-provider#118). Otherwise new nodes stay unschedulable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • Major

How Has This Been Tested?

Unit tests: KubernetesCluster*Test in the plugin pass, including 3 new ones in KubernetesClusterActionWorkerTest.

Lab: a nested KVM lab (3 hosts, Ceph RBD). It runs a main (24.0.0-SNAPSHOT) build with this commit picked on top, so it has not been run on a 4.22 build. Kubernetes v1.33.13. The ISO was built with create-kubernetes-binaries-iso.sh and the provider manifest from apache/cloudstack-kubernetes-provider#118 (hostNetwork, dnsPolicy: Default). endpoint.url is an IP address.

setting cluster result
on 1 control + 2 workers every kubelet has --cloud-provider=external --node-ip=<ip>; the CCM initialised all nodes; uninitialized taint cleared; InternalIP, providerID, zone and instance-type set; create finished Running
on 3 control + 1 worker same on all 4 nodes
on scale-up +1 worker, add-node (Ubuntu 24.04 VM) the new nodes got the flag and were initialised
on → off add-node to the cluster created with it on the node still got the flag (per-cluster detail)
on LoadBalancer Service public IP assigned, HTTP 200 through it
off 1 control + 1 worker no kubelet flag, CCM deployed and Running as before, no taints, all pods Running
n/a cluster created before the upgrade, scaled after new node joined without the flag, as before

How did you try to break this feature and the system with this change?

  • Turned the setting off after creating a cluster, then added a node.
  • Created a cluster with the setting off.
  • Scaled a cluster created by the old packages.

@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.50000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.32%. Comparing base (b56bbc2) to head (9178707).

Files with missing lines Patch % Lines
...er/actionworkers/KubernetesClusterStartWorker.java 0.00% 9 Missing ⚠️
...r/actionworkers/KubernetesClusterActionWorker.java 53.84% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14765   +/-   ##
=========================================
  Coverage     18.32%   18.32%           
- Complexity    16644    16652    +8     
=========================================
  Files          5939     5939           
  Lines        537787   537807   +20     
  Branches      65932    65935    +3     
=========================================
+ Hits          98544    98561   +17     
- Misses       428033   428035    +2     
- Partials      11210    11211    +1     
Flag Coverage Δ
uitests 4.08% <ø> (ø)
unittests 19.41% <37.50%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

CKS has deployed the CloudStack cloud controller manager since 2021 but
never started the kubelets with --cloud-provider=external, so the CCM
never initialised a node (no providerID, zone or instance-type labels,
no cleanup of deleted VMs).

- Kubelet: add `--cloud-provider=external` and `--node-ip` on control
  and worker nodes, only for clusters that get the CCM (not
  direct-access networks)
- Opt-in per zone with
  `cloud.kubernetes.cluster.external.cloud.provider.enabled` (default
  false): ISOs built before provider v1.1.0 can't schedule the CCM on
  tainted nodes, and the CCM has to reach endpoint.url
- Existing clusters: the flag is gated on a new `externalCloudProvider`
  cluster detail set at create time, so scaling or upgrading a cluster
  created earlier keeps its nodes as they were
- Create: deploy the CCM as soon as the kube-config is available, before
  waiting for the dashboard, since add-ons stay Pending until the CCM
  clears the uninitialized taint; a failed deploy now fails the create
- Cloud config: pass the zone name, so the CCM doesn't look up its own
  pod name as a VM to find the zone
- Pin the provider manifest to the v1.3.0 release in deploy-provider
  and the binaries ISO builder instead of pulling `main`, and set the
  image to v1.3.0 (the release manifest still names the v1.2.0 image)

Signed-off-by: Brad House <bhouse@nexthop.ai>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant