Implement CLI command to update kube config
Problem to solve
As a follow-up on Provide a user-based kubeconfig using the GitLa... (&6038), we would like to integrate the local cluster connections with glab
.
As a Developer, in order to access the clusters I'm authorized to reach
- I want to easily list the GitLab-cluster connections I can access
-
I want to easily update my local kubeconfig with a selected connection
- I want to create a separate personal access token for cluster access
Proposal
Implement a new glab cluster agent update-kubeconfig --agent=<agent-id>
command that updates the selected kube config file with the cluster
, user
and context
necessary to connect to the cluster of that agent.
Similar to how the aws eks update-kubeconfig
command works, see https://docs.aws.amazon.com/cli/latest/reference/eks/update-kubeconfig.html.
The user
section would make use of the authentication plugin implemented with Implement CLI command to be used as kube config... (#7297 - closed).
However, it the above issue has blockers, like Support creating a PAT with another PAT for the... (gitlab#425171 - closed) we could, in a first iteration, render a manually provided short-lived token into the kube config.