castai-config-sync

by Cast AI

Helm chartv0.1.0App v0.1.0Verified publisher

CAST AI Kubernetes operator for two-way sync of autoscaling policies, node configurations, and node templates.

About this chart

castai-config-sync

CAST AI Kubernetes operator for two-way sync of autoscaling policies, node configurations, and node templates.

Maintainers

NameEmailUrl
CAST AI

Requirements

Kubernetes: >= 1.25.0-0

Values

KeyTypeDefaultDescription
affinityobject{}Affinity rules for pod scheduling
apiKeySecretobject{"key":"API_KEY","name":""}Read API_KEY from an existing Secret. Required unless castai.apiKey is set (the castware pattern, cf. evictor); no default name — the chart reads no API key implicitly, and the umbrella wires the co-installation explicitly. The operator must be deployed in the same namespace for the secretKeyRef to work.
apiKeySecret.keystring"API_KEY"Key in the Secret holding the API key
apiKeySecret.namestring""Name of the Secret containing API_KEY
apiURLConfigMapobject{"key":"API_URL","name":""}Read API_URL from an existing ConfigMap. Optional: with neither castai.apiURL nor this name set, the CASTAI_API_URL env var is omitted and the operator's built-in default (https://api.cast.ai) applies. No default name — set it explicitly.
apiURLConfigMap.keystring"API_URL"Key in the ConfigMap holding the API URL
apiURLConfigMap.namestring""Name of the ConfigMap containing API_URL
castaiobject{"apiKey":"","apiURL":"","clusterID":""}CAST AI configuration
castai.apiKeystring""CAST AI API key. One of this or apiKeySecret.name is required when the operator is enabled: the chart reads no API key implicitly. Dev/e2e convenience only: the rendered Secret puts the key into Helm release metadata (visible via helm get manifest) — prefer apiKeySecret with an externally managed Secret for real clusters.
castai.apiURLstring""CAST AI API base URL. Optional: when empty with apiURLConfigMap.name also unset, the CASTAI_API_URL env var is omitted and the operator's built-in default (https://api.cast.ai) applies.
castai.clusterIDstring""CAST AI cluster ID. One of this, clusterIDConfigMap.name or clusterIDSecret.name is required when the operator is enabled: the chart reads no cluster id implicitly, and the operator exits at startup without one.
clusterIDConfigMapobject{"key":"CLUSTER_ID","name":""}Read CLUSTER_ID from an existing ConfigMap. Required unless castai.clusterID or clusterIDSecret.name is set; no default name — set it explicitly. The operator must be deployed in the same namespace for the configMapKeyRef to work.
clusterIDConfigMap.keystring"CLUSTER_ID"Key in the ConfigMap holding the cluster ID
clusterIDConfigMap.namestring""Name of the ConfigMap containing CLUSTER_ID
clusterIDSecretobject{"key":"CLUSTER_ID","name":""}Read CLUSTER_ID from an existing Secret. Required unless castai.clusterID or clusterIDConfigMap.name is set; no default name, and the operator must be deployed in the same namespace for the secretKeyRef to work. Setting several cluster-id sources is not rejected: only one is rendered, in the order inline castai.clusterID, then clusterIDConfigMap, then this Secret.
clusterIDSecret.keystring"CLUSTER_ID"Key in the Secret holding the cluster ID
clusterIDSecret.namestring""Name of the Secret containing CLUSTER_ID
enabledboolfalseMaster opt-in switch for the operator. When false (default), the chart renders nothing: no CRDs, no RBAC, no workload, no webhook. When true, the full install renders; readonly and webhook.enabled then control the runtime mode. Flipping true -> false on an existing release removes the operator, webhook and workload on the next helm upgrade; the CRD definitions and their CRs are kept (the CRDs carry helm.sh/resource-policy: keep) — delete them manually if truly wanted. See README "Turning the operator off" for the safe sequence. The umbrella chart will gate the same decision through its castai-config-sync.enabled dependency condition.
extraEnvlist[]Extra environment variables
fullnameOverridestring""Override the full resource name
image.pullPolicystring"IfNotPresent"Image pull policy
image.repositorystring"ghcr.io/castai/images/castai-config-sync"Image repository. Under an umbrella render the parent's global.registry is prepended (unconditionally: an already-qualified repository is prefixed too, mirroring the umbrella's own helper).
image.tagstring""Image tag (defaults to chart appVersion)
imagePullSecretslist[]Image pull secrets for private registries. Merged with the parent's global.imagePullSecrets when rendered under the umbrella chart; entries present in both lists appear once.
leaderElectionobject{"enabled":true}Enable leader election (recommended for HA)
nameOverridestring""Override the chart name
nodeSelectorobject{}Node selector for pod scheduling
orphanActionstring"report"Action for CAST AI resources with no matching CR ("orphans"): report only logs the orphan (the default), adopt creates the CR (the mirror behavior), delete removes the CAST AI resource. Delete is never silent: every delete is logged with the resource identity. delete is rejected at startup in readonly mode (readonly never deletes on the CAST AI API).
podAnnotationsobject{}Pod-level annotations
podSecurityContextobject{"fsGroup":65532,"runAsNonRoot":true,"runAsUser":65532}Pod-level security context
rbacobject{"create":false,"editorGroups":[],"viewerGroups":[]}Generate the CRD-operator ClusterRoles and group bindings from values (GitOps-friendly alternative to the YAML files in docs/rbac-examples/). SECURITY-SENSITIVE: the editor role allows create/update/delete on the three CRDs, which makes the operator push changes to the CAST AI API — NodeConfiguration also carries initScript (root code on provisioned nodes) and instanceProfileArn (cloud IAM role selection). Treat the editor role as node-level root plus iam:PassRole equivalent.
rbac.createboolfalseCreate the editor/viewer ClusterRoles. Off by default: enabling this creates real cluster-scoped grants.
rbac.editorGroupslist[]Kubernetes groups bound to the editor ClusterRole (CAST AI cluster-configuration write access — see above). One ClusterRoleBinding is rendered per entry; entries must be unique and non-empty.
rbac.viewerGroupslist[]Kubernetes groups bound to the viewer ClusterRole (get/list/watch — discloses infrastructure identifiers and node bootstrap scripts).
readonlybooltrueReadonly mode: only sync from CAST AI API to CRDs, never push CRD changes to the API. When true, the validating webhook is disabled and the operator runs without TLS certs. This is the shipped default: new installs start read-only. Flip to false with helm upgrade to open the CRD->API write path (and webhook) when ready. Unmatched CAST AI resources are reported (see orphanAction), not adopted as CRs; set orphanAction: adopt to materialize them.
replicaCountint2Number of operator replicas. 2 keeps the validating webhook (failurePolicy: Fail) available through node drains: the PDB's maxUnavailable: 1 is only meaningful at >= 2 replicas. Leader election keeps the reconcilers single-active; the webhook and cert rotator serve on every pod.
resources.limits.cpustring"200m"
resources.limits.memorystring"256Mi"
resources.requests.cpustring"100m"
resources.requests.memorystring"128Mi"
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true}Container security context
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueCreate a dedicated service account
serviceAccount.namestring""Service account name (generated if empty)
syncIntervalstring"5m"Interval for API→CRD sync polling
tolerationslist[]Tolerations for pod scheduling. Merged with the parent's global.tolerations when rendered under the umbrella chart; entries present in both lists appear once.
webhookobject{"disableRotation":false,"enabled":true,"timeoutSeconds":5}Validating admission webhook configuration
webhook.disableRotationboolfalseDisable cert rotation and run webhook-free (dev/e2e; no certificates are generated)
webhook.enabledbooltrueEnable the validating webhook (calls CAST AI API on create/update)
webhook.timeoutSecondsint5Maximum time in seconds the Kubernetes API server waits for the webhook to respond before failing the admission request (failurePolicy: Fail). Small on purpose: a slow or hanging CAST AI API must fail admission fast instead of stalling it — and with it every kubectl/GitOps interaction with the three CRDs — cluster-wide. Must stay below the webhook's 30s HTTP client timeout. Valid range: 1–30, enforced at render time.

Deploys the castai-config-sync operator, which mirrors CAST AI autoscaling resources (node configurations, node templates, autoscaler scaling policies) into Kubernetes CRs and pushes user changes back to the CAST AI API. Matched resources mirror into CRs; unmatched ones are reported, not adopted, unless orphanAction: adopt.

Opt-in gate (enabled) — install means opt in

The chart is off by default:

enabled: false

enabled is a fullstop switch. With enabled: false (the default), the chart renders zero resources — no CRDs, no RBAC, no Deployment, no Services, no webhook, no secrets. Nothing is created, so policy engines (e.g. Gatekeeper CRD whitelists) see nothing and users cannot create CRs that nothing would consume.

With enabled: true, the full install renders. Installing the operator and creating its CRDs is one deliberate decision, not a side effect of pulling in the chart.

Direct installs must opt in explicitly:

helm install castai-config-sync ./chart -n castai-agent \
  --set enabled=true \
  --set castai.clusterID=<cluster-id> \
  --set apiKeySecret.name=<secret-containing-API_KEY>

See "Credential provisioning" below for the credential sources the install must present.

The bundled presets (values-e2e.yaml, values-kind-kwok.yaml) already set enabled: true because they exist to deploy the operator.

Layering with the umbrella chart

The agreed umbrella design gates the same decision one layer up: the umbrella's dependency condition will be castai-config-sync.enabled, passing that value through to the subchart's root enabled. One flag, two layers — the umbrella condition decides whether the subchart is included at all, and the chart's own gate keeps direct installs (outside the umbrella) equally safe. The subordinate knobs below are only meaningful when enabled: true; they compose under it and never widen it.

Note: the umbrella wiring ships separately. Until it lands, umbrella consumers installing this subchart must set enabled: true explicitly — with the default the subchart renders nothing by design.

The opt-in gate ships with the chart's first published version: the chart has not been published to a chart repository yet (the release train is tag-gated on castai-config-sync/vX.Y.Z), so the gate needs no separate version boundary — the first released chart version includes it.

Credential provisioning

The chart does not read any Secret or ConfigMap implicitly. Credentials must be presented explicitly: enabling the operator without a cluster id or API key source fails at render time with an actionable error instead of silently inheriting a neighboring component's credentials.

CredentialInline valueExternal referenceWhen neither is set
API keycastai.apiKey — chart creates the <release>-credentials Secret (dev/e2e convenience: the key lands in Helm release metadata, visible via helm get manifest)apiKeySecret.name / .key (default key API_KEY) — pre-existing Secret, the castware pattern (cf. evictor)render fails
Cluster IDcastai.clusterIDclusterIDConfigMap.name / .key (default key CLUSTER_ID) — pre-existing ConfigMap — or clusterIDSecret.name / .key (default key CLUSTER_ID) — pre-existing Secretrender fails
API URLcastai.apiURLapiURLConfigMap.name / .key (default key API_URL) — pre-existing ConfigMapenv var omitted; the operator's built-in default https://api.cast.ai applies

Referenced Secrets and ConfigMaps must exist in the release namespace — the secretKeyRef/configMapKeyRef cannot resolve across namespaces.

The cluster id and the API URL each accept several sources. For the cluster id, setting more than one is not rejected: only one source is rendered, in the order inline castai.clusterID, then clusterIDConfigMap, then clusterIDSecret. Both external forms are supported because consumers differ in where they keep the id; the ConfigMap path is unchanged.

Independent installs (no CAST AI agent in the cluster): create a Secret holding the API key and point apiKeySecret at it, plus castai.clusterID (or a ConfigMap or Secret reference). Nothing about the CAST AI agent installation is assumed.

Running next to the CAST AI agent: opt into the co-installation explicitly — point each reference at the ConfigMap and Secret that installation creates in this namespace:

clusterIDConfigMap:
  name: <agent-configmap>
apiURLConfigMap:
  name: <agent-configmap>
apiKeySecret:
  name: <agent-secret>

The umbrella integration wires exactly this when co-installation is wanted. Upgrading a release that relied on implicit defaults

Deploy castai-config-sync with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has castai-config-sync 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 chartcastai-config-sync is pinned at v0.1.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