OC-ADM-POLICY-SCC-REVIEW(1)

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

✨ 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.serviceAccountName gets completely ignored. like, not even a text back. πŸ’€

πŸ’– OPTIONS πŸ’–

  • --allow-missing-template-keys=true β€” if true, it just ignores any errors in templates when a field or map key is missing in the template. ngl this only applies to the golang and jsonpath output 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 -f or -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, --filename recursively. 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 β€” if true, keep the managedFields when 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 β€” 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. ⚠️ 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 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 🌸
  • --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