<p>Battling with Kubernetes manifest on Azure.  I have a simple api app running on port <code>443 (https)</code>. I simply want to run and replicate this app 3 times within a kubernetes cluster with a load balancer.</p>

<p><strong>Kubernetes cluster:</strong></p>

<p><a href="https://i.stack.imgur.com/iEcVT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iEcVT.png" alt="Kubernetes cluster figure"></a></p>

<p>My manifest file:</p>

<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: apiApp
spec:
  replicas: 3
  template:
   metadata:
   labels:
   app: apiApp
spec:
  containers:
  - name: apiApp
    image: {image name on Registry}
    ports:
    - containerPort: 443
      hostPort: 443
---
apiVersion: v1
kind: Service
metadata:
  name: apiApp
spec:
  type: LoadBalancer
  ports:
  - name: https
    port: 443
    targetPort: 443
  selector:
    app: apiApp
</code></pre>

<p>In the above manifest the loadbalancer does not seem to find the app on port 443 within the container.</p>

<p>1) How can I create this manifest to link load balancer to port 443 of the  containers and also expose the load balancer to the outside world on port 443.</p>

<p>2)How would manifest look like in multi cluster environment (same conditions as above)</p>

JTM
<p>For your issue, I did the test with the load balancer follow the document <a href="https://learn.microsoft.com/en-us/azure/aks/kubernetes-walkthrough" rel="nofollow noreferrer">Deploy an Azure Kubernetes Service (AKS) cluster</a>.</p>

<p>This example only has one pod, so I scale up the pod in to 3 with the command <code>kubectl scale --replicas=3 deployment/azure-vote-front</code>. The yaml file about scales and Load Balancer will like the screenshot below.</p>

<p><a href="https://i.stack.imgur.com/UdQku.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UdQku.png" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/c5JmF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c5JmF.png" alt="enter image description here"></a></p>

<p>When the Cluster finish, I can access the service from Internet via Web Browse. And you can use the command <a href="https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-browse" rel="nofollow noreferrer"><code>az aks browse</code></a> to go into the Kubernets dashboard to get a overview of the Kubernets Cluster.</p>

<p><strong>Update</strong></p>

<p>The Azure Kubernets Cluster is just a resource group like below and so as the load balancer:
<a href="https://i.stack.imgur.com/tRC3x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tRC3x.png" alt="enter image description here"></a></p>
