Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx Ingress for Kubernetes "Connection refused"

Was there a recent change to Nginx Ingress? Out of the blue I'm now getting "Connection refused" errors. I thought it was my own configuration which worked on a previous cluster.

Instead I decided to follow this tutorial GKE NGINX INGRESS and I'm getting the same result.

$ kubectl get deployments --all-namespaces
NAMESPACE     NAME                            DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
default       hello-app                       1         1         1            1           13m
default       nginx-ingress-controller        1         1         1            1           12m
default       nginx-ingress-default-backend   1         1         1            0           12m

I see the default-backend isn't running but I don't know enough about Kubernetes to know if that's what's preventing everything from working properly.

$ kubectl get svc
NAME                            TYPE           CLUSTER-IP      EXTERNAL-IP    PORT(S)                      AGE
hello-app                       ClusterIP      10.31.255.90    <none>         8080/TCP                     14m
kubernetes                      ClusterIP      10.31.240.1     <none>         443/TCP                      19m
nginx-ingress-controller        LoadBalancer   10.31.251.198   35.227.50.24   80:31285/TCP,443:30966/TCP   14m
nginx-ingress-default-backend   ClusterIP      10.31.242.167   <none>         80/TCP                       14m

Finally:

$ kubectl get ing
NAME               HOSTS     ADDRESS         PORTS     AGE
ingress-resource   *         35.237.184.85   80        10m

According to the tutorial I should just be able to go to here to receive a 200 and here to get a 404.

I've left the links live so you all can see them.

$ curl -I http://35.237.184.85/hello
curl: (7) Failed to connect to 35.237.184.85 port 80: Connection refused

I swear everything worked before and the only thing I can think of is that something from the teller install of nginx-ingress changed.

Please, any help is appreciated! Thank you in advance!

like image 674
jmvbxx Avatar asked Jun 16 '18 15:06

jmvbxx


People also ask

What is NGINX ingress Kubernetes IO limit connections?

nginx.ingress.kubernetes.io/limit-connections : number of concurrent connections allowed from a single IP address. nginx.ingress.kubernetes.io/limit-rps : number of connections that may be accepted from a given IP each second. If you specify both annotations in a single Ingress rule, limit-rps takes precedence.

Does Kubernetes ingress use NGINX?

The Ingress controller is one of the most critical parts of Kubernetes platform, acting as the entry point for all incoming traffic to applications running on Kubernetes. That's why it must be built on top of a proven and reliable load‑balancing technology, such as NGINX.

Is Kubernetes ingress an API gateway?

Gateway API is an official Kubernetes API like Ingress. Gateway API represents a superset of Ingress functionality, enabling more advanced concepts. Similar to Ingress, there is no default implementation of Gateway API built into Kubernetes.

Is Kubernetes IO ingress class deprecated?

kubernetes.io/ingress.class annotation is deprecated in Atik 1.28 | k8saas documentation.


1 Answers

That's because you are trying the request against the IP address created by the Ingress. Your entrypoint is the LoadBalancer type service created IP.

Try curl -I http://35.227.50.24/hello. That's where you will get 200.

like image 81
suren Avatar answered Sep 22 '22 16:09

suren