OC-SET-SERVICEACCOUNT(1)
OC SET SERVICEACCOUNT(1) β¨π
okay so bestie, you know that one June 2016 classic? the Openshift CLI User Manuals moment? we're diving into oc set serviceaccount and it's literally giving "let me fix your service account situation" and honestly? iconic. π
π NAME π
oc set serviceaccount β the glow-up your resource's service account has been waiting for, fr fr. We're updating the ServiceAccount of a resource and slaying while doing it. π
π¦ SYNOPSIS π¦
oc set serviceaccount [OPTIONS]
πΈ DESCRIPTION πΈ
So like, the whole vibe here is: you take pod template resources and you update their ServiceAccount. That's it. That's the whole thing. It's giving "little command, big impact" energy and honestly we're obsessed. β¨
π OPTIONS π
okay the options list is lengthening but we're gonna get through it together, bestie. stay hydrated. π
--all=falseβ select all the resources out there in the namespace of whatever resource types you specified. the whole entire roster. no cap.--allow-missing-template-keys=trueβ if this is true, we literally just ignore any errors in templates when a field or map key is missing from the template. only applies togolangandjsonpathoutput formats though β iykyk.--dry-run="none"β must be"none","server", or"client". if it's client strategy, you only print the object that would be sent without actually sending it (a preview moment β¨). if it's server strategy, you submit the server-side request without persisting the resource. very "look but don't touch."--field-manager="kubectl-set"β the name of the manager used to track field ownership. very main character of it.-f,--filename=[]β filename, directory, or URL to files that identify the resource to get from a server. multiple values?? yeah bestie, it's a list.-k,--kustomize=""β process the kustomization directory. π important: this flag can't be used together with-for-R. they're mutually exclusive, it's giving "pick a lane."--local=falseβ if true,set serviceaccountwill NOT contact the api-server and will just run locally. introvert mode activated. π-o,--output=""β output format! one of:json,yaml,kyaml,name,go-template,go-template-file,template,templatefile,jsonpath,jsonpath-as-json,jsonpath-file. so many choices, we love options.-R,--recursive=falseβ process the directory used in-f,--filenamerecursively. useful when you want to manage related manifests organized within the same directory β like, keep the whole squad together.--show-managed-fields=falseβ if true, keep themanagedFieldswhen printing objects in JSON or YAML format. extra info, extra vibes.--template=""β template string or path to a template file to use when-o=go-templateor-o=go-template-file. the template format is golang templates [ β¨http://golang.org/pkg/text/template/#pkg-overviewβ© ]. fancy.
π OPTIONS INHERITED FROM PARENT COMMANDS π
these are the flags you got from your parents, bestie. passed down like a family heirloom. π«Ά
--as=""β username to impersonate for the operation. user could be a regular user or a service account in a namespace. dramatic entrance energy.--as-group=[]β group to impersonate for the operation. this flag can be repeated to specify multiple groups. stack 'em.--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β user extras to impersonate for the operation. can be repeated to specify multiple values for the same key.--cache-dir="/homeless-shelter/.kube/cache"β default cache directory. home sweet home.--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. uncompressed and unbothered.--insecure-skip-tls-verify=falseβ if true, the server's certificate will not be checked for validity.
β οΈ heads up bestie: this makes your HTTPS connections insecure. like, no cap, actually insecure. proceed with caution, okay? π
--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 exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off.--match-server-version=falseβ require server version to match client version. they have to match, it's giving soulmate energy.-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 (like1s,2m,3h). a value of zero means don't timeout requests. patient queen behavior.-s,--server=""β the address and port of the Kubernetes API server.--tls-server-name=""β server name to use for server certificate validation. if it's 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. no warnings allowed, we're strict now. π₯
π EXAMPLE π
look at these examples, they're literally serving. copy them exactly, bestie:
# Set deployment nginx-deployment's service account to serviceaccount1
oc set serviceaccount deployment nginx-deployment serviceaccount1
# Print the result (in YAML format) of updated nginx deployment with service account from a local file, without hitting the API server
oc set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run -o yaml
the second one is giving "preview mode, no API calls" and we respect the efficiency. β¨
π§ SEE ALSO π§
oc-set(1), β go check out the whole oc set family, they're all iconic in their own way.
β HISTORY β
June 2016, Ported from the Kubernetes man-doc generator. a vintage moment, honestly. π
okay that's the whole page, bestie! you're now fully caught up on oc set serviceaccount and honestly? you're gonna slay. this was brought to you by Openshift and the Openshift CLI User Manuals, dated June 2016 β love that for us. now go update those service accounts, periodt. ππ¦β¨πΈ
π¦ 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