Host multiple .Net Core websites in a single AKS

3/23/2020

I'm able to setup a docker-compose script to run multiple .Net Core website containers on my local docker windows. I'm able to access to each of the websites locally by specifying a different port number

    version: '3'
    services:
      booking:
        image: "local/booking:1.0"
        ports:
          - "7081:80"
      engine:
        image: "local/engine:1.0"
        ports:
          - "7082:80"

I tried to run the containers in AKS using a different port but fail. The only reference I'm able to find to host multiple containers using Basic Controller or HTTP(s) Application Routing.

Is it possible to run multiple containers (that use port:80) in a single AKS and publicly accessible using different port numbers?

-- WenHao
azure
azure-kubernetes
kubernetes

2 Answers

3/23/2020

Yes, it very much is. I suggest you start to read up on Ingress Controllers. There is a basic tutorial here. This describes exactly your scenario with multiple pods running on port 80 and exposing APIs.

Or, if you are fine running them on different ports, its even easier by using Kubernetes Services (with Azure Load Balancer).

-- silent
Source: StackOverflow

3/23/2020

Yes, you are able to do it by just configuring an Ingress Controller. As oppose to what @silent said, I would recommend you to consider to use an Azure Application Gateway as Ingress Controller for your AKS cluster. Please have a look at this article that explains you how to quickly and easily configure it. Hope it helps.

-- Hugo Barona
Source: StackOverflow