Hey everyone! I'm just starting out with Kubernetes and have set up a pod running Nginx. I'm trying to access it from my browser using the server's IP address but I'm running into issues. I'm using Ubuntu Server with Minikube and when I try to go to `http://192.168.1.199:PORT`, it doesn't load anything. I managed to get it to respond with `curl` in the terminal using `kubectl port-forward`, but I'm not sure if that's the right way to do it or if it's just for testing. Can anyone explain the simplest and most effective method to view my Nginx pod in a browser when everything is on the same network? Any tips for beginners would be highly appreciated! Thanks!
2 Answers
Make sure your port configuration is set up correctly in your service definition. You can reference the Kubernetes documentation to ensure you have everything lined up for your setup. It’s pretty straightforward once you get the hang of services!
To access your Nginx pod, you'll need to create a Kubernetes service to expose it. Normally for Nginx, you'd want a LoadBalancer type service to route traffic correctly. Since you're using Minikube, you can set this up by running `minikube service ` and it will handle the setup for you, giving you an external IP to access your pod. Check out the Minikube docs for a detailed guide on this!
Thanks for the tip! I've been trying to figure things out for a few hours now. I’ll definitely give that a shot!
I’ll double-check my configs. Thanks for the heads-up!