I have created a simple hello world service in my kubernetes cluster. I am not using any cloud provider and have created it in a simple Ubuntu 16.04 server from scratch. I am able to access the service inside the cluster but now when I want to expose it to the internet, it does not work.
Here is the yml file - deployment.yml
And this is the result of the command - kubectl get all:
Now when I am trying to access the external IP with the port in my browser, i.e., 172.31.8.110:8080, it does not work.
NOTE: I also tried the NodePort Service Type, but then it does not provide any external IP to me. The state remains pending under the "External IP" tab when I do "kubectl get services".
How to resolve this??
codeSample
and posting configs/errors as text. Another thing, you have 2 cloud providers tag: Azure Cloud (AKS) and Google Cloud Platform (GKE). Which one you are using? Exposing service depends on your env and your config. Please provide more focused details about your env and config, what you are using and how you want to expose id (MetalLB, Ingress, LoadBalancer, NodePort, etc). – PjoterS