Kubernetes external ip service is waiting

I am trying to deploy nginx to kubernetes, version kubernetes v1.5.2, I deployed nginx with 3 replicas, the YAML file below,

apiVersion: extensions/v1beta1 kind: Deployment metadata: name: deployment-example spec: replicas: 3 revisionHistoryLimit: 2 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.10 ports: - containerPort: 80 

and now I want to set my port 80 to port 30062 node, for which I created the service below,

 kind: Service apiVersion: v1 metadata: name: nginx-ils-service spec: ports: - name: http port: 80 nodePort: 30062 selector: app: nginx type: LoadBalancer 

this service works well, as it should be, but it shows as waiting not only on the dashboard of the tunnels but also on the terminal. Terminal output Control panel status

please help me solve this problem. Thanks...

+79
docker virtualization nginx kubernetes load-balancing
source share
12 answers

It looks like you are using a custom Kubernetes cluster (using minikube , kubeadm or the like). In this case, there is no built-in LoadBalancer (unlike AWS or Google Cloud). With this default setting, you can only use NodePort or Ingress Controller.

With Ingress Controller, you can configure the domain name that maps to your module; you do not need to specify the type of service LoadBalancer if you use Ingress Controller.

+117
source share

If you are not using GCE or EKS (you used kubeadm ), you can add the externalIPs specification to your YAML service. You can use the IP address associated with the main interface of your host, for example eth0 . Then you can access the service from outside using the external IP address of the host.

 ... spec: type: LoadBalancer externalIPs: - 192.168.0.10 
+29
source share

To access the service on minikube , you need to run the following command:

 minikube service [-n NAMESPACE] [--url] NAME 

More info here: Minikube GitHub

+27
source share

If you use Minikube, there is a magic team!

 $ minikube tunnel 

Hope someone can save a few minutes with this.

Link link https://github.com/kubernetes/minikube/blob/master/docs/networking.md#loadbalancer-emulation-minikube-tunnel

+26
source share

I created a K8S cluster with one node using kubeadm. When I tried PortForward and the kubectl proxy , it showed the external IP as pending.

 $ kubectl get svc -n argocd argocd-server NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE argocd-server LoadBalancer 10.107.37.153 <pending> 80:30047/TCP,443:31307/TCP 110s 

In my case, I patched the service as follows:

 kubectl patch svc <svc-name> -n <namespace> -p '{"spec": {"type": "LoadBalancer", "externalIPs":["172.31.71.218"]}}' 

After that, he began serving public IP.

 $ kubectl get svc argo-ui -n argo NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE argo-ui LoadBalancer 10.103.219.8 172.31.71.218 80:30981/TCP 7m50s 
+10
source share

If you work in Minikube , be sure to mention the namespace if you are not using default.

minicube service << service_name >> --url --namespace = << namespace_name >>

+3
source share

same problem:

os> kubectl get svc right-sabertooth-wordpress

TYPE TITLE CLUSTER-IP EXTERNAL IP-PORT (S)
right-sabertooth-wordpress LoadBalancer 10.97.130.7 "on hold" 80: 30454 / TCP, 443: 30427 / TCP

os> minikube services list

| ------------- | ---------------------------- | ------ -------------------------- |

| NAMESPACE | NAME | URL |

| ------------- | ---------------------------- | ------ -------------------------- |

| by default | Kubernetes | No port node |

| by default | right saber-toothed mariadb | No port node |

| by default | right-saber-toothed-wordpress | http://192.168.99.100:30454 |

| | | http://192.168.99.100:30427 |

| cube system | cube dns | No port node |

| cube system | Tiller-Expand | No port node |

| ------------- | ---------------------------- | ------ -------------------------- |

It is, however, available through this http://192.168.99.100:30454 .

+1
source share

Use NodePort:

kubectl run user-login --replicas = 2 --labels = "run = user-login" --image = kingslayerr / teamproject: version2 --port = 5000

kubectl set deployment user-login --type = NodePort --name = user-login-service

kubectl describes user-login-service services (write down the port)

kubect cluster-info (IP-> Get the IP address where the wizard runs)

Access to your service is available at (IP) :( port)

0
source share

Removing an existing service and creating the same new service solved my problems. My problems are that the load balancing Ip that I define is being used, so the external endpoint is idle. When I changed the new IP load balancer, it still could not work. Finally, deleting an existing service and creating a new one solved my problem.

0
source share

Check the logs of the cube controller. I was able to solve this problem by setting the clusterID tags for the ec2 instance on which I deployed the cluster.

0
source share

Following @ Javier's answer. I decided to go with an โ€œexternal IP fixโ€ for my load balancer.

  $ kubectl patch service my-loadbalancer-service-name \ -n lb-service-namespace \ -p '{"spec": {"type": "LoadBalancer", "externalIPs":["192.168.39.25"]}}' 

This will replace the โ€œpendingโ€ new fixed IP address that you can use for your cluster.

More on this. See the LoadBalancer Support Report with Minikube for Kubernetes

. Not the cleanest way to do this. I needed a workaround. Hope this helps someone.

0
source share

When using Minikube, you can get the IP and port through which you can access the service by running the Minikube kubia-http service.

0
source share

All Articles