upcloud-ccm

by Ankra

Helm chartv0.4.0App v1.2.3Apache-2.0Verified publisher

UpCloud Cloud Controller Manager for Kubernetes - leader-elected, hardened, with built-in Prometheus alerts & Grafana dashboard.

About this chart

upcloud-ccm

UpCloud Cloud Controller Manager packaged as a Helm chart. Runs the upstream ghcr.io/upcloudltd/cloud-controller-manager binary with leader election, hardened pod security defaults, optional ServiceMonitor, and an opt-in NetworkPolicy.

TL;DR

# Generate a stable cluster ID once and pin it in your values file.
uuidgen

helm install upcloud-ccm ./charts/upcloud-ccm -n kube-system \
  --set ccmConfig.clusterID="$(uuidgen)" \
  --set credentials.username="$UPCLOUD_USERNAME" \
  --set credentials.password="$UPCLOUD_PASSWORD"

Then annotate every node with its UpCloud VM and Private Network UUIDs (see NEXT STEPS below). Without these annotations the CCM cannot match Kubernetes nodes to UpCloud infrastructure.

Requirements

RequirementNotes
Kubernetes>= 1.27 (enforced by Chart.yaml's kubeVersion)
Cluster roleThe chart renders its own ClusterRole + ClusterRoleBinding by default (rbac.create=true), targeting the external-CCM setup (K3s --disable-cloud-controller / vanilla Kubernetes). Set rbac.create=false if your cluster already ships CCM RBAC.
Service accountThe chart creates the ServiceAccount by default (serviceAccount.create=true). Set serviceAccount.create=false if your cluster pre-creates the cloud-controller-manager SA.
CredentialsUpCloud API username & password with Manage permission.
Cluster IDA stable, unique string (UUID recommended). Required.

Install

K3s (defaults work out of the box)

helm install upcloud-ccm ./charts/upcloud-ccm -n kube-system \
  --set ccmConfig.clusterID=<your-stable-uuid> \
  --set credentials.username=<upcloud-api-username> \
  --set credentials.password=<upcloud-api-password>

Vanilla Kubernetes (create SA + RBAC yourself)

helm install upcloud-ccm ./charts/upcloud-ccm -n kube-system \
  --set ccmConfig.clusterID=<your-stable-uuid> \
  --set credentials.username=<upcloud-api-username> \
  --set credentials.password=<upcloud-api-password> \
  --set serviceAccount.create=true \
  --set rbac.create=true

With an externally-managed Secret (e.g. External Secrets Operator)

helm install upcloud-ccm ./charts/upcloud-ccm -n kube-system \
  --set ccmConfig.clusterID=<your-stable-uuid> \
  --set credentials.create=false \
  --set credentials.existingSecret=upcloud-api-credentials

Next steps

  1. Annotate every node with its UpCloud VM and Private Network UUID. The CCM uses these to match Kubernetes nodes to UpCloud infrastructure:

    kubectl annotate node <node-name> \
      infrastructure.cluster.x-k8s.io/upcloud-vm-uuid=<YOUR_UPCLOUD_VM_UUID>
    
    kubectl annotate node <node-name> \
      infrastructure.cluster.x-k8s.io/upcloud-vm-private-nw-uuid=<YOUR_UPCLOUD_PRIVATE_NETWORK_UUID>
    

    UUIDs are visible in the UpCloud Hub or via upctl server list / upctl network list.

  2. Verify the deployment:

    kubectl -n kube-system rollout status deployment/upcloud-ccm
    kubectl -n kube-system logs -l app.kubernetes.io/name=upcloud-ccm --tail=50
    
  3. Test by exposing a workload as type: LoadBalancer. The CCM will provision an UpCloud Managed Load Balancer (default plan: development) and surface its external IP back on the Service.

Production checklist

The chart ships with sensible defaults for production, but verify these knobs suit your environment:

  • replicaCount: 2 + --leader-elect=true for HA. Bump to 3 on large clusters and combine with the production.yaml example.
  • podDisruptionBudget.enabled: true (minAvailable: 1).
  • topologySpreadConstraints + soft pod anti-affinity spread replicas across nodes.
  • Pod runs as nonroot (runAsUser: 65532), read-only root filesystem, all capabilities dropped, seccomp RuntimeDefault.
  • --profiling=false and --contention-profiling=false.
  • Liveness/readiness probes target the CCM secure /healthz over HTTPS.
  • metrics.serviceMonitor.enabled (or metrics.podMonitor.enabled) exposes the CCM to Prometheus - requires the Prometheus Operator CRDs.
  • metrics.prometheusRule.enabled renders the recommended alert rules (CCM down, leader-election flapping, API errors, crash loop).
  • dashboard.enabled ships a Grafana dashboard ConfigMap discovered by the Grafana sidecar (grafana_dashboard: "1").
  • networkPolicy.enabled (opt-in) restricts egress and ingress.
  • Pod-spec knobs available out of the box: hostAliases, dnsConfig, runtimeClassName, schedulerName, fsGroupChangePolicy, terminationMessagePolicy.

See values-examples/production.yaml for a complete production overlay and values-examples/observability.yaml for a full kube-prometheus-stack-compatible setup.

Observability

The chart ships three opt-in observability resources:

ResourceValue flagPurpose
ServiceMonitormetrics.serviceMonitor.enabledPrometheus Operator scrapes the headless metrics Service.
PodMonitormetrics.podMonitor.enabledAlternative - scrapes pods directly without a Service.
PrometheusRulemetrics.prometheusRule.enabledRecommended alerts (see below).
Grafana dashboarddashboard.enabledConfigMap auto-discovered by the kube-prometheus-stack Grafana sidecar.

Bundled alerts

AlertSeverityTrigger
UpCloudCCMDowncriticalNo Prometheus target Up for >5m.
UpCloudCCMLeaderElectionFlappingwarningLeader changes >6/h for 10m.
UpCloudCCMReconcileErrorswarning>5 UpCloud API errors in 5m, sustained 10m.
UpCloudCCMPodCrashLoopingcritical>3 restarts in 15m, sustained 5m.

Tune severities, durations and add extraRules: via metrics.prometheusRule.alerts.* / metrics.prometheusRule.extraRules.

Troubleshooting

SymptomLikely causeFix
Nodes stuck NotReady with node.cloudprovider.kubernetes.io/uninitializedCCM cannot reach UpCloud API or node lacks upcloud-vm-uuid annotationCheck pod logs; verify the two annotations on every node.
LoadBalancer Service stays pendingloadBalancerPlan exhausted in account, or loadBalancerMaxBackendMembers exceededBump plan or reduce backends.
helm test upcloud-ccm failsRollout still in progress, or CCM crashingkubectl -n kube-system describe deploy upcloud-ccm and inspect events.
PrometheusRule rendered but no alerts firemetrics.prometheusRule.labels does not include the selector your Prometheus uses (kube-prometheus-stack defaults to release: <release-name>)Add metrics.prometheusRule.labels.release=kube-prometheus-stack (or your value).

Air-gapped installs

Mirror the CCM image to your registry and override:

global:
  imageRegistry: harbor.internal
images:
  ccm:
    repository: mirror/upcloudltd/cloud-controller-manager
    digest: sha256:<obtained via `crane digest ghcr.io/upcloudltd/cloud-controller-manager:<tag>`>

See values-examples/air-gapped.yaml.

Sharing credentials with upcloud-csi

The companion upcloud-csi chart needs the same UpCloud API credentials. The cleanest pattern is:

  1. Install upcloud-ccm first with credentials.create=true. It creates a Secret named <release>-credentials.
  2. Install upcloud-csi with credentials.existingSecret=<release>-credentials.

Uninstall

helm uninstall upcloud-ccm -n kube-system

Existing LoadBalancer Services will retain their UpCloud Managed Load Balancers until the Service objects themselves are deleted.

Upgrading

helm upgrade upcloud-ccm ./charts/upcloud-ccm -n kube-system \
  -f my-values.yaml

Leader election + rolling update strategy (maxUnavailable: 0) keeps at least one CCM replica serving throughout the upgrade.

Configuration reference

A full table of values is below (kept in sync with values.yaml by helm-docs).

See values.yaml for the full list of values. Key knobs:

KeyDefaultDescription
replicaCount2Number of CCM replicas.
ccmConfig.clusterID"" (REQUIRED)Stable cluster identifier.
ccmConfig.clusterName"my-k3s-cluster"Name surfaced in UpCloud Hub.
ccmConfig.loadBalancerPlan"development"Default plan for managed LBs.
credentials.createtrueCreate a Secret from username/password.
credentials.existingSecret""Reference an externally-managed Secret.
serviceAccount.createtrueSet false if your cluster pre-creates the CCM SA.
rbac.createtrueRenders ClusterRole + ClusterRoleBinding. Set false if your cluster ships CCM RBAC.
images.ccm.registryghcr.ioOverridden by global.imageRegistry.
images.ccm.repositoryupcloudltd/cloud-controller-manager
images.ccm.tag""Falls back to .Chart.AppVersion.
images.ccm.digest""sha256 digest; takes precedence over tag.
metrics.serviceMonitor.enabledfalseOpt-in Prometheus Operator integration.
metrics.podMonitor.enabledfalseDirect pod scraping (alternative to ServiceMonitor).
metrics.prometheusRule.enabledfalseRender recommended alert rules.
dashboard.enabledfalseGrafana dashboard ConfigMap (sidecar discovery).
tests.enabledtrueRender the helm test rollout-status pod.
networkPolicy.enabledfalseOpt-in NetworkPolicy.
podDisruptionBudget.enabledtrueActive when replicaCount > 1.
hostAliases / dnsConfig / runtimeClassName / schedulerName[] / {} / "" / ""Pod-spec passthroughs.
fsGroupChangePolicyOnRootMismatchSkip fsGroup chowns when already correct.
terminationMessagePolicyFallbackToLogsOnErrorSurface logs on non-zero exits.

See also

Deploy upcloud-ccm with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has upcloud-ccm on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartupcloud-ccm is pinned at v0.4.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply