我正在使用一个简单的ballerina
代码来构建我的带有ballerinax/kubernetes
注释的程序(简单的 hello world)。该服务正在成功编译,并可通过本地主机的特定绑定端口访问。
在配置 kubernetes 部署时,我指定了映像构建和推送标志:
@kubernetes:Deployment {
replicas: 2,
name: "hello-deployment",
image: "gcr.io/<gct-project-name>/hello-ballerina:0.0.2",
imagePullPolicy: "always",
buildImage: true,
push: true
}
构建源代码时:
ballerina build hello.bal
这就是我得到的:
Compiling source
hello.bal
Generating executable
./target/hello.balx
@docker - complete 3/3
Run following command to start docker container:
docker run -d -p 9090:9090 gcr.io/<gcr-project-name>/hello-ballerina:0.0.2
@kubernetes:Service - complete 1/1
@kubernetes:Deployment - complete 1/1
error [k8s plugin]: Unable to push docker image: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
请注意,当在我的本地机器上通过 docker 手动推送它时,它可以找到并且新图像正在被推送。
我错过了什么?有没有办法通过kubernetes
包告诉芭蕾舞演员有关 docker 注册表凭据的信息?