openshift v3.3で作成されたプロジェクトへのコンテナのビルドと展開を自動化しようとしています。ドキュメントでは、これを行うためにサービスアカウントを活用する必要があることがわかりますが、ドキュメンテーションは順調ではなく、ブログで見つかった例はタスクを完了しません。私のワークフローは、私が使用しているコマンド例を以下に示します。サービスアカウントを使用した展開の自動化に失敗する
BUILDER_TOKEN='xxx'
DEPLOYER_TOKEN='xxx'
# build and push the image works as expected
docker build -t registry.xyz.com/want/want:latest .
docker login --username=<someuser> --password=${BUILDER_TOKEN} registry.xyz.com
docker push registry.xyz.com/<repo>/<image>:<tag>
# This fails with error
oc login https://api.xyz.com --token=${DEPLOYER_TOKEN}
oc project <someproject>
oc new-app registry.xyz.com/<repo>/<image>:<tag>
Notice I login into the rest api interface, select the project and create the app but this fails with the following errors:
error: User "system:serviceaccount:want:deployer" cannot create deploymentconfigs in project "default"
error: User "system:serviceaccount:want:deployer" cannot create services in project "default"
アイデアはありますか?
コマンドの例を教えてください。 –
ご覧のとおり、このドキュメントは詳しくはhttps://docs.openshift.org/latest/admin_guide/service_accounts.htmlに詳しくは載っていません。私は、この問題が私たちのオープンシフト専用プラットフォームに存在すると述べておきたいと思います。私は通常のユーザーとしてログインしたときにしか問題を見ません。 –