-1

I'm new to Kubernetes. I am facing the following issue.

I created a deployment using this command.

$ kubectl run simple-deployment-14 --image cooldocker19/manas-simple-flask:v1.0 --port=5000

To expose it as a service, I used this.

kubectl expose deployment simple-deployment-14 --port 5000 --type=LoadBalancer --name=simple-service

In the above command, when I use type=LoadBalancer, then I see the EXTERNAL-IP is <pending>and with type=NodePort, then the EXTERNAL-IP is none

Here is the details of the service.

$ kubectl describe service simple-service-14

Name:                     simple-service-14
Namespace:                default
Labels:                   run=simple-deployment-14
Annotations:              <none>
Selector:                 run=simple-deployment-14
Type:                     NodePort
IP:                       10.101.XXX.XXX
LoadBalancer Ingress:     localhost
Port:                     <unset>  5000/TCP
TargetPort:               5000/TCP
NodePort:                 <unset>  31754/TCP
Endpoints:                10.1.X.XXX:5000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

I was expecting to see a working endpoint on browser, but it doesn't show anything.

Reference endpoint: http://localhost:5000/test

What am I missing here ?

halfer
  • 19,824
  • 17
  • 99
  • 186
Manas Mukherjee
  • 5,270
  • 3
  • 18
  • 30
  • What do you mean by `doesn't show anything`? Do you have any errors? Have you tried to reach your service at `localhost:31754` – acid_fuji Nov 16 '20 at 08:58

1 Answers1

-1

Already answered here check if it is helpful.

https://stackoverflow.com/questions/64812253/kubernetes-weirdness-cannot-visit-localhost-but-can-use-curl/64816496#64816496 
  • 2
    Please flag the question as a duplicate, if you think it is; or leave a complete answer here that doesn't depend on following the link. – David Maze Nov 14 '20 at 17:45
  • @Shashi Kumar, I am not using minikube. If you know how to fix the above issue for "docker desktop" then please share your answer. – Manas Mukherjee Nov 14 '20 at 18:49
  • @DavidMaze I am new to this platform so i am unaware about some feature and Manas docker desktop supports only minikube , Try this command : minikube service simple-service --url – Shashi Kumar Nov 15 '20 at 03:18
  • @ShashiKumar, I am using "Docker on Mac with Kubernetes", not minikube. Ref: https://codefresh.io/kubernetes-tutorial/local-kubernetes-mac-minikube-vs-docker-desktop/ – Manas Mukherjee Nov 15 '20 at 04:55