OC(1)
π
OC(1) β like, the oc config manual, bestie
okay so this is oc config from the Openshift CLI User Manuals, and yes she's serving June 2016 vintage but the lore is still immaculate. grab a matcha π΅ and let's get into it.
β¨ NAME β¨
oc config β modify kubeconfig files π
πΈ SYNOPSIS πΈ
oc config [OPTIONS]
π¦ DESCRIPTION π¦
So you wanna modify kubeconfig files? iconic. you do it with subcommands, like this:
oc config set current-context my-context
and the way it loads stuff? okay this is the part where you gotta pay attention because the loading order follows these rules, no cap:
- if the
--kubeconfigflag is set, then only that file is loaded. the flag may only be set once, and no merging takes place. that's it, that's the whole vibe, one file only π - if the
$KUBECONFIGenvironment variable is set, then it's used as a list of paths (normal path delimiting rules for your system apply, iykyk). these paths are merged. and here's the tea: when a value is modified, it's modified in the file that defines the stanza. when a value is created, it's created in the first file that exists. and if no files in the chain exist? then it creates the last file in the list. slay, it always has a plan π«Ά - otherwise,
${HOME}/.kube/configis used and no merging takes place. default behavior, lowkey the fallback queen.
π OPTIONS π
--kubeconfig=""β use a particular kubeconfig file. one specific file, your choice, very main character.
π OPTIONS INHERITED FROM PARENT COMMANDS π
these ones come from the parent command, and yes they're all here, every single one, because we do not skip π
--as=""β username to impersonate for the operation. user could be a regular user or a service account in a namespace.--as-group=[]β group to impersonate for the operation. this flag can be repeated to specify multiple groups, so go off.--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key.--cache-dir="/homeless-shelter/.kube/cache"β default cache directory. yeah that's the literal default path, don't ask, just accept π--certificate-authority=""β path to a cert file for the certificate authority.--client-certificate=""β path to a client certificate file for TLS.--client-key=""β path to a client key file for TLS.--cluster=""β the name of the kubeconfig cluster to use.--context=""β the name of the kubeconfig context to use.--disable-compression=falseβ if true, opt-out of response compression for all requests to the server.--insecure-skip-tls-verify=falseβ if true, the server's certificate will not be checked for validity. β οΈ this will make your HTTPS connections insecure β like, actually insecure, not cute-insecure. be so serious about this one.--kuberc=""β path to the kuberc file to use for preferences. this can be disabled by exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off.--match-server-version=falseβ require server version to match client version.-n,--namespace=""β if present, the namespace scope for this CLI request.--profile="none"β name of profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex). pick your fighter.--profile-output="profile.pprof"β name of the file to write the profile to.--request-timeout="0"β the length of time to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g.1s,2m,3h). a value of zero means don't timeout requests. zero is the "we'll wait forever, it's fine" option π-s,--server=""β the address and port of the Kubernetes API server.--tls-server-name=""β server name to use for server certificate validation. if it's not provided, the hostname used to contact the server is used.--token=""β bearer token for authentication to the API server.--user=""β the name of the kubeconfig user to use.--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code. harsh but fair π
π§ SEE ALSO π§
the whole friend group, fr fr:
oc(1), oc-config-current-context(1), oc-config-delete-cluster(1), oc-config-delete-context(1), oc-config-delete-user(1), oc-config-get-clusters(1), oc-config-get-contexts(1), oc-config-get-users(1), oc-config-new-admin-kubeconfig(1), oc-config-new-kubelet-bootstrap-kubeconfig(1), oc-config-refresh-ca-bundle(1), oc-config-rename-context(1), oc-config-set(1), oc-config-set-cluster(1), oc-config-set-context(1), oc-config-set-credentials(1), oc-config-unset(1), oc-config-use-context(1), oc-config-view(1),
β HISTORY β
June 2016, ported from the Kubernetes man-doc generator. a classic, an elder, we respect her π
okay that's the whole page bestie, go forth and configure πβ¨
source/version: Openshift β Openshift CLI User Manuals β dated June 2016. mwah, that's the sign-off, love u, bye! ππ
π¦ where this page comes from
- nixpkgs unstable: openshift 4.22.0-202605222050
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms