<p>I am able to access my django app deployment using LoadBalancer service type but I'm trying to switch to ClusterIP service type and ingress-nginx but I am getting 503 Service Temporarily Unavailable when I try to access the site via the host url. Describing the ingress also shows <code>error: endpoints &quot;django-service&quot; not found</code> and  <code>error: endpoints &quot;default-http-backend&quot; not found</code>. What am I doing wrong?</p>
<p>This is my service and ingress yaml:</p>
<pre><code>---
apiVersion: v1
kind: Service
metadata:
  name: django-service
spec:
  type: ClusterIP
  ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: 8000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: django-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
    nginx.ingress.kubernetes.io/ssl-redirect: 'true'
spec:
  tls:
  - hosts:
    - django.example.com
  rules:
  - host: django.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: django-service
            port:
              number: 80
  ingressClassName: nginx
</code></pre>
<p>kubectl get all</p>
<pre><code>$ kubectl get all
NAME                                        READY   STATUS    RESTARTS   AGE
pod/django-app-5bdd8ffff9-79xzj             1/1     Running   0          7m44s
pod/postgres-58fffbb5cc-247x9               1/1     Running   0          7m44s

NAME                     TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/django-service   ClusterIP   10.233.29.58    &lt;none&gt;        80/TCP     7m44s
service/pg-service       ClusterIP   10.233.14.137   &lt;none&gt;        5432/TCP   7m44s

NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/django-app             1/1     1            1           7m44s
deployment.apps/postgres               1/1     1            1           7m44s

NAME                                              DESIRED   CURRENT   READY   AGE
replicaset.apps/django-app-5bdd8ffff9             1         1         1       7m44s
replicaset.apps/postgres-58fffbb5cc               1         1         1       7m44s
</code></pre>
<p>describe ingress</p>
<pre><code>$ kubectl describe ing django-ingress
Name:             django-ingress
Labels:           &lt;none&gt;
Namespace:        django
Address:          10.10.30.50
Default backend:  default-http-backend:80 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
TLS:
  SNI routes django.example.com
Rules:
  Host                      Path  Backends
  ----                      ----  --------
  django.example.com
                            /   django-service:80 (&lt;error: endpoints &quot;django-service&quot; not found&gt;)
Annotations:                nginx.ingress.kubernetes.io/force-ssl-redirect: true
                            nginx.ingress.kubernetes.io/rewrite-target: /
                            nginx.ingress.kubernetes.io/ssl-redirect: true
Events:
  Type    Reason  Age                   From                      Message
  ----    ------  ----                  ----                      -------
  Normal  Sync    5m28s (x2 over 6m5s)  nginx-ingress-controller  Scheduled for sync
  Normal  Sync    5m28s (x2 over 6m5s)  nginx-ingress-controller  Scheduled for sync
</code></pre>

<p>I think you forgot to make the link with your deployment in your service.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: django-service
spec:
  type: ClusterIP
  ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: 8000
  selector:
    app: your-deployment-name
</code></pre>
<p>Your label must be set in your deployment as well:</p>
<pre><code>spec:
  selector:
    matchLabels:
      app: your-deployment-name
  template:
    metadata:
      labels:
        app: your-deployment-name
</code></pre>
