如本文所述,我想minishift
从 Docker Hub运行一个容器。由于 Docker Hub 中的映像以 root 身份运行且 OpenShift 不允许以 root 身份运行容器,因此我使用此命令来覆盖此约束。我以.root
system:admin
oc adm policy add-scc-to-user anyuid -z default
但是,我不断收到此错误:
Error from server (NotFound): the server could not find the requested resource
首先,不清楚,缺少哪个资源,其次,覆盖是否适用minishift
?anyuid
SCC 确实存在。
oc get scc
NAME KIND
anyuid SecurityContextConstraints.v1.security.openshift.io
hostaccess SecurityContextConstraints.v1.security.openshift.io
hostmount-anyuid SecurityContextConstraints.v1.security.openshift.io
hostnetwork SecurityContextConstraints.v1.security.openshift.io
nonroot SecurityContextConstraints.v1.security.openshift.io
privileged SecurityContextConstraints.v1.security.openshift.io
restricted SecurityContextConstraints.v1.security.openshift.io