Registering Kubernetes Clusters
Shoehorn discovers Kubernetes workloads through a lightweight agent in each cluster. This guide covers registering a cluster and deploying the agent.
Overview
Section titled “Overview”- Register the cluster in Shoehorn. This creates the cluster’s agent token.
- Deploy the K8s agent to the cluster with that token.
- The agent watches workloads and pushes them to Shoehorn.
- Shoehorn creates catalog entities for them.
Register via UI
Section titled “Register via UI”- Go to Admin > Integrations > Clusters.
- Click Register Cluster.
- Fill in:
- Cluster Name: the label shown in the UI, such as
Production EU. - Cluster ID: a short slug for the agent install, such as
prod-eu. Lowercase letters, numbers and hyphens. Each ID can be registered once in a Shoehorn installation, so if it’s taken, pick another. - Description: optional notes.
- Token Expiration (days): leave it empty for a token that doesn’t expire.
- Cluster Name: the label shown in the UI, such as
- Click Register.
- Copy the agent token. It’s shown only once. The dialog also gives you a ready-made Helm command for the cluster.
Register via API
Section titled “Register via API”Use an API key with the k8s-agents:create scope (k8s-agents:write and k8s-agents:admin also work):
curl -X POST https://shoehorn.example.com/api/v1/k8s/agents/register \ -H "Authorization: Bearer <your-api-key>" \ -H "Content-Type: application/json" \ -d '{ "clusterId": "prod-eu", "name": "Production EU", "description": "Production cluster in EU", "expiresIn": 90 }'expiresIn is in days. Leave it out for a token that doesn’t expire.
Response (201 Created):
{ "token": "sha_xxxxxxxxxxxxxxxxxxxx", "tokenPrefix": "sha_xxxx", "clusterId": "prod-eu", "name": "Production EU", "expiresAt": "2027-02-24T10:00:00Z", "createdAt": "2026-11-26T10:00:00Z"}The API answers 409 when the cluster ID is already registered, and 402 when your license has no room for another cluster. The Terraform provider’s shoehorn_k8s_agent resource registers clusters the same way.
Deploy the Agent
Section titled “Deploy the Agent”See Deploying the K8s Agent for the full Helm installation.
Quick install:
helm install shoehorn-k8s-agent oci://ghcr.io/shoehorn-dev/helm-charts/shoehorn-k8s-agent \ --namespace shoehorn --create-namespace \ --set shoehorn.apiURL=https://shoehorn.example.com \ --set shoehorn.apiToken=sha_xxxxxxxxxxxxxxxxxxxx \ --set shoehorn.cluster.id=prod-eu \ --set shoehorn.cluster.name="Production EU" \ --waitAgent Status
Section titled “Agent Status”The agent sends a heartbeat while it runs. Admin > Integrations > Clusters shows each cluster’s status from the last one:
| Status | Meaning |
|---|---|
| Online | Last heartbeat under 8 minutes ago |
| Degraded | Last heartbeat 8 to 15 minutes ago |
| Offline | No heartbeat for 15 minutes or more |
| Unknown | No heartbeat yet, usually because the agent isn’t deployed |
Namespace Filtering
Section titled “Namespace Filtering”By default, the agent watches all namespaces. To leave some out, set agent.kubernetes.excludeNamespaces in the agent’s Helm values:
agent: kubernetes: excludeNamespaces: - kube-public - kube-node-leaseThe Infrastructure tab finds cluster software such as Cilium, cert-manager, Argo CD and Flux among the workloads the agent watches. Excluding kube-system, cert-manager, argocd or flux-system hides that software there.
Entity Auto-Creation
Section titled “Entity Auto-Creation”When the agent discovers a workload, Shoehorn:
- Creates a catalog entity if one doesn’t exist.
- Sets the entity type from the workload kind, or from the
shoehorn.dev/typeannotation. - Reads metadata from annotations (see Annotations Reference).
- Works out the lifecycle stage from the namespace name.
- Tags the entity with the cluster it came from and links the two.
Lifecycle Detection from Namespace
Section titled “Lifecycle Detection from Namespace”Without a shoehorn.dev/lifecycle annotation, the namespace name decides:
| Namespace | Lifecycle |
|---|---|
kube-system, argocd, flux-system and other system namespaces |
experimental |
Contains prod, such as prod-eu or checkout-prod |
production |
Contains stage or staging |
staging |
Contains dev |
development |
| Anything else | experimental |
Managing Clusters
Section titled “Managing Clusters”Each cluster row in Admin > Integrations > Clusters has an actions menu.
Rotate Agent Token
Section titled “Rotate Agent Token”If a token leaks:
- Open the cluster’s actions menu and choose Rotate token.
- Copy the new token. The old one stops working right away.
- Update the agent’s token in the cluster, for example with
helm upgrade --reuse-values --set shoehorn.apiToken=<new token>, or by updating the Secret named inshoehorn.existingSecret.
Revoke token in the same menu turns the token off without giving the cluster a new one.
Remove a Cluster
Section titled “Remove a Cluster”- Uninstall the agent from the cluster.
- Open the cluster’s actions menu and choose Delete cluster.
Deleting a cluster removes its workloads from Shoehorn. Catalog entities that no longer run in any cluster are removed with them.
Multiple Clusters
Section titled “Multiple Clusters”Register each cluster separately, one ID per cluster. Pick IDs that read well in the UI:
prod-usprod-eustagingdevEach agent pushes on its own. Entities are tagged with their source cluster for filtering.