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
--agentto specify the agent by its numeric ID. - Use
--use-contextto set the agent as the defaultkubectlcontext. - Use
--token-expiry-durationto control how long the generated token is valid. - Use
--cache-modeto 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 to0, 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 isforce-keyring, and yes, thenois 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,24h0m0sis 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 eitherOWNER/REPOorGROUP/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 π§
glab-cluster-agent(1)β go read the parent page, iykyk π
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 ππ
π¦ where this page comes from
- arch rolling: glab 1.128.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms