<p>Given a Spring Boot application with docker-compose.yaml:</p>

<pre><code>version: '3'
services:
  my-ws:
  build: .
  image: my-ws
   container_name: my-ws
   ports:
        - "8080:8080"
</code></pre>

<p>And kubernetes manifest:</p>

<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: my-ws
spec:
  replicas: 3
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  minReadySeconds: 5
  template:
    metadata:
      labels:
        app: my-ws
    spec:
      containers:
      - name: my-ws
        image: myacr.azurecr.io/my-ws:v1
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 250m
          limits:
            cpu: 500m
---
apiVersion: v1
kind: Service
metadata:
  name: my-ws
spec:
  loadBalancerIP: &lt;redacted&gt;
  type: LoadBalancer
  ports:
    - port: 8080
  selector:
    app: my-ws
</code></pre>

<p>We can successfully deploy on Azure Kubernetes Service and the application responds on port 8080. We would like to have it respond on port 80. We have tried changing docker-compose.yaml ports to:</p>

<pre><code>ports:
     - 80:80
</code></pre>

<p>and the manifest:</p>

<pre><code>- containerPort: 80
...
-port: 80
</code></pre>

<p>and redeploying. The deployment succeeds, but the app is not available on either 8080 or 80. </p>

Paul Croarkin
<p>you need to map service port 80 to container port 8080, thats the easiest solution (and least disruptive):</p>

<pre><code>---
apiVersion: v1
kind: Service
metadata:
  name: my-ws
spec:
  type: LoadBalancer
  ports:
    - port: 80
      targetPort: 8080
  selector:
    app: my-ws
</code></pre>

<p>ps. leave everything else as it was before changes</p>
