When a workload is created, the service account is used to find SCCs. The admission controller:
Retrieves all SCCs the service account can use (via RBAC).
Generates default values for unset security context fields from the pod spec.
Sorts candidates: highest priority first, then most restrictive first, then by name.
Validates the pod against each SCC in order — the first match wins and is recorded in the openshift.io/scc annotation. If none match, the pod is rejected.
The result: pods get the most restrictive SCC that still allows them to run.
Tip
You can pin a specific SCC to a workload by setting the openshift.io/required-scc annotation on the pod template. The SCC must exist and the service account must have use permission for it.
⚠️ Allow all service accounts to use an SCC with priority¶
Warning
This is a bad practice! Setting a high priority on a custom SCC and granting it cluster-wide causes all pods to pick it up — including platform components that may require a different SCC. This example demonstrates why priority must be used carefully.
Create a custom SCC based on nonroot-v2 but with priority: 100:
Because the priority is higher than any default SCC, the admission controller picks nonroot-v2-with-prio first. Components like machine-api-controllers and trident-operator now run under an SCC they were never designed for — potentially breaking them.