🔑Cluster Admin Access
Every context in
~/.kube/configauthenticates with a short-lived token minted on demand, not with a stored credential.kubectlrunskube-jit-token, which asks the control plane for an eight-hour ServiceAccount token and hands it back; kubectl caches it until it is nearly expired and then asks again. Nothing long-lived is written to the workstation.Get a kubeconfig
update-kubeconfigsIt fetches each cluster's CA and API server address over ssh, points the context at the JIT credential, and keeps the fetched
cluster-admincertificate beside it as<cluster>-breakglass. It backs up the existing file first.The identity behind the token is the
operatorServiceAccount inkube-system, declared inclusters/base/operator-rbac.yamland bound to thecluster-adminClusterRole on both clusters.
When the token path is broken
kubectl --context folly --user folly-breakglass get nodesThe break-glass user is the
O=system:masterscertificate the control plane issues to itself. X.509 is a separate authenticator from the token chain, so it keeps working when the ServiceAccount, its binding, or the TokenRequest path is what is broken. It is not the daily driver because the apiserver cannot revoke a certificate and RBAC cannot boundsystem:masters.If that certificate has expired too,
update-kubeconfigsfetches a fresh one — certmgr renews the host's copy 72 hours before it lapses, checking hourly.The last resort is the control plane itself:
ssh optiplex.lolwtf.ca(folly) orssh retrofit.lolwtf.ca(offsite), thensudo kubectl.
Withdraw access
kubectl delete clusterrolebinding operatorTokens already minted stay valid for the rest of their eight hours, but authorization is checked per request, so the binding going away stops them. Deleting the ServiceAccount invalidates them outright —
--service-account-lookupdefaults on, so the apiserver checks that the account still exists on every request.This is the thing the old arrangement could not do. A
system:masterscertificate is unrevokable: the apiserver supports no CRL and no OCSP, so the only way to withdraw one is to rotate the cluster CA and every leaf under it.
How it is put together
dotfiles/.local/bin/kube-jit-tokenis the credential plugin. It takes a control-plane host, a ServiceAccount, a namespace and a TTL, mints throughkubectl create tokenover ssh, and prints anExecCredential. The apiserver refuses a TTL under ten minutes.The credential that actually reaches the cluster is ssh, which is already the operator's root of trust and is already revocable. A stolen laptop with no ssh key mints nothing.
clusters/base/operator-rbac.yamlis the identity, applied to both clusters through Architecture/GitOps. See Architecture/Secrets and PKI for the certificate chain the break-glass user rides on.
Linked references 1
Runbooks/Cluster Admin Access — JIT tokens for day-to-day kubectl, the break-glass certificate, and how to withdraw access