This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.12.6. Security context constraints reference commands
You can manage SCCs in your instance as normal API objects using the CLI.
You must have cluster-admin
privileges to manage SCCs.
Do not modify the default SCCs. Customizing the default SCCs can lead to issues when upgrading. Instead, create new SCCs.
12.6.1. Listing SCCs 复制链接链接已复制到粘贴板!
To get a current list of SCCs:
oc get scc
$ oc get scc
Example output
12.6.2. Examining an SCC 复制链接链接已复制到粘贴板!
You can view information about a particular SCC, including which users, service accounts, and groups the SCC is applied to.
For example, to examine the restricted
SCC:
oc describe scc restricted
$ oc describe scc restricted
Example output
To preserve customized SCCs during upgrades, do not edit settings on the default SCCs.
12.6.3. Deleting an SCC 复制链接链接已复制到粘贴板!
To delete an SCC:
oc delete scc <scc_name>
$ oc delete scc <scc_name>
If you delete a default SCC, it will regenerate when you restart the cluster.
12.6.4. Updating an SCC 复制链接链接已复制到粘贴板!
To update an existing SCC:
oc edit scc <scc_name>
$ oc edit scc <scc_name>
To preserve customized SCCs during upgrades, do not edit settings on the default SCCs.