Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get services: add PENDING state for EXTERNAL-IP #23562

Closed
broady opened this issue Mar 28, 2016 · 17 comments
Closed

get services: add PENDING state for EXTERNAL-IP #23562

broady opened this issue Mar 28, 2016 · 17 comments
Labels
sig/network Categorizes an issue or PR as relevant to SIG Network.

Comments

@broady
Copy link

broady commented Mar 28, 2016

After calling expose --type=LoadBalancer, a call to get services will print something like this:

$ kubectl get services
NAME         CLUSTER-IP     EXTERNAL-IP       PORT(S)    AGE
hello-node   10.43.246.94                     8080/TCP   3d
kubernetes   10.43.240.1    <none>            443/TCP    3d

kubectl should show a PENDING state to indicate to the user that something is happening behind the scenes.

@hyunchel
Copy link

hyunchel commented Jun 9, 2016

+1 for this.

On GCE environment, kubectl describe services would show External IP section, where it would stay blank until load balancer is ready to use. So we get an implicit expression of state on new load balancer.

This is not the case with AWS, however, as External IP section will never be populated.
I'm currently working with K8 on AWS environment.
Whenever a load balancer is "exposed" via kubectl, there is no way to know if ELB is ready to hit or not.

Having a pending sign would be helpful! :)

@tobegit3hub
Copy link

I thinks External IP could only work in GCE right now and you can use NodePort in other IaaS. Please correct me if I'm wrong.

@1ambda
Copy link

1ambda commented Aug 3, 2016

According to theType: LoadBalancer#shortcomings,
It is required to set nodePort for LoadBalancer if you are using other providers rather than GCE

The Type field is designed as nested functionality - each level adds to the previous. This is not strictly required on all cloud providers (e.g. Google Compute Engine does not need to allocate a NodePort to make LoadBalancer work, but AWS does) but the current API requires it.

In this case (on AWS), we need to

  • create load balancer pod (e.g Nginx)
  • create service using the load balancer pod info

@ksingh7
Copy link

ksingh7 commented Jan 7, 2017

@1ambda @zreigz @broady @hyunchel Guys , i tried creating NodePort and type: Loadbalancer for my K8s on AWS , but still the service cant get external IP. I also have the required IAM roles created but still does'nt work.

Any thoughts / suggestions ?

Do you think the only option is to ditch AWS and use GCE to get external-IP thing to work

PS : If i use type: NodePort service works fine , but i really like to use external-IP .

---
kind: Service
apiVersion: v1
metadata:
  name: my-service
spec:
  selector:
    app: MyApp
  type: LoadBalancer
  ports:
  - protocol: TCP
    port: 8080
    nodePort: 30061
$ kubectl get services
NAME           CLUSTER-IP    EXTERNAL-IP   PORT(S)    AGE
kubernetes     10.32.0.1     <none>        443/TCP    2d
my-service     10.32.0.59    <pending>     8080/TCP   19h

@ksingh7
Copy link

ksingh7 commented Jan 7, 2017

Managed to get this working by adding --cloud-provider=aws in the following unit files followed by service stop , reload , restart on all controller nodes.

  • /etc/systemd/system/kube-apiserver.service
  • /etc/systemd/system/kube-controller-manager.service

There is no need to bother about using NodePort , just add type: LoadBalancer and it should work

@runephilosof
Copy link

@ksingh7 I wanted to try your workaround, but I don't have those files on the apiserver node.

@kamarajuPrathi
Copy link

@ksingh7 I too dont see those files , where did find these files to be edited

@jiashenC
Copy link

jiashenC commented Jul 6, 2018

Have you tried looking at /etc/kubernetes/manifests/?

@djangofan
Copy link

djangofan commented Jul 22, 2018

FYI: I get the problem described in this issue (using Docker Mac Edge 18.06.0-ce-rc3-mac68) when I try to create services from this project: https://github.com/kubernetes/examples/tree/master/mysql-wordpress-pd
The mysql pod is fine but the wordpress pod never gets an IP. Thoughts? In this case, NodePort not working?

To reproduce:

kubectl create -f local-volumes.yaml
kubectl create secret generic mysql-pass --from-literal=password=DockerCon
kubectl create -f mysql-deployment.yaml
kubectl create -f wordpress-deployment.yaml 

@bamb00
Copy link

bamb00 commented Aug 2, 2018

I have the same issue using k8s v1.9.5 running on AWS platform.

Is there a fix or workaround?

   NAME          TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                         AGE       SELECTOR
   my-service   LoadBalancer   10.108.65.126   <pending>     6190:30628/TCP,7001:31470/TCP   18m      app=my-service
   kubernetes    ClusterIP      10.96.0.1       <none>        443/TCP                         56m       <none>

Thanks in Advance.

@Darkentik
Copy link

Darkentik commented Aug 9, 2018

Same here while using Azure with Kubernetes and helm to setup an ingeress-nginx.
I followed this guide to install ingress-nginx: https://kubernetes.github.io/ingress-nginx/deploy/
And installed helm on my Debian Stretch via the offered batch script from here: https://github.com/helm/helm/releases/tag/v2.9.1

# helm install stable/nginx-ingress --namespace kube-system --name my-nginx
# kubectl get service --all-namespaces
NAMESPACE     NAME                                     TYPE           CLUSTER-IP       EXTERNAL-IP     PORT(S)                      AGE
kube-system   heapster                                 ClusterIP      192.168.83.66    <none>          80/TCP                       15d
kube-system   kube-dns                                 ClusterIP      192.168.83.70    <none>          53/UDP,53/TCP                15d
kube-system   kubernetes-dashboard                     ClusterIP      192.168.83.103   <none>          80/TCP                       15d
kube-system   my-nginx-nginx-ingress-controller        LoadBalancer   192.168.83.81    <pending>       80:32670/TCP,443:31153/TCP   9m
kube-system   my-nginx-nginx-ingress-default-backend   ClusterIP      192.168.83.110   <none>          80/TCP                       9m
kube-system   tiller-deploy                            ClusterIP      192.168.83.92    <none>          44134/TCP                    17h

Any ideas? I don´t have access to any yaml files for deploying because i´m using helm to install ingress-nginx.

@rakshith-ponnappa
Copy link

Hi, I am facing the same issue on openstack, please can you advise.

root@master-node:~/.kube# k get service frontend --watch
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
frontend LoadBalancer 10.105.62.204 80:32489/TCP 5m

@serafdev
Copy link

The issue in my case (Google Cloud Platform) was just that we reached the quota limit of static addresses so the kubernetes service was not able to reserve an IP.

@kkarthee
Copy link

kkarthee commented Apr 1, 2019

I am having the same issue with my bare metal kubernetes cluster, Any help or Workaround to access my services from outside?

root@kub-server:/etc/rc2.d# kubectl get services -o wide
NAME              TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE   SELECTOR
hello-server      LoadBalancer   10.102.162.125   <pending>     8080:31465/TCP   44h   run=hello-server
kubernetes        ClusterIP      10.96.0.1        <none>        443/TCP          12d   <none>
nginx             LoadBalancer   10.108.102.105   <pending>     80:30378/TCP     43h   run=nginx
wordpress         LoadBalancer   10.101.109.79    <pending>     80:32651/TCP     9d    app=wordpress,tier=frontend
wordpress-mysql   ClusterIP      None             <none>        3306/TCP         10d   app=wordpress,tier=mysql
root@kub-server:/etc/rc2.d#

@punitporwal07
Copy link

punitporwal07 commented Jun 19, 2019

facing same issue, I am using kubeadm 1.14 version. where after exposing service k8s is not assigning external IP , exposed as type LoadBalancer
externalIP

whereas on GKE it working fine and assigning external IP. is this issue still persist.. or fixed now ?

@thockin
Copy link
Member

thockin commented Jun 19, 2019

You need a cloud provider or other controller that knows how to allocate an IP and route traffic into the nodes. GKE has that in GCP. If you are on-prem, k8s has no idea what infrastructure exists on your network.

@VGerris
Copy link

VGerris commented Jan 24, 2020

True. Options are for on-premise:

  • https://metallb.universe.tf/ to implement the loadbalancer
  • use NodePort instead of LoadBalancer which will expose it to a port on the cluster ip
  • use the externalIPs option like so (where the IP is the cluster main ip for eth0 for example):
    type: LoadBalancer
    externalIPs:
    • 10.12.11.30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

No branches or pull requests