我正在按照以下关于使用gitlab和Kubernetes进行持续集成的教程(在我的情况下在谷歌云上):https://about.gitlab.com/2016/12/14/continuous-delivery-of-a-spring-boot-application-with-gitlab-ci-and-kubernetes/.
在本教程的某些时候,您必须首先删除然后为Gitlab的图像注册表创建一个秘密:
- kubectl delete secret registry.gitlab.com
- kubectl create secret docker-registry registry.gitlab.com --docker-server=https://registry.gitlab.com --docker-username=$REGISTRY_USERNAME --docker-password=$REGISTRY_PASSWD --docker-email=$EMAIL
在这一步出现问题,我收到以下错误:
Error from server (Forbidden): secrets "registry.gitlab.com" is forbidden: User "client" cannot delete secrets in the namespace "default": Unknown user "client"
Error from server (Forbidden): secrets is forbidden: User "client" cannot create secrets in the namespace "default": Unknown user "client"
我在Google云端shell中得到了同样的错误:
添加以下行并没有真正帮助,我仍然得到创建错误(我也100%确定删除也’崩溃’但’2> / dev / null’只是让它移动到创建步骤):
kubectl delete secret registry.gitlab.com 2>/dev/null || echo "secret does not exist"
我究竟做错了什么? Thx提前!
最佳答案