【转】openshift运行应用权限报错解决

openshift里多了scc概念.scc是security
context constraints缩写.安全上下文约束.
简单讲就是授权的. 系统有一大堆权限,包含访问project的权限,访
问api的权限等.新建个用户后,酌情把这些权限授权他们.在我新建的
project ,demo-project里新建了个nginx. 报错.
在这里插入图片描述
简单的解决就一条命令:
$oc adm policy add-scc-to-group anyuid system:authenticated

参考:

https://docs.openshift.com/enterprise/3.2/admin_guide/manage_scc.html
https://github.com/openshift/openshift-docs/issues/1533

解决:
Grant a Service Account Access to the Privileged SCC
First, create a service account. For
example, to create service account mysvcacct in
project myproject:
$ oc create serviceaccount mysvcacct -n myproject
Then, add the service account to the privileged SCC.
$ oadm policy add-scc-to-user privileged system:serviceaccount:myproject:mysvcacct
Enable
Images to Run with USER in the Dockerfile
To relax the security in your cluster so that images are not forced to run as a pre-allocated UID, without granting everyone access to the privileged SCC:

Grant all authenticated users access to the anyuid SCC:

$ oadm policy add-scc-to-group anyuid system:authenticated

– This allows images to run as the root UID if no USER is specified in the Dockerfile.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值