<p>I am trying to deploy an app having 3 services - frontend (Angular), backend 1 (Java/Micronaut), and backend 2 (Java/Micronaut).</p>
<p>My frontend works properly but the Java apps are not working.</p>
<p>Sometimes, I observed it started after 20 min. of deploying a Java app, but this time it does not work even after 1 hr.</p>
<p>Deployment, pod service - all are in running state in Kubernetes, but when I try to hit the URL I see below error:</p>
<p><a href="https://i.stack.imgur.com/bkXKw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bkXKw.png" alt="enter image description here" /></a></p>
<blockquote>
<p>deployment.yaml for java app</p>
</blockquote>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: authentication-deploy
  labels:
    name: authentication-deploy
    app: supply-chain-app
spec:
  replicas: 1
  selector:
    matchLabels:
      name: authentication-pod
      app: supply-chain-app

  template:
    metadata:
      name: authentication-pod
      labels:
        name: authentication-pod
        app: supply-chain-app
    spec:
      containers:
        - name: authentication
          image: cawishika/authentication-service:1.1
          ports:
            - containerPort: 80
</code></pre>
<blockquote>
<p>service.yaml for java app</p>
</blockquote>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: authentication-service
  labels:
    name: authentication-service
    app: supply-chain-app
spec:
  type: NodePort
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30006
  selector:
    name: authentication-pod
    app: supply-chain-app
</code></pre>
<blockquote>
<p>Docker file</p>
</blockquote>
<pre><code>FROM adoptopenjdk/openjdk11:latest
EXPOSE 8002
ADD target/authentication-service-0.1.jar authentication-service-0.1.jar
ENTRYPOINT [&quot;java&quot;, &quot;-jar&quot;, &quot;/authentication-service-0.1.jar&quot;]
</code></pre>
<p>kubectl logs podname
<a href="https://i.stack.imgur.com/BpNfp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BpNfp.png" alt="enter image description here" /></a></p>

Ishika Jain
<p><a href="https://i.stack.imgur.com/GT8c6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GT8c6.png" alt="server running" /></a></p>
<p>Your Dockerfile is exposing port <code>8002</code> (<code>EXPOSE 8002</code>), but your app is started on port <code>8080</code>.</p>
<p>Additionally, your Kubernetes configuration is pointing to port <code>80</code> of your pod.</p>
<p>You should set it so that all three configurations use the same port.</p>
