Home > Net >  Get Externally accessible IP address of Pod in Kubernetes
Get Externally accessible IP address of Pod in Kubernetes

Time:01-10

I need to create two instances using the same Ubuntu Image in Kubernetes. Each instance used two ports i.e. 8080 and 9090. How can I access these two ports externally? Can we use the IP address of the worker in this case?

CodePudding user response:

If you want to access your Ubuntu instances from outside the k8s cluster you should place pods behind the service.

You can access services through public IPs:

  • create Service of type NodePort- the service will be available on <NodeIp>:<NodePort>
  • create Service of type LoadBalancer - if you are running your workload in the cloud creating service of type LoadBalancer will automatically deploy LoadBalancer for you.

Alternatively you can deploy Ingress to expose your Service. You would also need Ingress Controller.

Useful links:

  •  Tags:  
  • Related