default-http-backend:80 (<error: endpoints "default-http-backend" not found>)

Viewed 6923

I am getting connection time out on my both domains one.example.com and two.example.com.

I have set up the cluster on AWS using kops.

Ingress is inside the default namespace also the services being proxied to are also in the default namespace.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-service-api
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    certmanager.k8s.io/cluster-issuer: "letsencrypt-example-prod"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  tls:
    - hosts:
        - one.example.in
      secretName: api-example-in
  rules:
    - host: one.example.in
      http:
        paths:
          - path: /customer/?(.*)
            pathType: Prefix
            backend:
              service:
                name: customer-srv
                port:
                  number: 3000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-service-monitor
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: "true"
    certmanager.k8s.io/cluster-issuer: "letsencrypt-example-prod"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  tls:
    - hosts:
        - two.example.in
      secretName: api-example-in
  rules:
    - host: two.example.in
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: kube-prometheus-grafana
              port:
                number: 80
$ kubectl describe ingress ingress-service-monitor

Warning: extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
Name:             ingress-service-monitor
Namespace:        default
Address:          dns.elb.ap-south-1.amazonaws.com
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
TLS:
  api-example-in terminates two.example.in
Rules:
  Host              Path  Backends
  ----              ----  --------
  monitor.example.in
                    /   kube-prometheus-grafana:80 (100.96.4.3:3000)
Annotations:        certmanager.k8s.io/cluster-issuer: letsencrypt-example-prod
                    kubernetes.io/ingress.class: nginx
                    nginx.ingress.kubernetes.io/ssl-redirect: true
                    nginx.ingress.kubernetes.io/use-regex: true

For installing the controller I followed this doc. I have run only this command

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/aws/deploy.yaml

I am listing here other information about ingress deployment

[ec2-user@ip ~]$ kubectl get all -n ingress-nginx
NAME                                            READY   STATUS      RESTARTS   AGE
pod/ingress-nginx-admission-create-5wpwn        0/1     Completed   0          3h39m
pod/ingress-nginx-admission-patch-6z2wx         0/1     Completed   2          3h39m
pod/ingress-nginx-controller-7fc74cf778-64vk2   1/1     Running     0          91m

NAME                                         TYPE           CLUSTER-IP      EXTERNAL-IP                                                                      PORT(S)                      AGE
service/ingress-nginx-controller             LoadBalancer   100.68.82.233   5e06c70e0a8b9d4b.elb.ap-south-1.amazonaws.com   80:31336/TCP,443:30936/TCP   3h39m
service/ingress-nginx-controller-admission   ClusterIP      100.64.118.59   <none>                                                                           443/TCP                      3h39m

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/ingress-nginx-controller   1/1     1            1           91m

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/ingress-nginx-controller-7fc74cf778   1         1         1       91m

NAME                                       COMPLETIONS   DURATION   AGE
job.batch/ingress-nginx-admission-create   1/1           10s        3h39m
job.batch/ingress-nginx-admission-patch    1/1           21s        3h39m
[ec2-user@ip ~]$
1 Answers

Try by checking the API version you are running or your ingress is supporting

you can run : kubectl api-resources -o wide

to check the API versions that your networking is supporting. if it's supporting extensions/v1beta1 you can use it and the example is below.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    certmanager.k8s.io/cluster-issuer: secret
    cert-manager.io/cluster-issuer: secret
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-body-size: 50m
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/secure-backends: "true"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/websocket-services: core
    nginx.org/websocket-services: core
  name: service-ingress
  namespace: default
spec:
  rules:
  - host: app.example.io
    http:
      paths:
      - backend:
          serviceName: core
          servicePort: 80
  tls:
  - hosts:
    - app.example.io
    secretName: secret
Related