简体   繁体   English

无法在谷歌云中使用kubernetes公开部署

[英]Not able to expose deployment using kubernetes in google cloud

I used the below command to build my spring boot application for deployment in google cloud. 我使用以下命令构建我的Spring启动应用程序以在Google云中部署。

mvn clean install && docker build -t eu.gcr.io/XXX/demo .
gcloud builds submit --tag eu.gcr.io/XXX/demo
kubectl run demo-server --image eu.gcr.io/XXX/demo
kubectl expose deployment demo-server --type=LoadBalancer –port=8080

And I can access my application externally. 我可以从外部访问我的应用程序。 I can delete and redeploy my application using: 我可以使用以下方法删除和重新部署我的应用程序

kubectl delete deployment demo-server 
kubectl run demo-server --image eu.gcr.io/XXX/demo

It is all working fine, but when I tried to expose the same application on different port say 8081, it failed to complain Error from server (AlreadyExists): services "demo-server" already exists How can I change the service port? 它一切正常,但是当我试图在8081的不同端口上公开相同的应用程序时,它没有抱怨Error from server (AlreadyExists): services "demo-server" already exists如何更改服务端口?

I resolved it by 我解决了

kubectl get services
kubectl delete services demo-server

I was deleting deployment but service was still available 我正在删除部署但服务仍然可用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Cloud将Kubernetes公开给浏览器 - Google Cloud Expose Kubernetes to Browser 使用入口 controller 公开 kubernetes 部署(前端) - Expose a kubernetes deployment (frontend) using ingress controller 使用Storage API从Kubernetes部署进行Google Cloud Bucket连接 - Google Cloud Bucket connection from Kubernetes deployment using Storage API 无法连接到在 kubernetes 部署中运行的 mysql 服务器公开为负载均衡器 - Not able to connect to mysql server running in kubernetes deployment expose as loadbalancer 谷歌云 Kubernetes 部署错误:字段不可变 - Google cloud Kubernetes deployment error: Field is immutable Apache 点燃谷歌云 Kubernetes 部署 - Apache Ignite Google cloud Kubernetes deployment 使用带有 Kubernetes 服务的谷歌云中的外部 IP 将其公开到互联网 - Use External IP in Google cloud with Kubernetes service to expose it to the internet 在AWS上使用HTTPS将Kubernetes部署向世界公开的方式是什么? - What's the way to expose a Kubernetes deployment to the world using HTTPS on AWS? 使用 Kubernetes 部署 YAML 文件将 Docker 映像部署到 Google Cloud 时未创建任何 pod - No pods created when deploying a Docker image to Google Cloud using a Kubernetes deployment YAML file Google Cloud Kubernetes Persistent Volume Claim 部署中的错误 Yaml - Google Cloud Kubernetes Persistent Volume Claim error in deployment Yaml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM