OC-CONFIG-SET(1)

πŸ“¦
version 4.22.0 Β· 2 versions
, in nixpkgs unstable

πŸŽ€ 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 []byte PROPERTY_VALUE, write the given string directly without base64 decoding. default is false. 🫢

🫢 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 exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=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 πŸ‘€

πŸ“œ 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