glab(1)

πŸ’… glab-cluster-agent-update-kubeconfig β€” glab(1)

okay bestie, welcome to the glab(1) manual β€” or at least the one page of it that's about to change your whole Kubernetes-adjacent life 🫢


✨ NAME ✨

glab-cluster-agent-update-kubeconfig β€” the glow-up your kubeconfig has been waiting for: it updates it so it plays nice with a GitLab Agent for Kubernetes ✨


πŸŽ€ SYNOPSIS πŸŽ€

glab cluster agent update-kubeconfig [flags]

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically this command configures kubectl to authenticate through the GitLab Agent for Kubernetes, and it does it using an exec credential plugin. No cap, that's the whole vibe. πŸ”₯

Here's the little rundown of the knobs you can twiddle:

  • Use --agent to specify the agent by its numeric ID.
  • Use --use-context to set the agent as the default kubectl context.
  • Use --token-expiry-duration to control how long the generated token is valid.
  • Use --cache-mode to control how generated tokens are cached.

That's it, that's the whole menu of main-character decisions πŸ’…


🌸 OPTIONS 🌸

  • -a, --agent=0 β€” the numeric agent ID you're creating this kubeconfig entry for. it defaults to 0, which is lowkey just a placeholder, so go ahead and actually give it an ID πŸ™ˆ
  • -c, --cache-mode="force-keyring" β€” the mode used for caching the token. allowed values are: keyring-filesystem-fallback, force-keyring, force-filesystem, no. default is force-keyring, and yes, the no is literally a valid value, it's giving "none of the above" πŸ’€
  • --check-revoked[=false] β€” checks whether a cached token is revoked. heads up though: this requires an API call to GitLab, which adds latency every single time a cached token is accessed 😭 so like, know what you're signing up for.
  • --kubeconfig="" β€” use a particular kubeconfig file. empty by default.
  • --token-expiry-duration=24h0m0s β€” how long the generated token stays valid. minimum is 1 day. it also expires at the end of the day and ignores time. so, like, 24h0m0s is the default and also basically the floor πŸ•
  • -u, --use-context[=false] β€” use this as the default context. very "set it and forget it" of you πŸ‘‘

πŸ’œ OPTIONS INHERITED FROM PARENT COMMANDS πŸ’œ

  • -h, --help[=false] β€” show help for this command. the classic. the icon. the moment of "wait what does this do again" πŸŽ€
  • -R, --repo="" β€” select another repository. you can use either OWNER/REPO or GROUP/NAMESPACE/REPO. the full URL or Git URL is also accepted. flexible queen behavior 🌈

⭐ EXAMPLE ⭐

some inspo for you, bestie:

# Update kubeconfig for agent 123
glab cluster agent update-kubeconfig --agent 123

# Update kubeconfig and set as the default context
glab cluster agent update-kubeconfig --agent 123 --use-context

first one: just the basics, cute. second one: you're setting it as the default context too, which is giving main character energy πŸ‘‘


🧚 SEE ALSO 🧚


okay that's the whole page, bestie πŸ’… no notes, ate and left no crumbs.

sign-off szn: this beauty was auto generated by spf13/cobra ✨ (yes, the cobra did the typing for us), dated Nov 2026, and it belongs to the glab(1) manual. periodt πŸŒˆπŸ’œ

glab(1)

πŸ“¦ where this page comes from