Quantcast
Channel: Active questions tagged containers - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 164

Why k8s with minikube NodePort are not working?

$
0
0

I am using minikube on my windows 11 machine just to start testing k8s. And my NodePorts are not giving an URL, and even when I recover the service's I.P and ports by using kubectl describe and I use that i.p and port in my browser they don't work.

I've remade the steps in a imperative simple form to simplify this question. I have followed this exact steps:

  1. kubectl run --image=nginx nginx-test
  2. kubectl expose pod nginx-test --port=80 --type=NodePort
  3. minikube service list --profile=testing

From the third step I was expecting to see the URL of my newly created NodePort service. The new service nginx-test is in the list, but the URL column is empty (as all other NodePorts I have created in other examples, either declarative or imperative)

So after I didn't saw a URL, I though I might just get the new service's i.p by running minikube ip --profile=testing and it's 192.168.49.2 . Then for the port it used on my host PC I got it from kubect describe svc nginx-test and got this output.

Name:                     nginx-testNamespace:                defaultLabels:                   run=nginx-testAnnotations:              <none>Selector:                 run=nginx-testType:                     NodePortIP Family Policy:         SingleStackIP Families:              IPv4IP:                       10.97.19.169IPs:                      10.97.19.169Port:                     <unset>  80/TCPTargetPort:               80/TCPNodePort:                 <unset>  30034/TCPEndpoints:                10.244.0.71:80Session Affinity:         NoneExternal Traffic Policy:  ClusterEvents:                   <none>

It says it's 30034 (though, it says <unset> which sounds like the problem but I don't know what it means).

So anyway, I opened a new browser with cleared cache and went to 192.168.49.2:30034 but I get no result. I've also tried localhost:30034 and same problem.

What am I missing here for the Nodeport truly listen?


Viewing all articles
Browse latest Browse all 164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>