请问您知道为什么删除 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: [<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3002030203020303031d535f5d4045445570545546555c5f4055421e57435542465953555153535f455e441e535f5d" rel="noreferrer noopener nofollow">[email protected]</a>]
$ 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容器集群获取凭证执行器样本
应该设置正确的凭据和正确的上下文。但是,您的 ~/.kube/config
文件中的“当前上下文”似乎可能错误。您可以检查:
$ kubectl config get-contexts
由于您似乎正在使用 GKE,因此您当前的上下文应该如下所示:
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* gke_<project_name>_<region>-<cluster-name> gke_<project_name>_<region>-<cluster-name> gke_<project_name>_<region>-<cluster-name>
如果不是,您必须选择该上下文:
$ kubectl config use-context gke_<project_name>_<region>-<cluster-name>
关于docker - kubectl 删除 secret registry.gitlab.com,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53688080/