Kubernetes service external ip pending

后端 未结 20 1721
你的背包
你的背包 2020-11-28 02:38

I am trying to deploy nginx on kubernetes, kubernetes version is v1.5.2, I have deployed nginx with 3 replica, YAML file is below,

apiVersion: extensions/v1be         


        
相关标签:
20条回答
  • 2020-11-28 02:57

    The LoadBalancer ServiceType will only work if the underlying infrastructure supports the automatic creation of Load Balancers and have the respective support in Kubernetes, as is the case with the Google Cloud Platform and AWS. If no such feature is configured, the LoadBalancer IP address field is not populated and still in pending status , and the Service will work the same way as a NodePort type Service

    0 讨论(0)
  • 2020-11-28 02:59

    If you are not on a supported cloud (aws, azure, gcloud etc..) you can't use LoadBalancer without MetalLB https://metallb.universe.tf/ but it's in beta yet..

    0 讨论(0)
  • 2020-11-28 03:02

    If you are using minikube then run commands below from terminal,

    $ minikube ip
    $ 172.17.0.2 // then 
    $ curl http://172.17.0.2:31245
    or simply
    $ curl http://$(minikube ip):31245
    
    0 讨论(0)
  • 2020-11-28 03:02

    same issue:

    os>kubectl get svc right-sabertooth-wordpress

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

    os>minikube service list

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

    | NAMESPACE | NAME | URL |

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

    | default | kubernetes | No node port |

    | default | right-sabertooth-mariadb | No node port |

    | default | right-sabertooth-wordpress | http://192.168.99.100:30454 |

    | | | http://192.168.99.100:30427 |

    | kube-system | kube-dns | No node port |

    | kube-system | tiller-deploy | No node port |

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

    It is, however,accesible via that http://192.168.99.100:30454.

    0 讨论(0)
  • 2020-11-28 03:07

    If you are using Minikube, there is a magic command!

    $ minikube tunnel
    

    Hopefully someone can save a few minutes with this.

    Reference link https://minikube.sigs.k8s.io/docs/handbook/accessing/#using-minikube-tunnel

    0 讨论(0)
  • 2020-11-28 03:09

    If you are not using GCE or EKS (you used kubeadm) you can add an externalIPs spec to your service YAML. You can use the IP associated with your node's primary interface such as eth0. You can then access the service externally, using the external IP of the node.

    ...
    spec:
      type: LoadBalancer
      externalIPs:
      - 192.168.0.10
    
    0 讨论(0)
提交回复
热议问题