【发布时间】:2018-10-28 19:29:41
【问题描述】:
我们有一个工具可以为我们公司的所有团队配置 ci/cd 工作流程。作为工具链配置的一部分,我们还自动创建了 openshift 项目。 我正在尝试为单个团队的部署过程找出最佳的自动化授权策略
这是我们目前正在做的事情
Create a project (eg: testproject)
Create a service account(oc create sa testuser)
Add user to admin role for the project (oc policy add-role-to-user admin system:serviceaccount:testproject:testuser)
现在我们检索 sa 帐户 testuser 的 api 令牌 oc describe sa testuser (获取预定义的 testuser 令牌) oc describe secret testuser-token-gd9sl(获取会话令牌)
通过 describe secret 命令,我们可以检索 api 令牌。我们将这些 api 令牌提供给各个团队。
oc login https://192.219.152.34.nip.io –token=adfasdfsdaf23423
Teams Once logged in as using their token , they are able to peform any api oerations in the scope of testproject.
eg: oc create -f testproject-deploymentconfig.yml
oc create -f testproject-service.yml
这种方法正确吗?它有什么缺点吗?有更好的方法吗?谁能推荐一下
【问题讨论】: