请知道为什么删除这个secret不起作用?
Cloning repository...
Cloning into '/builds/systemxy/actuator-sample'...
Checking out e503a7da as master...
Skipping Git submodules setup
$ echo "$GOOGLE_KEY" > key.json
$ gcloud auth activate-service-account --key-file key.json
Activated service account credentials for: [23232333-compute@developer.gserviceaccount.com]
$ gcloud config set compute/zone europe-west1-c
Updated property [compute/zone].
$ gcloud config set project actuator-sample-224932
Updated property [core/project].
$ gcloud config set container/use_client_certificate True
Updated property [container/use_client_certificate].
$ gcloud container clusters get-credentials actuator-sample
Fetching cluster endpoint and auth data.
kubeconfig entry generated for actuator-sample.
$ kubectl delete secret registry.gitlab.com
Error from server (Forbidden): secrets "registry.gitlab.com" is forbidden: User "client" cannot delete secrets in the namespace "default"
ERROR: Job failed: exit code 1`enter code here
这有点奇怪,因为gcloud container clusters get-credentials actuator-sample
应该设置正确的凭据和正确的上下文。但是,您的~/.kube/config文件中似乎可能有错误的“当前上下文” 。您可以查看:
$ kubectl config get-contexts
由于看起来您正在使用GKE,因此您当前的上下文应该是这样的:
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
$ kubectl config use-context gke__-
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。