Skip to main content

astroctl infra kubernetes access-token

Print a short-lived access token for a cluster (used by kubectl)

Synopsis​

Print a short-lived access token for a cluster managed by AstroPulse, as a Kubernetes ExecCredential (client.authentication.k8s.io/v1).

The kubeconfig that generate-kubeconfig and set-context write carries no credential: kubectl runs this command to get one, on every cluster (EKS, GKE, AKS, registered), with no cloud tool or cloud login. The token is cached and renewed shortly before it expires, until the lifetime the kubeconfig was generated with ends; then this command answers that the kubeconfig expired and you run generate-kubeconfig again. You do not need to run it yourself.

Terminal
astroctl infra kubernetes access-token [cluster-name] [flags]

Examples​

Terminal

# What kubectl runs for the cluster my-cluster
astroctl infra k8s access-token --cluster-name my-cluster

Options​

Terminal
-c, --cluster-name string cluster name
-h, --help help for access-token
-o, --output string Output format (exec-credential) (default "exec-credential")

SEE ALSO​