Skip to main content

astroctl infra kubernetes register agent update

Update the agent on a cluster

Synopsis​

Update the Astro agent on a cluster AstroPulse provisioned or one that is registered.

On a provisioned cluster (EKS, GKE, AKS, kOps) the agent updates through the astro-agent add-on: AstroPulse re-applies it and issues the agent a new certificate when its certificate has expired or is about to. That needs AstroPulse to reach the cluster's API, as it did when it created the cluster.

On a registered cluster the agent updates through the add-on API while it is connected. One that is neither recorded as its add-on nor connected is updated using kubectl, from a machine with access to the cluster. To give a registered cluster's agent a new certificate, register it again: 'astroctl infra k8s register -c my-cluster'.

When AstroPulse can't reach a provisioned cluster's API (a private endpoint), --local issues the agent a new certificate and applies it with your kubeconfig, from a machine that can reach the cluster. The agent uses it without a restart.

Terminal
astroctl infra kubernetes register agent update [cluster-name] [flags]

Examples​

Terminal

# Update agent to latest version
astroctl infra k8s register agent update --cluster-name my-cluster

# Dry-run: show updated manifest without applying
astroctl infra k8s register agent update --cluster-name my-cluster --dry-run

# Update using specific kubeconfig
astroctl infra k8s register agent update --cluster-name my-cluster --kubeconfig /path/to/kubeconfig

Options​

Terminal
--agent-name string Name of the registered cluster (alias for --cluster-name)
-c, --cluster-name string Name of the registered cluster
--context string Kubectl context to use
--dry-run Preview the update without applying
-h, --help help for update
--kubeconfig string Path to kubeconfig file (defaults to current context)
--local Apply the agent's renewed certificate with your kubeconfig, for a provisioned cluster whose API AstroPulse can't reach
-n, --namespace string Namespace of the agent (defaults to the registered namespace; required when none is recorded)

Options inherited from parent commands​

Terminal
-o, --output string Output format (table|json|yaml) (default "table")

SEE ALSO​