Skip to main content

How do we give a CI pipeline headless access to the management cluster?

Syself support For release

To give a CI/CD pipeline a kubeconfig without browser login, use the gitops-sa-secret ServiceAccount token that already exists in your namespace on the management cluster. The token replaces the OIDC browser login, so it works in GitHub Actions, GitLab CI, Argo CD and on servers without a browser.

The token is limited to your organization's namespace:

  • It creates, changes and deletes Cluster and HetznerBareMetalHost objects.
  • It reads the other Cluster API objects and the Secrets in the namespace, including each cluster's admin kubeconfig.
  • It cannot create or change Secrets. Create those with a user who has the admin role.

The token does not expire, so store it like a password. Reading the Secret needs the admin role. To rotate the token, delete the gitops-sa-secret Secret. The old token stops working, and a new one is issued in its place. Then rebuild the kubeconfig in your pipelines.

Copy the command that builds the kubeconfig from Headless access for pipelines. To manage your clusters from Git with it, continue with Introduction to GitOps or go straight to Set up Argo CD.

The token is for pipelines. People on your team keep logging in through the browser, as described in How do I access the management cluster?

Still stuck?

Prepare your case, then email us.