OC-ADM-POLICY-ADD-SCC-TO-USER(1)

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

πŸ’… oc adm policy add-scc-to-user

okay bestie, welcome to the oc adm policy add-scc-to-user page β€” this is from the Openshift CLI User Manuals and it's gonna be SO good, i promise 🫢


✨ NAME

oc adm policy add-scc-to-user β€” hand a security context constraint to users or to a service account. that's the whole vibe. πŸ’«


πŸŽ€ SYNOPSIS

oc adm policy add-scc-to-user [OPTIONS]

🌸 DESCRIPTION

Add a security context constraint to users or a service account.

like... literally what it says. you got a security context constraint, you got some users (or a service account), and this command is the matchmaker πŸ’–


πŸ¦‹ OPTIONS

  • --allow-missing-template-keys=true β€” set this to true and any errors in templates (missing field or missing map key in the template) just get ignored, no drama. heads up tho: it only applies to golang and jsonpath output formats. periodt.
  • --dry-run="none" β€” must be "none", "server", or "client". if it's the client strategy, it only prints the object that would be sent β€” no sending, just peeking πŸ‘€. if it's the server strategy, it submits a server-side request without actually persisting the resource. no cap.
  • -o, --output="" β€” the output format, bestie. one of: json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file.
  • -z, --serviceaccount=[] β€” service account in the current namespace to use as a user. yup, the current namespace. 🌈
  • --show-managed-fields=false β€” if true, keep the managedFields when printing objects in JSON or YAML format.
  • --template="" β€” template string, or path to a template file, used when you're doing -o=go-template or -o=go-template-file. the template format is golang templates [ http://golang.org/pkg/text/template/#pkg-overview ]. iykyk 🧚

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS

these are the heirlooms, the hand-me-downs, the main character options you get for free πŸ’œ

  • --as="" β€” username to impersonate for the operation. can be a regular user or a service account in a namespace.
  • --as-group=[] β€” group to impersonate for the operation. repeatable, so you can specify multiple groups fr fr.
  • --as-uid="" β€” UID to impersonate for the operation.
  • --as-user-extra=[] β€” user extras to impersonate for the operation. also repeatable, so you can specify multiple values for the same key.
  • --cache-dir="/homeless-shelter/.kube/cache" β€” default cache directory. that path is not a typo, that's literally it 😭
  • --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. ⚠️ bestie this makes your HTTPS connections insecure, so like... know that going in.
  • --kubeconfig="" β€” path to the kubeconfig file to use for CLI requests.
  • --kuberc="" β€” path to the kuberc file to use for preferences. you can disable this by exporting the KUBECTL_KUBERC=false feature gate, or by turning off the feature with KUBERC=off.
  • --match-server-version=false β€” require the server version to match the client version.
  • -n, --namespace="" β€” if present, the namespace scope for this CLI request.
  • --profile="none" β€” name of the 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" β€” how long 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. give it zero and it'll wait forever, iconic but risky πŸ™ˆ
  • -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. stern but slay πŸ’€

⭐ EXAMPLE

# Add the 'restricted' security context constraint to user1 and user2
oc adm policy add-scc-to-user restricted user1 user2

# Add the 'privileged' security context constraint to serviceaccount1 in the current namespace
oc adm policy add-scc-to-user privileged -z serviceaccount1

see how clean that is?? two users, one line. service account, one -z. ate. πŸ”₯


🌈 SEE ALSO

oc-adm-policy(1)


πŸ“ HISTORY

June 2016, Ported from the Kubernetes man-doc generator.


okay that's the whole page bestie, you're officially educated πŸ’…βœ¨ this was OpenShift / Openshift CLI User Manuals, dated June 2016 β€” now go add some security context constraints and be the main character of your cluster πŸ‘‘πŸ«Ά

πŸ“¦ where this page comes from