Reputation: 23
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?
Upvotes: 1
Views: 1546
Reputation: 276
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:
Service
of type NodePort
- the service
will be available on <NodeIp>:<NodePort>
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:
Upvotes: 3