<p>I am trying to develop an application on kubernetes with hot-reloading (instant code sync). I am using <a href="https://github.com/loft-sh/devspace" rel="nofollow noreferrer">DevSpace</a>. When running my application on a minikube cluster, everything works and I am able to hit the ingress to reach my FastAPI docs. The problem is when I try to use devspace, I can exec into my pods and see my changes reflected right away, but then when I try to hit my ingress to reach my FastAPI docs, I get a 502 bad gateway.</p>
<p>I have an <code>api-pod.yaml</code> file as such:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: project-api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: project-api
  template:
    metadata:
      labels:
        app: project-api
    spec:
      containers:
        - image: project/project-api:0.0.1
          name: project-api
          command: [&quot;uvicorn&quot;]
          args: [&quot;endpoint:app&quot;, &quot;--port=8000&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;]
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /api/v1/project/tasks/
              port: 8000
            initialDelaySeconds: 5
            timeoutSeconds: 1
            periodSeconds: 600
            failureThreshold: 3
          ports:
            - containerPort: 8000
              name: http
              protocol: TCP

---
apiVersion: v1
kind: Service
metadata:
  name: project-api
spec:
  selector:
    app: project-api
  ports:
    - port: 8000
      protocol: TCP
      targetPort: http
  type: ClusterIP
</code></pre>
<p>I have an <code>api-ingress.yaml</code> file as such:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: project-ingress
spec:
  rules:
    - http:
        paths:
          - path: /api/v1/project/tasks/
            pathType: Prefix
            backend:
              service:
                name: project-api
                port:
                  number: 8000
  ingressClassName: nginx

---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
  name: nginx
spec:
  controller: k8s.io/ingress-nginx
</code></pre>
<p>Using <code>kubectl get ep</code>, I get:</p>
<pre><code>NAME          ENDPOINTS         AGE
project-api   172.17.0.6:8000   17m
</code></pre>
<p>Using <code>kubectl get svc</code>, I get:</p>
<pre><code>NAME          TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
project-api   ClusterIP   10.97.182.167   &lt;none&gt;        8000/TCP   17m
</code></pre>
<p>Using <code>kubectl get ingress</code> I get:</p>
<pre><code>NAME          CLASS   HOSTS   ADDRESS          PORTS   AGE
api-ingress   nginx   *       192.168.64.112   80      17m
</code></pre>
<p>to reiterate, my problem is when I try reaching the FastAPI docs using <code>192.168.64.112/api/v1/project/tasks/docs</code> I get a 502 bad gateway.</p>
<p>Im running:</p>
<pre><code>MacOS Monterey: 12.4
Minikube version: v1.26.0 (with hyperkit as the vm)
Ingress controller: k8s.gcr.io/ingress-nginx/controller:v1.2.1
Devspace version: 5.18.5
</code></pre>

DataPlug
<p>I believe the problem was within DevSpace. I am now comfortably using <a href="https://github.com/tilt-dev/tilt" rel="nofollow noreferrer">Tilt</a>. Everything is working as expected.</p>
