1

TL;DR: Setup a service with the same name as the deployment and ingress ports all match still getting:

error: endpoints "default-http-backend" not found

Here is Service yaml:

apiVersion: v1

kind: Service
metadata:
  name: sonarr
  namespace: media
spec:
  selector:
    app: sonarr
  ports:
  - protocol: TCP
    port: 8989
    targetPort: 80

kubectl apply -f svc.yaml results

 kubectl describe svc sonarr -n media
Name:              sonarr
Namespace:         media
Labels:            <none>
Annotations:       <none>
Selector:          app=sonarr
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.43.184.97
IPs:               10.43.184.97
Port:              <unset>  8989/TCP
TargetPort:        80/TCP
Endpoints:         10.42.1.10:80
Session Affinity:  None
Events:            <none>

Deployment Yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: sonarr
  namespace: media
spec:
  selector:
    matchLabels:
      app: sonarr
  template:
    metadata:
      labels:
        app: sonarr
    spec:
      containers:
      - name: sonarr
        image: ghcr.io/linuxserver/sonarr:arm32v7-latest
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
        - containerPort: 8989

Deployment Results

kubectl get deployments -n media
NAME     READY   UP-TO-DATE   AVAILABLE   AGE
sonarr   1/1     1            1           37m

Ingress yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: sonarr-ingress
  namespace: media
  labels:
    name: sonarr-ingress
spec:
  rules:
  - host: sonarr.smrtrock.com
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: sonarr
            port: 
              number: 8989

Ingress description

kubectl describe ing sonarr -n media
Name:             sonarr
Namespace:        media
Address:
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
  Host                 Path  Backends
  ----                 ----  --------
  sonarr.smrtrock.com
                       /   sonarr:8989 (10.42.1.10:80)
Annotations:           <none>
Events:                <none>

Not sure what I am missing pretty new to k8s.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
Smrtrock
  • 11
  • 1
  • 2

1 Answers1

1

That's expected. default-http-backend is a place where all your request go if they DO NOT match any of your ingress rules. Most probably there was no this recourse in your nginx installation yamls for your exact version.

An Ingress with no rules sends all traffic to a single default backend. The defaultBackend is conventionally a configuration option of the Ingress controller and is not specified in your Ingress resources.

If none of the hosts or paths match the HTTP request in the Ingress objects, the traffic is routed to your default backend.

Might be interesting to check:

Vit
  • 7,740
  • 15
  • 40
  • Can we configure our own service as the default backend? For example to route it to a default application like a custom NGINX. – Marc Jan 22 '22 at 09:19