cruise-control

by DevOps IA

Helm chartv4.0.13App jdk17-cc3.1.0-iam2.4.0Verified publisher

A Helm chart to deploy Cruise Control for Apache Kafka

About this chart

cruise-control

A Helm chart to deploy Cruise Control for Apache Kafka

Maintainers

NameEmailUrl
ialejandro[email protected]https://ialejandro.rocks

[!WARNING] BREAKING: this chart deploys Cruise Control 3.x only. Chart 3.0.0 dropped 2.x, and chart 4.0.0 makes the new UI the default. See Migrating from chart 2.x.

Container images

The server image is built from devops-ia/kafka-cruise-control and the UI image from devops-ia/kafka-cruise-control-ui:

ComponentGHCRDocker Hub
Serverghcr.io/devops-ia/kafka-cruise-controldevopsiaci/cruise-control
UI (new, default)ghcr.io/devops-ia/kafka-cruise-control-uidevopsiaci/kafka-cruise-control-ui
UI (legacy, frozen at 0.4.0)ghcr.io/devops-ia/kafka-cruise-control-ui:0.4.0devopsiaci/cruise-control-ui:0.4.0

Why this chart uses them:

  • Upstream attaches no jar or tgz assets to its releases, so the image is built from the git tag.
  • The server image bundles what the chart expects: the server, the AWS MSK IAM auth jar and the metrics reporter jar (/cruise-control/cruise-control/build/dependant-libs/cruise-control-metrics-reporter.jar). The UI is a separate image.
  • Both run as non-root (server uid 65534; the new UI is distroless and non-root; the legacy UI runs as uid 101).
  • Images are multi-arch (linux/amd64, linux/arm64) and published with an SBOM. The GHCR images also carry a build provenance attestation.
  • Server tags look like jdk<N>-cc<version>-iam<version>. updatecli bumps them, so the chart appVersion follows.
  • Only Cruise Control 3.x is built. JDK 17 (default) and 21 are published. JDK 25 is not: the 3.1.0 build uses Gradle 8.5, which cannot run on it.

To use another image, set image.repository / image.tag (server), ui.image.repository / ui.image.tag (new UI) and ui.legacy.image.repository / ui.legacy.image.tag (legacy UI). A custom server image must provide:

  • the Cruise Control start script at /cruise-control/kafka-cruise-control-start.sh and its config under /cruise-control/config/ (the chart mounts cruisecontrol.properties, capacity.json, clusterConfigs.json and log4j2.properties there),
  • log4j2.properties as the logging file (log4j.properties is not read by 3.x),
  • the web server on port 9090.

Compatibility

"Tested" means checked for this change on a local cluster. "Docs" means taken from the upstream or image documentation, not tested here.

ChartCruise ControlDefault image tagJDKKafkaUILog fileNotes
2.x2.5.146 (docs)jdk17-cc2.5.146-iam2.3.9 (docs)17 (docs)2.5 to 4.3 (docs)0.4.0 (docs)log4j.properties (docs)ZooKeeper settings were accepted. No longer maintained here.
3.0.0 (expected)3.1.0 (tested)jdk17-cc3.1.0-iam2.3.9 (tested)17 (tested), 21 (tested), 25 not published2.5 to 4.3 (docs); 3.9.1 KRaft (tested)1.0.0 new (docs), 0.4.0 legacy (tested)log4j2.properties (tested)ZooKeeper optional (tested without). Metrics reporter on the brokers must match the server version (docs).

Migrating from chart 2.x

  • Only Cruise Control 3.x is supported. To stay on 2.x, pin image.tag to jdk17-cc2.5.146-iam2.3.9 and keep using chart 2.x; this is unsupported.
  • clustersDefaults.log4j (and clusters.<name>.log4j) is now mounted as config/log4j2.properties, which is the file 3.x loads. The values keep the same log4j2 syntax. Your own mounts onto config/log4j.properties (for example through volumeMounts) are no longer read.
  • Update the metrics reporter on every Kafka broker to 3.1.0, together with the server.
  • metric.sampling.interval.ms must be at least 60000. With 30000 or 45000 the server exits at startup with ConfigException: Attempt to set metadata refresh timeout [55000] to be longer than sampling period. The chart default is 120000.
  • zookeeper.connect and zookeeper.security.enabled are not needed. A Kafka KRaft cluster works without them, and a leftover zookeeper.connect: false is ignored (3.1.0 only logs it among the unused configurations).
  • env.JAVA_OPTS is not read by the start script. Use env.KAFKA_HEAP_OPTS and env.KAFKA_JVM_PERFORMANCE_OPTS.
  • BREAKING: the default UI is now the new one, without login. ui.flavor defaults to new, ui.image is the new UI (1.0.0) and the legacy UI lives in ui.legacy.image. If you pinned ui.image.tag: 0.4.0, remove it and set ui.flavor: legacy instead (and ui.legacy.image.tag if you need another legacy tag); otherwise the new UI would start with a 0.4.0 tag that belongs to the old one and the pod would not start. ghcr.io/devops-ia/kafka-cruise-control-ui:0.4.0 is the old UI and will not be updated.
  • The new UI listens on the same port (ui.service.targetPort, 8080) but its health path is /healthz instead of /health, and it does not use the nginx ConfigMap. The /<cluster>/kafkacruisecontrol/ paths of the old nginx proxy do not exist: the new UI picks the cluster in the page.
  • The UI image tag no longer falls back to the server appVersion; the legacy flavor falls back to 0.4.0.
  • ui.env together with ui.envFromConfigMap or ui.envFromSecrets rendered two env: keys in the UI Deployment, so only the last one took effect. It is now one env: list.

User interface

The chart deploys one UI Deployment. ui.flavor picks which UI it runs.

new (default)legacy
Imageui.image, ghcr.io/devops-ia/kafka-cruise-control-ui:1.0.0ui.legacy.image, ghcr.io/devops-ia/kafka-cruise-control-ui:0.4.0
What it iskafka-cruise-control-ui: Go server with the SPA embedded and its own proxy, no nginxThe LinkedIn cruise-control-ui behind nginx, frozen
ConfigurationCCUI_* environment variables the chart generates from clustersnginx.conf and config.csv in a ConfigMap (<release>-cruise-control-ui-config)
Health path/healthz/health
Loginui.auth.mode: none (default), local, oidcNone

The legacy UI is not rebuilt any more and gets no new tags. To build it locally, use docker build --target legacy -t cruise-control-ui-legacy . in kafka-cruise-control-ui. To go back to it: --set ui.flavor=legacy.

Generated configuration (flavor new)

For each entry of clusters the chart sets CCUI_CLUSTERS__<n>__NAME, __GROUP (the group value, or cluster) and __URL (http://<release>-cruise-control-<cluster>:<service.port>/kafkacruisecontrol). It also sets CCUI_AUTH_MODE from ui.auth.mode and CCUI_LISTEN from ui.service.targetPort. Nothing else: timeouts and cluster authentication use the server defaults.

<n> is the position of the cluster in alphabetical order of its name, starting at 0. If you add a cluster whose name sorts before an existing one, the indexes shift, and so do any CCUI_CLUSTERS__<n>__AUTH_* variables you set for the later clusters (see the UI configuration).

Pass everything else through ui.env (plain values), ui.envFromSecrets / ui.envFromConfigMap (single keys) and ui.envFromFiles (a whole Secret or ConfigMap, as envFrom). A variable you define in ui.env, ui.envFromSecrets or ui.envFromConfigMap replaces the generated one of the same name. A Secret loaded with envFromFiles cannot: Kubernetes gives env priority over envFrom, so change CCUI_AUTH_MODE only with ui.auth.mode or ui.env. The chart sets enableServiceLinks: false on the pod, because the UI rejects any unknown CCUI_* variable and Kubernetes would inject CCUI_*_SERVICE_HOST for a Service whose name starts with ccui.

Changes to clusters, ui.auth.mode or ui.env change the pod template, so helm upgrade restarts the pods. A Secret you reference with envFromFiles or envFromSecrets is not tracked: run kubectl rollout restart after you change it.

Login

ui.auth.mode defaults to none: there is no login, everyone who reaches the UI is admin and can start rebalances. The Service is ClusterIP and the ingress is off by default. Turn on local or oidc before you expose the UI. The chart does not create users, hashes, session secrets or OIDC providers; you provide them.

Local users. Create the hash and the Secret yourself:

kubectl create secret generic ccui-secrets \
  --from-literal=CCUI_SESSION_SECRET="$(openssl rand -base64 48)" \
  --from-literal=CCUI_LOCAL_ADMIN_PASSWORD_HASH="$(htpasswd -bnBC 12 "" 'your password' | tr -d ':\n')"
ui:
  auth:
    mode: local
  envFromFiles:
    - secretRef:
        name: ccui-secrets
  # Only on plain HTTP; remove it behind HTTPS
  env:
    CCUI_COOKIE_INSECURE: "true"

OIDC:

ui:
  auth:
    mode: oidc
  env:
    CCUI_PUBLIC_URL: https://cc.example.com
    CCUI_OIDC__0__NAME: corp
    CCUI_OIDC__0__ISSUER: https://idp.example.com
    CCUI_OIDC__0__CLIENT_ID: cruise-control
    CCUI_OIDC__0__ADMIN_GROUPS: ccui-admins
  envFromSecrets:
    CCUI_OIDC__0__CLIENT_SECRET:
      name: ccui-oidc
      key: client-secret
    CCUI_SESSION_SECRET:
      name: ccui-oidc
      key: session-secret

Sessions live in the memory of each pod. With more than one replica and a login, you need session affinity: ui.service.sessionAffinity: ClientIP or a cookie affinity annotation on the ingress. The chart does not set it. All the CCUI_* variables are in the UI configuration.

Hardening

The new UI runs as non-root with a read-only root filesystem. The chart leaves the securityContext values empty, as it does for the server. A recommended setting:

ui:
  securityContext:
    runAsNonRoot: true
    readOnlyRootFilesystem: true
    allowPrivilegeEscalation: false
    capabilities:
      drop: [ALL]

Probes are off by default (ui.livenessProbe.enabled and friends). When on, they call /healthz in the new flavor and /health in the legacy one.

Prerequisites

  • Helm 3+

Add repository

helm repo add cruise-control https://devops-ia.github.io/helm-cruise-control
helm repo update

Install Helm chart (repository mode)

helm install [RELEASE_NAME] cruise-control/cruise-control

This install all the Kubernetes components associated with the chart and creates the release.

See helm install for command documentation.

Install Helm chart (OCI mode)

Charts are also available in OCI format. The list of available charts can be found here.

helm install [RELEASE_NAME] oci://ghcr.io/devops-ia/helm-cruise-control/cruise-control --version=[version]

Uninstall Helm chart

helm uninstall [RELEASE_NAME]

This removes all the Kubernetes components associated with the chart and deletes the release.

See helm uninstall for command documentation.

Examples

See examples directory.

Configuration

See Customizing the chart before installing. To see all configurable options with comments:

helm show values cruise-control/cruise-control

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for pod assignment Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
annotationsobject{}Configure annotations on Deployment
argslist[]Configure args Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/
autoscalingobject{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}Autoscaling with CPU or memory utilization percentage Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
clustersobject{"cluster-dev":{}}Cruise Control cluster configuration Configure multiple Kafka clusters. Each cluster will have its own Deployment, Service, and ConfigMap. Access via Ingress: https://// Example: https://cruise-control.example.com/dev/ or https://cruise-control.example.com/prod/ NOTE: Values defined here will override the corresponding values from 'clustersDefaults' Each cluster can have a 'group' field. If not specified, defaults to 'cluster'
clustersDefaultsobject`{"capacity":{"config":"{\n "brokerCapacities":[\n {\n "brokerId": "-1",\n "capacity": {\n "DISK": "1026",\n "CPU": "100",\n "NW_IN": "1000",\n "NW_OUT": "1000"\n },\n "doc": "This is the default capacity. Capacity unit used for disk is in MB, cpu is in number of cores, network throughput is in KB."\n }\n ]\n}\n","type":"capacity"},"cluster":{"an.example.cluster.config":false,"min.

Deploy cruise-control with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cruise-control 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 chartcruise-control is pinned at v4.0.13 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