OC-CONFIG-SET(1)
π oc config set β OC-CONFIG-SET(1) π
hiii bestie π welcome to the oc config set page, living its best life in the Openshift CLI User Manuals. this is the manual for setting one individual value inside a kubeconfig file, and yes she ate. π«Ά
πΈ NAME πΈ
oc config set β set an individual value in a kubeconfig file. that's it, that's the name, mwah. π
β¨ SYNOPSIS β¨
oc config set [OPTIONS]
π¦ DESCRIPTION π¦
okay so the whole point: set an individual value in a kubeconfig file. π
PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. map keys may not contain dots. no cap, dots are banned in map keys. π
PROPERTY_VALUE is the new value you want to set. binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used. so if you're not using that flag, base64 it, bestie. π§
if you specify an attribute name that already exists, it will merge new fields on top of existing values. it's giving "layering", not replacing. β¨
π OPTIONS π
only one option in this section, and she's lowkey iconic:
--set-raw-bytes=falseβ when writing a[]bytePROPERTY_VALUE, write the given string directly without base64 decoding. default isfalse. π«Ά
π«Ά OPTIONS INHERITED FROM PARENT COMMANDS π«Ά
okay these are inherited from the parent command β not invented by oc config set, just passed down like a group-chat forward. π
--as=""β username to impersonate for the operation. the 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. π--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. that path is literally in the default, don't come for me. π§--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. β οΈ--kubeconfig=""β use a particular kubeconfig file.--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).--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. β³-s,--server=""β the address and port of the Kubernetes API server.--tls-server-name=""β server name to use for server certificate validation. if it is 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. π
β οΈ bestie, --insecure-skip-tls-verify is literally the dangerous one: when true, your HTTPS connections are insecure because the server's certificate is not checked for validity. π
π EXAMPLE π
these examples are exactly the commands, bestie β copy them character for character:
# Set the server field on the my-cluster cluster to https://1.2.3.4
oc config set clusters.my-cluster.server https://1.2.3.4
# Set the certificate-authority-data field on the my-cluster cluster
oc config set clusters.my-cluster.certificate-authority-data $(echo "cert_data_here" | base64 -i -)
# Set the cluster field in the my-context context to my-cluster
oc config set contexts.my-context.cluster my-cluster
# Set the client-key-data field in the cluster-admin user using --set-raw-bytes option
oc config set users.cluster-admin.client-key-data cert_data_here --set-raw-bytes=true
π SEE ALSO π
oc-config(1),β go look, bestie. π
π HISTORY π
June 2016, Ported from the Kubernetes man-doc generator. periodt. π
xoxo π
from Openshift β Openshift CLI User Manuals, June 2016 edition. OC CONFIG(1) vibes, rewritten with love for you, bestie. πβ¨
π¦ 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