<p>This is my template:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: fastapi
  labels:
    app: fastapi
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fastapi
  template:
    metadata:
      labels:
        app: fastapi
    spec:
      containers:
        - name: fastapi
          image: datamastery/fastapi
          ports:
            - containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
  name: fastapi-service
spec:
  selector:
    app: fastapi
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 5000
      targetPort: 5000
      nodePort: 30002
</code></pre>
<p>I use a custom fastapi Docker image, which works fine locally. If I understand it correctly, I can expose my Service to the outside world on port 30002.</p>
<p>I run <code>minikube service fastapi-service</code> and a new Browsertab opens with the following URL: <code>http://192.168.49.2:30002</code>. Unfortunately nothing is shown. I tried the internal URL (<code>http://127.0.0.1:55202</code>) which also does not work, as expected. Am I doing here something wrong with Kubernetes or might my app be the issue? Does anyone see something I miss here?</p>

Data Mastery
<p>From the my sandbox logs, it seems like its listening on port <code>3000</code></p>
<pre><code>INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)

</code></pre>
<p>so change the port from <code>5000</code> to <code>3000</code></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: fastapi
  labels:
    app: fastapi
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fastapi
  template:
    metadata:
      labels:
        app: fastapi
    spec:
      containers:
        - name: fastapi
          image: datamastery/fastapi
          ports:
            - containerPort: 3000
---
apiVersion: v1
kind: Service
metadata:
  name: fastapi-service
spec:
  selector:
    app: fastapi
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 5000
      targetPort: 3000
      nodePort: 30002
</code></pre>
<p><a href="https://i.stack.imgur.com/O8CEX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O8CEX.png" alt="enter image description here" /></a></p>
