OC-SERVICEACCOUNTS-GET-TOKEN(1)
π
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 theKUBECTL_KUBERC=falsefeature gate, or by turning off the feature withKUBERC=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
- 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