OC-ADM-POLICY-SCC-REVIEW(1)
β¨ OC-ADM-POLICY-SCC-REVIEW(1) β¨
okay so bestie, welcome to the oc adm policy scc-review man page π
this one lives in the Openshift CLI User Manuals section of the man pages (section 1, iykyk), and it's genuinely one of the most useful little vibe-checks in the whole oc adm policy family. let's get into it π«Ά
πΈ NAME πΈ
oc adm policy scc-review β check which service account can create a pod β¨
π¦ SYNOPSIS π¦
oc adm policy scc-review [OPTIONS]
that's it. that's the whole thing. no positional args, just vibes and flags π
π DESCRIPTION π
so what this icon actually does: it checks which service account can create a pod. π
the pod in question is inferred from the pod template spec inside the resource you hand it. and here's the debit-card-slide on service accounts, listen closely:
- if you don't provide a service account, it uses the one specified in
podTemplateSpec.spec.serviceAccountNameβ¨ - unless that's empty β in which case it falls back to
"default"(the main character of service accounts, lowkey) π - and if you do provide service accounts, then
podTemplateSpec.spec.serviceAccountNamegets completely ignored. like, not even a text back. π
π OPTIONS π
--allow-missing-template-keys=trueβ iftrue, it just ignores any errors in templates when a field or map key is missing in the template. ngl this only applies to thegolangandjsonpathoutput formats, so don't come for it elsewhere π§-f,--filename=[]β filename, directory, or URL to files. (and yes, the original literally says "Filename, directory, or URL to files Filename, directory, or URL to a file identifying the resource to get from a server" β that's a file identifying the resource to get from a server, bestie, we don't gatekeep π)-k,--kustomize=""β process the kustomization directory. periodt. but heads up: this flag can't be used together with-for-Rβ οΈ pick a lane π--no-headers=falseβ when using the default output format, don't print headers (default is to print headers, so like, headers are the default bestie)-o,--output=""β output format, one of: (json,yaml,kyaml,name,go-template,go-template-file,template,templatefile,jsonpath,jsonpath-as-json,jsonpath-file). pick your fighter β-R,--recursive=falseβ process the directory used in-f,--filenamerecursively. super useful when you want to manage related manifests organized within the same directory π¦-z,--serviceaccount=[]β service account in the current namespace to use as a user π--show-managed-fields=falseβ iftrue, keep themanagedFieldswhen printing objects in JSON or YAML format (they're usually shy and get hidden) π--template=""β template string or path to template file to use when-o=go-template,-o=go-template-file. the template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview] π₯
π OPTIONS INHERITED FROM PARENT COMMANDS π
these are the flags that come down from the parent commands, like hand-me-downs but make it Kubernetes π
--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 (yes, repeat it, she's flexible β¨)--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 (yes that path is real, don't ask π)--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β iftrue, opt-out of response compression for all requests to the server--insecure-skip-tls-verify=falseβ iftrue, the server's certificate will not be checked for validity. β οΈ this will make your HTTPS connections insecure β like, actually insecure, no cap, be careful with 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 exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=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 π€
β EXAMPLE β
okay here's where it gets good, the examples ate and left no crumbs π₯
# Check whether service accounts sa1 and sa2 can admit a pod with a template pod spec specified in my_resource.yaml
# Service Account specified in myresource.yaml file is ignored
oc adm policy scc-review -z sa1,sa2 -f my_resource.yaml
# Check whether service accounts system:serviceaccount:bob:default can admit a pod with a template pod spec specified in my_resource.yaml
oc adm policy scc-review -z system:serviceaccount:bob:default -f my_resource.yaml
# Check whether the service account specified in my_resource_with_sa.yaml can admit the pod
oc adm policy scc-review -f my_resource_with_sa.yaml
# Check whether the default service account can admit the pod; default is taken since no service account is defined in myresource_with_no_sa.yaml
oc adm policy scc-review -f myresource_with_no_sa.yaml
see how -z slays? when you pass -z, whatever's in the file gets ignored β main character behavior only π
π«Ά SEE ALSO π«Ά
go read the parent, she's iconic π
π HISTORY π
June 2016 β ported from the Kubernetes man-doc generator β¨ so this page is a certified vintage, a real 2016 tumblr-era baddie π
and that's the page, bestie! brought to you by the man page header OC ADM POLICY(1), dated June 2016, from the Openshift CLI User Manuals β courtesy of Openshift, June 2016, Ported from the Kubernetes man-doc generator. now go check some service accounts, you got this πππ
π¦ 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