简体   繁体   English

无法访问 kubernetes POD 内的应用程序

[英]Not able to access application inside kubernetes POD

Service.Yaml服务.Yaml

pods.yaml吊舱.yaml

i am not able to access my application from browser.我无法从浏览器访问我的应用程序。 What mistake i am doing?我在做什么错误?

if i give Ipaddress:30010 -> my app is not getting reached.如果我给 Ipaddress:30010 -> 我的应用程序没有被访问。 (attached my pod.yaml and service.yaml here in attachment) (附上我的 pod.yaml 和 service.yaml 在附件中)

You need to add targetPort setting in the ports section on your Service.yaml.您需要在 Service.yaml 的端口部分添加targetPort设置。 This specifies the destination port of the container.这指定了容器的目标端口。

ports:
  - name: http
    port: 5432
    targetPort: 5432
    nodePort: 30010

You need to find your node ip.您需要找到您的节点 ip。 If you are using minikube then you find node ip list.如果您使用的是 minikube,那么您会找到节点 ip 列表。 By running kubectl cluster-info.通过运行 kubectl cluster-info。 Then in your browser go to http:[node-ip]:30010然后在你的浏览器 go 到 http:[node-ip]:30010

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM