<p>I've deployed my Django/React app into K8s and exposed both deployments as a service (ClusterIP).
Whenever I try to call the API service through its ClusterIP:8000, it sometimes refuses the connection. So I checked its endpoints and only one out of the three existing endpoints returns what I expect. I understand that when calling the ClusterIP, it redirects to one of those three endpoints.</p>
<p>Is there any way to 'debug' a incoming service request? Can I modify the amount of existing endpoints (so I could limit it to the only working endpoint)? Is there any other way to maybe see logs of the service to find out why only one of the endpoints is working?</p>

<p>I was able to fix it:</p>
<p>I deployed a three-tier-application (Django/React/DB) and used the same selector for every deployment, like this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-xxx-deployment
  labels:
    app: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
</code></pre>
<p>So when exposing this with <code>&quot;kubectl expose deployment/...&quot;</code> it created as many endpoints as equal selectors were found in the deployment. Since I have three deployments (DB/React/Djagno), three endpoints were created.</p>
<p>Changing the deployment .yaml like this fixed my error and only one endpoint was crated:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: myapp-web
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mapp-web
</code></pre>
