开发者社区 问答 正文

kubectl删除secret registry.gitlab.com

请知道为什么删除这个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

展开
收起
k8s小能手 2018-12-14 14:39:39 5471 分享 版权
1 条回答
写回答
取消 提交回答
  • 整合最优质的专家资源和技术资料,问答解疑

    这有点奇怪,因为gcloud container clusters get-credentials actuator-sample
    应该设置正确的凭据和正确的上下文。但是,您的~/.kube/config文件中似乎可能有错误的“当前上下文” 。您可以查看:

    $ kubectl config get-contexts
    由于看起来您正在使用GKE,因此您当前的上下文应该是这样的:

    CURRENT NAME CLUSTER AUTHINFO NAMESPACE

    • gke__- gke__- gke__-
      如果不是,你必须选择上下文:

    $ kubectl config use-context gke__-

    2019-07-17 23:20:57
    赞同 展开评论
问答分类:
问答地址: