Skip to content

Let the CCM deployment start on a fresh cluster - #118

Open
bhouse-nexthop wants to merge 1 commit into
apache:mainfrom
bhouse-nexthop:ccm-manifest-scheduling
Open

bhouse-nexthop wants to merge 1 commit into
apache:mainfrom
bhouse-nexthop:ccm-manifest-scheduling

Conversation

@bhouse-nexthop

Copy link
Copy Markdown

Lets the CCM in deployment.yaml start on a fresh cluster, before the CNI and CoreDNS are up. CloudStack CKS ships this manifest in its binaries ISO.

Change Why
hostNetwork: true There is no pod network until the nodes are initialised, and the CCM is what initialises them.
dnsPolicy: Default Use the node's resolver. CoreDNS isn't running yet, and ClusterFirstWithHostNet would point at it. As a result, the api-url can no longer be a cluster Service name.
Tolerate the not-ready and network-unavailable NoSchedule taints Nodes carry these until the CNI is up.
Tolerate the control-plane and master NoSchedule taints, and prefer control-plane nodes Control-plane nodes may be the only ones available. master covers clusters older than 1.25.
Declare containerPort: 10258 On the host network the CCM binds 10258 on the node. Declaring it stops the scheduler from putting two replicas on one node.
Rolling update maxSurge: 0, maxUnavailable: 1 With one eligible node, a surge pod could never be scheduled and the rollout would hang.
e2e comment, docs/development.md Remove the claim that the pod can't use Docker's DNS, which isn't true on the host network.

The existing uninitialized toleration is unchanged.

Testing

  • go build ./... && go test ./...
  • Strict-decoded the Deployment with k8s.io/api/apps/v1, and parsed every document as YAML.
  • I didn't run the kind e2e locally; it runs in CI.

Fixes #117

- hostNetwork: true: no pod network until nodes are initialised,
  and the CCM is what initialises them
- dnsPolicy: Default: use the node's resolver, CoreDNS may not be
  running yet
- declare port 10258 so the scheduler never puts two CCM pods on one
  host; rolling update maxSurge 0 / maxUnavailable 1 so a single
  replica can be replaced on a single eligible node
- tolerate the node.kubernetes.io/not-ready,
  node.kubernetes.io/network-unavailable, control-plane and master
  NoSchedule taints
- prefer control-plane nodes
- e2e comment and development docs: drop the reason that pods cannot
  use docker's DNS, which no longer holds on the host network

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

Copy link
Copy Markdown
Author

Lab test: passed

Tested on a nested KVM CloudStack lab running a main (24.0.0-SNAPSHOT) build. The kubelets ran with --cloud-provider=external, from a CloudStack change still under review, so every node started with the node.cloudprovider.kubernetes.io/uninitialized taint. The CKS binaries ISO (Kubernetes v1.33.13) was built with the deployment.yaml from this PR's head (b453776); the image was apache/cloudstack-kubernetes-provider:v1.3.0.

cluster result
1 control + 2 workers the CCM pod was scheduled on the tainted control node while CoreDNS was still Pending, and initialised all 3 nodes about 1s apart
3 control + 1 worker (HA) all 4 nodes initialised
scale-up and add-node the new nodes were initialised too, including an Ubuntu 24.04 node added with addNodesToKubernetesCluster

On every node:

  • providerID external-cloudstack://<vm uuid>
  • topology.kubernetes.io/zone and node.kubernetes.io/instance-type labels set
  • InternalIP set
  • uninitialized taint cleared

A LoadBalancer Service got a public IP and answered HTTP 200 through it. There were no restart loops and no CCM DNS errors.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deployment.yaml: CCM can't start on a fresh cluster

1 participant