akua clusters get-credentials adds the Cluster to your kubeconfig. When kubectl needs a credential, it runs the Akua CLI, which gets a token that is valid for 15 minutes and for this Cluster only. No credential is written to your kubeconfig.
Kubernetes asks Akua about your access whenever it sees a token it has not checked in the last 10 seconds. When an owner removes your role, you lose access to the Cluster within about a minute.
Prerequisites
- The Akua CLI, signed in with
akua auth login. kubectl.- The Owner or Admin role in the Cluster’s Workspace. Both include the
cluster.clusters.get-credentialspermission, which makes you acluster-adminin the Cluster. - A hosted Cluster whose control plane is ready (see Create a cluster).
Connect
1
Add the Cluster to your kubeconfig
akua_WORKSPACE_ID_CLUSTER_NAME to the first file in KUBECONFIG, or to ~/.kube/config, and switches kubectl to it. Your other contexts stay as they are. To run it again later, for example after you move the CLI, use the same command: it replaces the entry.2
Use kubectl
kubectl auth whoami shows your user, akua:user: followed by your user ID, in the group akua:cluster-admins.How access works
Attached clusters
Akua does not run an attached cluster’s API server, soget-credentials does not apply. Use the kubeconfig you attached the cluster with (see Attach a cluster).