openshift-refresh-kubeconfig¶
Rewrite /root/cluster/auth/kubeconfig from the openshift/kubeconfig param
Refreshes the on-disk kubeconfig at /root/cluster/auth/kubeconfig by reading
the current value of openshift/kubeconfig and writing it atomically with
0600 permissions. Idempotent and safe to run repeatedly.
When to use¶
Designed to be declared as a Prerequisite of any task that needs a fresh
on-disk kubeconfig. DRP runs prerequisites before the dependent task, so the
consumer always operates against a current kubeconfig with no cron, timer,
or polling infrastructure.
Common scenarios:
- The kubeconfig has been rotated by an OpenShift operator on the cluster and the on-disk copy is stale.
openshift/kubeconfigis backed by a VaultLookupUriand the value in Vault has changed since the previous render.- Recovering from a stale kubeconfig without re-running install.
Behavior¶
- Reads
openshift/kubeconfigvia.ParamExpand. The render path auto-resolves Vault-backedLookupUrivalues through the registered plugin, so this task works for both inline-encrypted and Vault-backed storage shapes. - Refuses to overwrite the on-disk file when the rendered value is empty or
null(e.g., a Vault read returned no value). Surfaces a clear error rather than corrupting the on-disk kubeconfig. - Writes atomically: tempfile in the target directory, then
rename(2)over/root/cluster/auth/kubeconfig. - Sets
0700on the parent directory and0600on the kubeconfig itself.
Objects that Reference openshift-refresh-kubeconfig¶
Not used in current content packs
Objects used by openshift-refresh-kubeconfig¶
- templates openshift-refresh-kubeconfig.sh.tmpl in field Templates[0].ID as value openshift-refresh-kubeconfig.sh.tmpl