OC-SERVICEACCOUNTS-GET-TOKEN(1)

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

πŸ’… OC SERVICEACCOUNTS(1) β€” like, the oc serviceaccounts get-token glow-up

okay bestie, welcome to the OpenShift CLI User Manuals corner of the universe ✨ today's main character is oc serviceaccounts get-token, and yes she's from way back in June 2016 (vintage icon behavior πŸŽ€). let's get into it.


✨ NAME ✨

oc serviceaccounts get-token β€” literally just: get a token assigned to a service account. that's the whole job. slay πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

oc serviceaccounts get-token [OPTIONS]

🌸 DESCRIPTION 🌸

So. You want a token that's assigned to a service account? That's it, that's the vibe. oc serviceaccounts get-token gets you one. 🫢

Real talk though β€” if the service account has multiple tokens, the first token found is the one you get back. no menu, no "which one did you want", just the first one. so lowkey don't be surprised if it's not the specific one you had in mind πŸ‘€

Now, why do these tokens even exist? Service account API tokens are what service accounts use to authenticate to the API. And here's the part that matters: any client action made with a service account token gets executed as if the service account itself were making the actions. it's giving "you are what you eat" but for identity πŸ”₯ so yeah, act accordingly.


πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS πŸ‘‘

these aren't even hers, she inherited them from the parent commands, and honestly? iconic inheritance πŸ’–

  • --as="" β€” username to impersonate for the operation. this can be a regular user or a service account in a namespace. 🎭
  • --as-group=[] β€” group to impersonate for the operation. repeat this flag to specify multiple groups, fr fr.
  • --as-uid="" β€” UID to impersonate for the operation.
  • --as-user-extra=[] β€” user extras to impersonate for the operation. repeat this flag to specify multiple values for the same key. yes, repeatable, we love a flexible queen 🌈
  • --cache-dir="/homeless-shelter/.kube/cache" β€” default cache directory. that path is not a typo, that's literally the default 🏠
  • --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, and this will make your HTTPS connections insecure. ⚠️ bestie I'm begging you, know what you're doing before you flip this one.
  • --kubeconfig="" β€” path to the kubeconfig file to use for CLI requests.
  • --kuberc="" β€” path to the kuberc file to use for preferences. this can be disabled by exporting the KUBECTL_KUBERC=false feature gate, or by turning off the feature with 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). 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. ⏳
  • -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. turning vibes into consequences, love that for us πŸ’€

🌟 EXAMPLE 🌟

get the service account token from service account 'default':

# Get the service account token from service account 'default'
oc serviceaccounts get-token 'default'

no cap, that's the whole thing. copy, paste, thrive πŸ“


🧚 SEE ALSO 🧚

(the comma after it is hers, not mine, we respect the original punctuation πŸ‘‘)


πŸ’œ HISTORY πŸ’œ

June 2016, Ported from the Kubernetes man-doc generator. a true elder of the group chat 🌸


okay that's the page!! every flag, every default, every path β€” all present and accounted for, not a single crumb missing 🫢

and finally, the cute sign-off you asked for: this lil masterpiece comes to you from Openshift β€” yes, the Openshift CLI User Manuals edition of OC SERVICEACCOUNTS(1) β€” dated June 2016. stan forever, bye bestie πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from