0

minikube v1.13.0 on Ubuntu 18.04 with Kubernetes v1.19.0 on Docker 19.03.8. Using helm/helmfile ("v3.3.4"). The Ubuntu VM is on VM-Workstation running on Win10, networking set as NAT, everything in my home wifi network.

I am trying to use ingress-backend stable/nginx-ingress 1.36.0 . I do have the nginx-ingress-1.36.0.tgz in the ingress/charts folder, and I have ingress/enabled minikube addons enable ingress.

Before I had enabled ingress on minikube, everything will get deployed successfully (no errors) but the service/LB stayed pending:

  ClusterIP      10.101.41.156    <none>        8080/TCP  

    ingress-controller-nginx-ingress-controller        LoadBalancer   10.98.157.222    <pending>     80:30050/TCP,443:32294/TCP 

After I enabled ingress on minikube, I now get this connection refused error:

STDERR:
Error: UPGRADE FAILED: cannot patch "ingress-service" with kind Ingress: 
    Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": Post "https://ingress-nginx-controller-admission.kube-system.svc:443/extensions/v1beta1/ingresses?timeout=30s": 
    dial tcp 10.105.131.220:443: connect: connection refused
        
COMBINED OUTPUT:
Error: UPGRADE FAILED: cannot patch "ingress-service" with kind Ingress: 
    Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": Post "https://ingress-nginx-controller-admission.kube-system.svc:443/extensions/v1beta1/ingresses?timeout=30s":
     dial tcp 10.105.131.220:443: connect: connection refused

I don't know what is this IP 10.105.131.220 - looks like pvt IP. It is not my minikube IP, or my VM IP or my laptop IP, I cant ping it.

But it all still deploys fine- but the Load Balancer still shows pending.

Update

I had missed one of the Steps based on documentation

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/mandatory.yaml

I stopped/deleted minkube and redid everything, now the error is gone, but the loadbalancer is still <pending>

Sam-T
  • 1,877
  • 6
  • 23
  • 51

1 Answers1

0

By default all solutions like minikube does not provide you LoadBalancer. Cloud solutions like EKS, Google Cloud, Azure do it for you automatically by spinning in the background separate LB. Thats why you see Pending status.

Solutions:

  1. use MetalLB on minikube

MetalLB hooks into your Kubernetes cluster, and provides a network load-balancer implementation. In short, it allows you to create Kubernetes services of type LoadBalancer in clusters that don’t run on a cloud provider, and thus cannot simply hook into paid products to provide load-balancers.

Installation:

kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.1/manifests/metallb.yaml

namespace/metallb-system created
podsecuritypolicy.policy/speaker created
serviceaccount/controller created
serviceaccount/speaker created
clusterrole.rbac.authorization.k8s.io/metallb-system:controller created
clusterrole.rbac.authorization.k8s.io/metallb-system:speaker created
role.rbac.authorization.k8s.io/config-watcher created
clusterrolebinding.rbac.authorization.k8s.io/metallb-system:controller created
clusterrolebinding.rbac.authorization.k8s.io/metallb-system:speaker created
rolebinding.rbac.authorization.k8s.io/config-watcher created
  1. use minikube tunnel

Services of type LoadBalancer can be exposed via the minikube tunnel command. It must be run in a separate terminal window to keep the LoadBalancer running. Ctrl-C in the terminal can be used to terminate the process at which time the network routes will be cleaned up.

minikube tunnel runs as a process, creating a network route on the host to the service CIDR of the cluster using the cluster’s IP address as a gateway. The tunnel command exposes the external IP directly to any program running on the host operating system.

Vit
  • 7,740
  • 15
  • 40
  • Thanks, Ok I will try MetalLB. And yes, my original understanding was you need a cloud provider to get a load balancer - but some documentation indicated I could do it with nginx/ingress. So what good is this - how/what for do I use this nginx/ingress? – Sam-T Oct 15 '20 at 20:05
  • i believe you better create second post and ask there purpose of nginx/ingress usage. Huge topic and you will have lots opinion and explanations there. This question is about `Pending` state in non-cloud solutions – Vit Oct 15 '20 at 20:14
  • Tried implementing metallb, had to retrofit my helmfile. Had to use bitnami/stable. After all that: `MetalLB is now running in the cluster` . `ingress-backend bitnami/metallb 0.1.24`. `LoadBalancer Services in your cluster are now available on the IPs you defined in MetalLB's configuration`. `ingress-backend default metallb-0.1.24 0.9.3`. But I dont see any loadbalancer created- `kubectl get services -o wide --all-namespaces ` - I get everything else but no loadbalancer created. So will have to debug/research. – Sam-T Oct 16 '20 at 04:09
  • Tried the hello world as in the link, **did not work** - the loadbalncer shows `nginx LoadBalancer 10.111.44.136 80:31009/TCP 10m` – Sam-T Oct 16 '20 at 05:43
  • configured [configmap](https://metallb.universe.tf/configuration/)? – Vit Oct 16 '20 at 09:11
  • followed [official guides](https://metallb.universe.tf/installation/) ? – Vit Oct 16 '20 at 09:13
  • Yes I followed all steps, configmap, set IP address range as suggested- my minikube IP 172.17.0.3 -> `172.17.0.0-172.17.0.10` – Sam-T Oct 16 '20 at 13:31
  • Actually now I noticed I had not `strictARP: true` I did that, restarted minikube and re-deployed service but still – Sam-T Oct 16 '20 at 15:16