Deploy eshopOnContainers to AKS

Gayan Fonseka
5 min readOct 27, 2020

Yes, you might be wondering, Gayan there is a guide that describes how to deploy this, so why are you explaining here. My intention was to do something else with this sample but then firstly I wanted to make sure it could be deployed and run as expected before changing anything. That is when I realized I had to do some stuff and also needed little more knowledge than Docker, Docker-compose, Kubernetes, Helm, and Powershell 😨 to get this running. Also, I saw a ticket of the same problem closed without a resolution, and hence this article for anyone looking for help.

The deployment guide is linked for you to follow. My machine is up to date and I wasn’t going to use any particular version as mentioned at the beginning of the guide. In terms of creating the cluster in Azure Kubernetes Service, I used the UI, and in the process even though I had the option to select Kubernetes 1.16, I went with the default which was 1.17 at the time of writing.

Fun Begins

So I cloned the repo and started the deployment with the following command. If you are running it from any mac, you need to run the pwsh command and be in PowerShell, before you execute the following command.

.\deploy-all-mac.ps1 -externalDns aks -aksName <aks-cluster-name> -aksRg <resource-group-name> -imageTag linux-dev -useMesh $false

In the process, I was getting the same error mentioned in the ticket as shown below.

The error from chart -apigwms & apigwws

Error: unable to build kubernetes objects from release manifest: error validating “”: error validating data: [ValidationError(ConfigMap.data.admin): invalid type for io.k8s.api.core.v1.ConfigMap.data: got “map”, expected “string”, ValidationError(ConfigMap.data.static_resources): invalid type for io.k8s.api.core.v1.ConfigMap.data: got “map”, expected “string”]

As you can see the error was coming from ConfigMap.data.admin and Configmap.data.static_resources and the original file from the source looked something like below and the culprit had to be there.

With the areas marked

It had to be the same issue with apigwms as well, as per the error message. It looked all good until I came across the following example from envoy site. Also part of the error message suggesting “got map expected string” made me curious and wanted to make the following change to my file.

Going ahead with this clue, I made the change to both the envoy.yaml files in helm charts for apigwms and apigwws. After the change, the files would look like below.

After changing both the files to reflect the change, went ahead, and tried the deployment again. Hurrah….this time the deployment was successful and no error messages. Just checked to ensure that the deployment was ok.🚀

Then double-check from the Azure portal as well.

Right, now I should be able to access the site and I was having difficulty finding the service to be accessed, as mentioned in the guide.

  • WebStatus: http://[eshop.<your-guid>.<region>.aksapp.io]/webstatus
  • WebMVC: http://[eshop.<your-guid>.<region>.aksapp.io]/webmvc
  • WebSPA: http://[eshop.<your-guid>.<region>.aksapp.io]/

Now another search begins and not to mention that I had done some decent reading on AKS prior to this. Here comes the surprise, on top of the resource group that I had created, Azure creates its own, related to my cluster giving its own resource group name.

Then went on to find what is there in the auto-created resource group to find the below in the FAQ section.

“Why are two resource groups created with AKS?

AKS builds upon a number of Azure infrastructure resources, including virtual machine scale sets, virtual networks, and managed disks. This enables you to leverage many of the core capabilities of the Azure platform within the managed Kubernetes environment provided by AKS. For example, most Azure virtual machine types can be used directly with AKS and Azure Reservations can be used to receive discounts on those resources automatically.

To enable this architecture, each AKS deployment spans two resource groups:

  1. You create the first resource group. This group contains only the Kubernetes service resource. The AKS resource provider automatically creates the second resource group during deployment. An example of the second resource group is MC_myResourceGroup_myAKSCluster_eastus. For information on how to specify the name of this second resource group, see the next section.
  2. The second resource group, known as the node resource group, contains all of the infrastructure resources associated with the cluster. These resources include the Kubernetes node VMs, virtual networking, and storage. By default, the node resource group has a name like MC_myResourceGroup_myAKSCluster_eastus. AKS automatically deletes the node resource whenever the cluster is deleted, so it should only be used for resources which share the cluster’s lifecycle.”

Now I know where to look to get the guid to access the pod (the site) and be able to see it running. Yes, it is in the auto-created resource group,

See me access the site,

Have fun and explore AKS with all the Kubectl commands you know. 😃

--

--