Bazel Kubernetes对象错误:没有传递要应用的对象(Google容器注册表)

Bazel Kubernetes对象错误:没有传递要应用的对象(Google容器注册表),kubernetes,google-kubernetes-engine,bazel,kubectl,google-container-registry,Kubernetes,Google Kubernetes Engine,Bazel,Kubectl,Google Container Registry,我有一个k8s_对象规则来将部署应用到我的Google Kubernetes集群。以下是我的设置: load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image") nodejs_image( name = "image", data = [":lib", "//:package.json"], entry_point = ":index.ts", ) load("@io_bazel_rules_k8s//

我有一个
k8s_对象
规则来将部署应用到我的Google Kubernetes集群。以下是我的设置:

load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
nodejs_image(
    name = "image",
    data = [":lib", "//:package.json"],
    entry_point = ":index.ts",
)

load("@io_bazel_rules_k8s//k8s:object.bzl", "k8s_object")
k8s_object(
  name = "k8s_deployment",
  template = ":gateway.deployment.yaml",
  kind = "deployment",
  cluster = "gke_cents-ideas_europe-west3-b_cents-ideas",
  images = {
    "gcr.io/cents-ideas/gateway:latest": ":image"
  },
)
但是当我运行
bazel run//services/gateway:k8s_deployment.apply
时,我得到了以下错误

INFO: Analyzed target //services/gateway:k8s_deployment.apply (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //services/gateway:k8s_deployment.apply up-to-date:
  bazel-bin/services/gateway/k8s_deployment.apply
INFO: Elapsed time: 0.113s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
$ /snap/bin/kubectl --kubeconfig= --cluster=gke_cents-ideas_europe-west3-b_cents-ideas --context= --user= apply -f -
2020/02/12 14:52:44 Unable to publish images: unable to publish image gcr.io/cents-ideas/gateway:latest
error: no objects passed to apply
错误:没有传递要应用的对象 它不会将新图像推送到Google容器注册表

奇怪的是,这在几天前奏效了。但我没有改变任何事情

如果需要仔细查看,以下是完整的代码:

更新 我不知道这是否与这个问题有关,但当我跑步时

gcloud auth configure-docker
我收到一些警告:

WARNING: `docker-credential-gcloud` not in system PATH.
gcloud's Docker credential helper can be configured but it will not work until this is corrected.
WARNING: Your config file at [/home/flolu/.docker/config.json] contains these credential helper entries:

{
  "credHelpers": {
    "asia.gcr.io": "gcloud", 
    "staging-k8s.gcr.io": "gcloud", 
    "us.gcr.io": "gcloud", 
    "gcr.io": "gcloud", 
    "marketplace.gcr.io": "gcloud", 
    "eu.gcr.io": "gcloud"
  }
}
Adding credentials for all GCR repositories.
WARNING: A long list of credential helpers may cause delays running 'docker build'. We recommend passing the registry name to configure only the registry you are using.
gcloud credential helpers already registered correctly.

我通过
snap install
安装了
googlecloudsdk
。我所做的就是通过

snap remove google-cloud-sdk
然后通过

sudo apt install google-cloud-sdk

现在它工作正常了

您是否尝试过以不同的名称部署它?或者将其从
移动到
?我知道这很奇怪。。。但也许会有用。还是一样的错误我已经更新了我的问题。。。。这会引起问题吗?试着检查一下,更新SDK,最新的是20.0.0