Skip to main content

How registration works

Registering brings a Kubernetes cluster you already run into AstroPulse: any conformant cluster, on any cloud, on-premises, at the edge or on your laptop. astroctl installs a small agent in the cluster with your own kubectl, and the agent connects out to AstroPulse. Nothing opens inbound, AstroPulse never holds a kubeconfig or token for the cluster, and the agent runs in its own namespace without touching your workloads. The walkthrough is Register a cluster you already run; this page is the reference.

Before you start​

  • kubectl with a context for the cluster, and rights to install into it.
  • astroctl installed and signed in.
  • An org admin role, and a plan that includes registered clusters.

In the console​

  1. On New cluster, choose Bring your own Kubernetes.

  2. Enter the Cluster name. The console shows the astroctl infra k8s register and astroctl infra k8s register status commands for it.

    Open zoom view

    Register cluster, Bring your own Kubernetes: the cluster name edge-01 and the register and status commands

    Register cluster, Bring your own Kubernetes: the cluster name edge-01 and the register and status commandsRegister cluster, Bring your own Kubernetes: the cluster name edge-01 and the register and status commands
  3. Run them with kubectl pointed at the cluster.

You should see​

The cluster's page reads Registered. On its Overview, the Agent line shows the connection, Connected once the agent reports, and the last check-in. While the registration has not settled, the line also shows its state and the agent's message. The Events tab streams each step as it happens.

Open zoom view

A registered cluster's Overview: Registered, the Agent line reading Connected, and the last check-in

A registered cluster's Overview: Registered, the Agent line reading Connected, and the last check-inA registered cluster's Overview: Registered, the Agent line reading Connected, and the last check-in

What register does​

astroctl infra k8s register --cluster-name my-cluster:

  1. Checks that kubectl reaches the cluster.
  2. Detects the cluster's region when it can.
  3. Fetches the agent's manifest.
  4. Makes the agent's private key on your machine, and sends AstroPulse only a signing request for it. AstroPulse returns the agent's certificate.
  5. Installs the agent, with the key and certificate in its TLS Secret.
  6. Reports the registration's state.

The agent's private key is never made, sent or stored by AstroPulse.

How the agent stays trusted​

  • Mutual TLS. Both sides check identity on every connection. AstroPulse accepts only the certificate it last issued to the cluster, and the one it replaced for 15 minutes.
  • Renewal. The agent renews its certificate before it expires: it makes a new key inside the cluster, and AstroPulse signs only a request for it. To issue a new certificate yourself, run astroctl infra k8s register --cluster-name my-cluster again.
  • One organization. A cluster that already runs another organization's agent is refused until that organization unregisters it.
  • Outbound only. The agent needs outbound HTTPS on port 443. A NetworkPolicy on the astroplatform-system namespace can block every other egress from its pods.

An agent too old to renew its certificate shows the notice Agent update required: "This cluster's agent is too old to renew its certificate. Update the agent before <time>, when its certificate expires and it can no longer connect." Update the agent before then.

Register from a manifest​

A registration is a K8sClusterRegistration manifest:

registration.yaml
apiVersion: platform.astropulse.io/v1
kind: K8sClusterRegistration
metadata:
name: my-production-cluster
spec:
region: us-west-2
labels:
env: prod
team: platform

Dry-run it first: it prints the agent manifest and registers nothing. Then apply it:

Terminal
astroctl infra k8s register -f registration.yaml --dry-run
astroctl infra k8s register -f registration.yaml

-f - reads the manifest from stdin. --dry-run, --no-install, --kubeconfig and --context apply with -f. --region, --namespace, --eks-compute-mode and --labels apply too, but the file wins: its spec.region, spec.agentNamespace and spec.provisionerConfig.eksComputeMode replace the flag, and its labels win a key both set. A field the registration does not have is ignored with a warning naming it.

Register in two teams​

When one team owns AstroPulse and another owns the cluster, register first and install later:

Terminal
# Team 1: create the registration only
astroctl infra k8s register --cluster-name prod-cluster --no-install

# Team 2: install the agent, from a machine that reaches the cluster
astroctl infra k8s register agent --cluster-name prod-cluster --context prod-k8s

To review the manifest first, astroctl infra k8s register manifest --cluster-name prod-cluster prints it. It has no TLS Secret for the agent and prints no key, and says so:

The agent's TLS Secret is not in the manifest: its key is made on the machine that installs the agent, and AstroPulse signs only a request for it. 'astroctl infra k8s register agent' installs the agent with it.
Install the agent with its Secret: astroctl infra k8s register agent --cluster-name prod-cluster

If you apply the manifest yourself, also run astroctl infra k8s register agent --cluster-name prod-cluster from a machine that reaches the cluster. It makes the key there and writes the Secret.

Update the agent​

The agent is the cluster's Astro Agent add-on. On the cluster's Update tab, its card says whether a newer version exists; Upgrade in Add-ons opens it on the Add-ons tab, where Upgrade updates it like any other add-on.

Terminal
astroctl infra k8s register agent update --cluster-name my-cluster --dry-run
astroctl infra k8s register agent update --cluster-name my-cluster

The update goes through the add-on while the agent is connected. An agent that is neither connected nor recorded as its add-on is updated with kubectl from your machine. The cluster must be registered.

AstroPulse does not upgrade a registered cluster's Kubernetes: you upgrade it where it runs.

Unregister a cluster​

  1. Open the cluster and select Unregister at the top of the page. The dialog reads Unregister Cluster: "This will disconnect the agent from this cluster. The cluster itself will not be destroyed."
  2. Choose what else to remove:
    • Also delete deployed applications from the cluster. Off by default: "your applications keep running, and AstroPulse just stops managing them."
    • Also remove the cluster from AstroPulse. Off by default: "the cluster stays listed as disconnected, with its history, so you can reconnect it." On, the cluster, its add-on records and its history are removed from AstroPulse, and you can register it again later.
  3. Type the cluster name, then select Disconnect agent, or Unregister and remove when the second box is checked.

The cluster itself is never touched. astroctl infra k8s unregister agent is the same as Disconnect agent, and astroctl infra k8s unregister is the same as Unregister and remove:

Terminal
astroctl infra k8s unregister --cluster-name my-cluster
astroctl infra k8s unregister --cluster-name my-cluster --delete-apps

Other ways in​

  • Nova: ask "how do I register my current cluster as prod-eks?" and Nova returns the astroctl command for you to run, since the agent installs with your kubectl. Ask to remove a cluster and Nova confirms the cluster with you, then returns the astroctl infra k8s unregister command; it never unregisters one on its own. Once connected, ask "is prod-eks healthy?" and Nova reads it directly.
  • SDK and API: the same operations, in the API reference.

With astroctl​

Terminal
astroctl infra k8s register --cluster-name my-cluster --labels env=prod --labels team=infra
astroctl infra k8s register status --cluster-name my-cluster
astroctl infra k8s register agent list
astroctl infra k8s progress stream my-cluster

An interrupted registration (a closed terminal, a network timeout) picks up again with astroctl infra k8s register resume --cluster-name my-cluster. Every flag: astroctl infra k8s register.

Settings​

Cluster namemetadata.nameRequired

The cluster's name in AstroPulse. Set this or spec.clusterName; if both are set they must match.

Accepts
Lowercase letters, numbers and -, starting and ending with a letter or number, up to 50 characters.
spec.region

The cloud region or zone the cluster runs in, such as us-west-2, or local outside a cloud.

Default
Detected from the kubeconfig, else local. Not detected on a dry run.
spec.agentNamespace

The namespace the agent is installed in.

Default
astroplatform-system
spec.architecture

The nodes' CPU architecture.

Accepts
amd64 or arm64.
Default
amd64
spec.kubernetesVersion

The cluster's Kubernetes version.

Accepts
A full version, MAJOR.MINOR.PATCH. A leading v, as kubectl prints it, is removed; anything else is refused before it is sent.
Default
Detected from the cluster.
spec.provisionerConfig.eksComputeMode

EKS only: how the cluster gets nodes, so add-ons that would conflict are refused.

Accepts
ManagedNodeGroups or AutoMode.
Default
Detected when possible.
spec.labels

Labels stored on the cluster, following the Kubernetes label rules.

The full schema is api.K8sClusterRegistration in the API reference.

If it's refused​

"Cluster Registration needs the <plan> plan; your organization is on <your plan>. See https://astropulse.io/pricing"
Cause
Your plan does not include registered clusters.
Fix
Upgrade your plan, then register again.
"This cluster is already registered to another organization. An admin of that organization must unregister it first, then it can be registered here."
Cause
The cluster runs another organization's agent. astroctl adds the owning organization, read from the agent on your cluster, when it can.
Fix
Switch to the owning organization with astroctl org use, unregister the cluster there, then switch back and register it.
"Cluster my-cluster is being registered, and that can't be stopped part-way. Once it finishes, you can unregister the cluster."
Cause
Cancel operation or astroctl infra k8s cancel was used while the cluster was registering.
Fix
Follow it with astroctl infra k8s progress stream my-cluster until it ends. Then fix what blocked it and register again, or unregister the cluster.

Troubleshooting​

The agent is installed but the cluster reads disconnected:

Terminal
kubectl get pods -n astroplatform-system
kubectl logs -n astroplatform-system deploy/astro-agent
astroctl infra k8s register status --cluster-name my-cluster

Register fails with a kubectl error: check the context with kubectl config current-context and kubectl cluster-info, then pass --context or --kubeconfig to register.

Next​