gpt4 book ai didi

docker - kubectl删除 secret Registry.gitlab.com

转载 作者:行者123 更新时间:2023-12-02 11:37:27 26 4
gpt4 key购买 nike

请问为什么删除 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
* 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com