'Unable to interact with the application via minikube
I'm learning kubernetes via a LinkedIn learning course. A tutorial I'm doing runs this hello world application via kubectl and minikube. Everything appears in working order, but I cannot interact with the application using minikube service helloworld. The request keeps timing out.
The tutorial first asks to create a deployment using the command kubectl create -f helloworld.yaml then to expose the service via command kubectl expose deployment helloworld --type=NodePort and then it says interact with the app by doing minikube service helloworld. The diagnostics after create and expose show that everything on my end matches the tutorial's setup, but the last step fails for me whereas it launches the browser and shows the hello world app in the tutorial demo.
How would I go about debugging this error as an absolute beginner?
EDIT:
When I run kubectl describe services, I get the following output
$ kubectl describe services
Name: helloworld
Namespace: default
Labels: <none>
Annotations: <none>
Selector: app=helloworld
Type: NodePort
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.96.6.203
IPs: 10.96.6.203
Port: <unset> 80/TCP
TargetPort: 80/TCP
NodePort: <unset> 30433/TCP
Endpoints: 172.17.0.2:80
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
When I check the port 30433, by doing nc -zv <hostname> 30433, I get an error:
nc: connectx to <hostname> port 30433 (tcp) failed: Connection refused
nc: connectx to <hostname> port 30433 (tcp) failed: Network is unreachable
Solution 1:[1]
You can try to access your application with the help of this shortcut - it is used to fetch minikube IP and a service’s NodePort:
minikube service --url helloworld
The output of the command will display Kubernetes service URL in CLI, instead of trying to launch it in your default browser with minikube service helloworld command. Using this URL, you will be able to access the exposed service in the browser.
In general, you can check the list of all available services in your minikube cluster and their URLs by using minikube service list command.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
