How it works
How AutoLifecycle discovers EKS components, decides what to upgrade, and validates every change from inside the cluster.
Early Access FeatureThis feature is in early access. It may undergo changes based on user feedback and continued development. We recommend testing in non-production environments first and welcome your feedback to help us improve.
Architecture
AutoLifecycle is delivered by the Cast AI Operator (castware-operator). On EKS clusters, the Operator runs a second Deployment of the operator binary, the EKS controller, which owns all add-on and Kubernetes version lifecycle work:
- Two replicas with leader election: one active controller at a time; a restarted leader resumes recorded progress instead of repeating side effects.
- Host networking (
hostNetwork: true,dnsPolicy: Default): the controller reaches the API server through the cluster endpoint and can safely upgrade the very components it depends on (the CNI and DNS it runs next to). - EKS Pod Identity: the controller's AWS access comes from a Pod Identity association created by
castctl; it uses the EKS API to discover and update add-ons. - Local-first operation: all upgrade logic runs in the cluster and works without a connection to Cast AI. The backend only receives reports, plus one optional remote switch (the kill switch).
flowchart TD
subgraph EKS[Amazon EKS cluster]
subgraph NS[castai-agent namespace]
OP[Operator Deployment<br/>manages Cast AI components]
EKSCTRL[EKS controller Deployment<br/>two replicas, leader election<br/>host networking, Pod Identity]
end
API[EKS API]
COMP[EKS add-ons and Helm components]
end
BACKEND[Cast AI backend<br/>receives reports]
EKSCTRL -->|discover and update| API
API --> COMP
EKSCTRL -->|gated upgrades| COMP
OP --> EKSCTRL
EKSCTRL -.->|reports only| BACKEND
BACKEND -.->|optional kill switch| EKSCTRL
Discovery and the compatibility catalog
The EKS controller continuously inventories the cluster's infrastructure components:
- Every EKS add-on installed in the cluster is discovered and recorded as a
ManagedAddonresource, created in Observe mode. - Versions and compatibility come from the EKS API (
DescribeAddonVersionsand related calls), combined with a curated list bundled with the controller that records skipped versions and known bad releases. - For each component the controller reports:
- the installed version
- the latest compatible version for the current Kubernetes minor and the next one
- component health
BlocksNextUpgrade, whether the component's current state would block a Kubernetes version upgrade
EKS API calls are cached, so a large cluster does not generate excessive AWS traffic.
The ManagedAddon and AddonUpgrade objects
Four cluster-scoped Kubernetes resources drive the feature:
| Resource | Purpose |
|---|---|
ManagedAddon | One per component. Its spec holds the customer's intent: the mode (Observe or Managed), the target version, and the automatic upgrade policy. Its status holds the observed state: installed version, latest compatible versions, health, BlocksNextUpgrade, and who manages the component. |
AddonUpgrade | One per upgrade attempt. Records what changed (from → to version), which phase the attempt is in, each gate's result, and the rollback reason if it failed. |
ClusterUpgradePolicy | One per cluster, named cluster. Turns automatic control plane upgrades on and holds the update window shared with Managed add-ons. |
ClusterUpgrade | One per Kubernetes version upgrade. Records the preflight results and each step: control plane, add-ons, and node groups. |
A console change and a manual change to the ManagedAddon spec follow exactly the same path: the controller reconciles the spec into an AddonUpgrade attempt.
Upgrade flow
When a Managed add-on's spec changes (or an automatic policy moves the target version), the controller runs the same gated flow every time:
flowchart TD
A[Record intent<br/>AddonUpgrade created] --> B[Snapshot current state]
B --> C[Preflight checks<br/>component active, workloads ready]
C --> D[Upgrade<br/>EKS UpdateAddon with PRESERVE<br/>to exactly the target version]
D --> E[Wait for rollout]
E --> F[Runtime health gates<br/>probe pods]
F -->|pass| G[Promote]
F -->|fail| R[Automatic rollback<br/>to the previous version]
Health gates
| Gate | What it validates |
|---|---|
AddonActive | EKS reports the add-on as ACTIVE after the update (UPDATE_FAILED fails the gate) |
WorkloadsReady | The add-on's own DaemonSets and Deployments (for example aws-node for vpc-cni, coredns for CoreDNS) have rolled out: every pod updated and available. Other workloads in the cluster are not checked |
PodNetwork | A probe pod gets an IP and can reach other pods (protects the VPC CNI) |
ClusterIPService | A probe pod can reach a ClusterIP service (protects kube-proxy) |
DNSResolves | A probe pod resolves internal and external names (protects CoreDNS) |
VolumeProvisions | A PVC on the ebs.csi.aws.com StorageClass provisions, mounts, reads and writes, and deletes cleanly (protects the EBS CSI driver) |
Each probe is a short-lived pod labeled and owned by the controller, and leftovers are swept after a restart. A failed gate rolls the component back to its previous version and the rollback itself is re-validated by the gates.
One upgrade at a time
Multiple upgrades can be discovered and planned at the same time, but only one add-on upgrade executes per cluster at any moment. If an EKS update stays InProgress beyond a configurable limit (20 minutes by default), the attempt fails and records the reason and the EKS update ID. No rollback is attempted, because EKS rejects a second update while one is running.
IAM role preservation
The controller sends the add-on's current IRSA role (serviceAccountRoleArn) with every update. Without this, EKS drops the role from components such as aws-node, which then silently fall back to the node's IAM role. Configuration-only changes (no version change) are also supported.
Ownership: what AutoLifecycle never touches
Before modifying a component, the controller determines who manages it:
-
GitOps detection: components managed by Argo CD or Flux are detected and reported as read-only.
-
Hands-off annotation: adding
castware.cast.ai/hands-off: "true"to a component marks it as customer-owned:metadata: annotations: castware.cast.ai/hands-off: "true" -
Admission webhook: a validating webhook (with no network calls, failing closed) refuses changes to GitOps-owned or hands-off components.
An add-on reported as managedBy: unknown is shown with a warning in the console: it may be managed by tooling outside the cluster, such as Terraform.
Helm components: Load Balancer Controller and Karpenter
Two components are not EKS add-ons and are managed through a shared Helm path, reconciled by the main Operator Deployment:
- AWS Load Balancer Controller: new versions sometimes require new AWS permissions; without them, load balancers quietly stop working. Before upgrading, the EKS controller runs
iam:SimulatePrincipalPolicyagainst the controller's role for the target version and refuses the upgrade until the check passes, naming the missing permission. - Karpenter (
castai-karpenter): installed from scratch and upgraded withSkipCRDs, with a compatibility gate against the Karpenter minor supported by Kentroller. AutoLifecycle refuses to manage a Karpenter it did not install, stops on a foreigncapacitybuffersCRD, and warns when cluster-autoscaler is running. CAST's Karpenter runs in theCAST_MANAGEDmode, alongside the upstreamSELF_HOSTEDandMANAGED_OUT_OF_BANDmodes.
Helm upgrades use the same restart-safe rollback as EKS add-ons, with their own gates: WorkloadsReady plus WebhookEndpoints and LoadBalancersReconciled for the Load Balancer Controller, or CRDsEstablished for Karpenter. They support values-only upgrades, and the Load Balancer Controller's CRDs are applied before its chart.
Reporting to Cast AI
The controller reports every ManagedAddon and AddonUpgrade to Cast AI, so the console can show the add-on list, the latest compatible versions, upgrade history with gate results, and rollback reasons. Nothing in the reconcile or upgrade path waits on the backend: if the connection to Cast AI is lost, in-cluster operation continues and reports catch up later.
Next steps
Updated 13 hours ago
