windows - Openshift3 中的 "User "系统 "cannot get securitycontextconstraints at the cluster scope"

标签 windows openshift hyper-v docker-machine openshift-client-tools

如果我尝试向在 Windows10 Pro 和 Hyper-V 中运行的本地 OpenShift 一体化集群添加安全约束,openshift 客户端会收到以下消息:

c:\openshift\oc.exe adm policy add-scc-to-user anyuid -z default
Error from server (Forbidden): User "system" cannot get securitycontextconstraints at the cluster scope"

Openshift 实例是由 docker 机器使用以下步骤创建的:

1) docker-machine create -d "hyperv" --engine-insecure-registry 172.30.0.0/16 --hyperv-virtual-switch "openshift" openshift 
2) oc cluster up --docker-machine=openshift

是否有任何配置允许系统用户访问 securitycontextconstraints?

最佳答案

尝试运行:

docker exec origin oc adm policy add-scc-to-user anyuid -z default -n projectname

这将在 OpenShift 集群内部运行 oc,它应该以管理员身份运行。

我建议还运行:

docker exec origin oc adm policy add-cluster-role-to-group sudoer system:authenticated yourusername

这样您以后就可以通过运行以下命令来运行管理命令:

oc adm policy add-scc-to-user anyuid -z default -n projectname --as system:admin

即通过--as system:admin来模拟admin。

你可能想考虑使用 Minishift 而不是 oc cluster up 因为它从内存中默认给 developer 用户 sudoer 角色等等可以使用--as system:admin来执行管理命令。

关于windows - Openshift3 中的 "User "系统 "cannot get securitycontextconstraints at the cluster scope",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44990182/

相关文章:

android - 如何启动 Xamarin 项目(模拟器错误(RedStone 4))

Windows 中的 PHP ZipArchive 损坏

windows - 一个人可以打开的窗口数量有限制吗?

kubernetes - 允许使用 oc/kubectl port-forward 的角色的名称是什么?

OpenShift v3 部署 springboot 二进制 jar

Windows 8.1 Professional Hyper-V 无法启动

c++ - 跨平台构建、标准目录结构、环境变量

windows - 如何在GIT窗口中 merge 不同大小写的分支?

python - 为什么 Openshift 添加 cache-control private?

linux - lspci 未显示 HyperV 网络适配器