织梦CMS - 轻松建站从此开始!

欧博ABG官网-欧博官方网址-会员登入

502 Bad Gate欧博注册way with Kubernetes Ingress

时间:2025-08-21 00:04来源: 作者:admin 点击: 2 次
Your ingress targets this service: serviceName: myservice servicePort: 80 but the service named myservice exposes port 8080 rather than 80: p

Your ingress targets this service:

serviceName: myservice servicePort: 80

but the service named myservice exposes port 8080 rather than 80:

ports: - protocol: "TCP" # Port accessible inside cluster port: 8080 # Port to forward to inside the pod targetPort: 80

Your ingress should point to one of the ports exposed by the service.

Also, the service itself targets port 80, but the pods in your deployment seem to expose port 8080, rather than 80:

containers: - name: my-service image: my-custom-docker-regisry/my-service:latest imagePullPolicy: Always ports: - containerPort: 8080

So long story short, looks like you could swap port with targetPort in your service so that:

the pods expose port 8080

the service exposes port 8080 of all the pods under service name myservice port 80,

the ingress configures nginx to proxy your traffic to service myservice port 80.

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-08-23 19:08 最后登录:2025-08-23 19:08
栏目列表
推荐内容