KUBERNETES(1)(kubernetes)

πŸ“¦
version 1.37.2 Β· 5 versions
, in arch rolling, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ KUBERNETES(1)(kubernetes) β€” the kubectl config set-cluster era ✨

okay bestie, pull up a chair, we're reading a kubectl manual page together and honestly? it's giving essential. this one lives in the kubernetes manual, section 1, and it was penned by Eric Paris back in Jan 2015. yes, that Eric Paris. we stan a legend. πŸ’–


🌸 NAME 🌸

kubectl config set-cluster β€” Set a cluster entry in kubeconfig


πŸŽ€ SYNOPSIS πŸŽ€

kubectl config set-cluster [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

Set a cluster entry in kubeconfig.

And here's the lil plot twist that makes this whole thing chef's kiss: if you specify a name that already exists, it doesn't nuke it, bestie. it merges the new fields on top of the existing values for those fields. it's giving ✨collaborative✨. it's giving we don't overwrite, we enhance. πŸ’…


πŸ’… OPTIONS πŸ’…

  • --certificate-authority="" β€” Path to certificate-authority file for the cluster entry in kubeconfig
  • --embed-certs=false β€” embed-certs for the cluster entry in kubeconfig
  • --insecure-skip-tls-verify=false β€” insecure-skip-tls-verify for the cluster entry in kubeconfig
  • --proxy-url="" β€” proxy-url for the cluster entry in kubeconfig
  • --server="" β€” server for the cluster entry in kubeconfig
  • --tls-server-name="" β€” tls-server-name for the cluster entry in kubeconfig

🌈 OPTIONS INHERITED FROM PARENT COMMANDS 🌈

these are the family heirlooms, bestie. they come down from the parent command and they are all yours to use:

  • --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.
  • --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="/home/username/.kube/cache" β€” Default cache directory
  • --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
  • --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
  • --password="" β€” Password for basic authentication to the API server
  • --profile="none" β€” Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace)
  • --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.
  • --token="" β€” Bearer token for authentication to the API server
  • --user="" β€” The name of the kubeconfig user to use
  • --username="" β€” Username for basic authentication to the API server
  • --version=false β€” --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version
  • --warnings-as-errors=false β€” Treat warnings received from the server as errors and exit with a non-zero exit code
no cap: that --request-timeout zero thing means no timeout at all. if it hangs, it HANGS. don't be surprised. 😭

πŸ”₯ EXAMPLE πŸ”₯

# Set only the server field on the e2e cluster entry without touching other values
kubectl config set-cluster e2e --server=https://1.2.3.4

# Embed certificate authority data for the e2e cluster entry
kubectl config set-cluster e2e --embed-certs --certificate-authority=~/.kube/e2e/kubernetes.ca.crt

# Disable cert checking for the e2e cluster entry
kubectl config set-cluster e2e --insecure-skip-tls-verify=true

# Set the custom TLS server name to use for validation for the e2e cluster entry
kubectl config set-cluster e2e --tls-server-name=my-cluster-name

# Set the proxy URL for the e2e cluster entry
kubectl config set-cluster e2e --proxy-url=https://1.2.3.4

πŸ‘‘ SEE ALSO πŸ‘‘

kubectl-config(1), β€” go read the parent, bestie, it's the main character of this whole kubeconfig saga. 🫢


πŸ’œ HISTORY πŸ’œ

January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since!


and that's the tea, bestie πŸ“ this page is Manuals / User, KUBERNETES(1)(kubernetes), born January 2015 β€” and ngl, the fact that it says "hopefully they have been automatically generated since" is lowkey iconic. imagine hand-writing all these. couldn't be us. slay. βœ¨πŸ’–πŸŽ€

πŸ“¦ where this page comes from