Azure AKS install guide
Table of contents
Deployment architecture
Prerequisites
Azure CLI installed and access configured
Docker installed locally and has access to Buzzy main and logging app image repositories (reach out Buzzy team for access to image repositories)
Three MonogDB databases including oplog database
Azure Storage Account - refer section 3 for deployment steps
Azure Application Gateway
Domain names and DNS for Buzzy main and logging apps
Container capacity
Minimum capacity for both Apps (Main and Logging) is 0.5 vCPU and 1 GB RAM. However, baseline capacity analysis and autoscaling rules are recommended.
Azure services used
Azure Virtual Network.
Azure Kubernetes Service (AKS).
Azure Container Registry (ACR).
Azure CLI & kubectl- manage Azure services & Kubernetes.
Azure Storage Service.
Azure Web Apps - to create an S3 compatible storage gateway.
Azure DNS and Application Gateway.
Blob storage containers
Minio app is deployed as S3 compatible storage gateway to connect storages created in Azure cloud. As Buzzy application requires two S3 compatible storage buckets, let’s create two blob storage containers using Azure Storage Service.
Add an Azure storage account
As the initial step, you may add a new “Resource Group” if you wish to have a separate resource group in your Azure subscription. Click on the “Create a resource” button in Azure portal home page and then search for “Resource group” to add a new resource group. Make sure you use the same resource group for each resource creation performed under this deployment. Again, click on the “Create a resource” and search for “Storage account” to add a new Storage account.
Add CORS configuration
For the Storage account you created above, Add CORS configuration using “CORS” option under “Settings” and add the configuration as seen in the screen below:
Add two blob storage containers and permissions
Click “Containers” in the Overview page of this storage account. And then add two blob containers with any given names. Add access to each storage container using access policies as seen in the screen below:
Configure one storage container for anonymous user read access. To grant an anonymous user read access for the nominated blob container, navigate to the Blob service and select the public container. Use “Change access level” option to open “Public access level” dropdown list. Select “Container (anonymous read access for containers and blobs)” and then click “OK” as seen in below:
Create S3 compatible storage gateway app
Now that you have created Azure storages above, continue to deploy the Minio S3 compatible app in Azure App services using the below quick reference guide. Minio app performs as a storage gateway between Buzzy apps and two storage containers created. Refer to Minio app deployment guide and note down S3 endpoint, Access Key and Secret Key after completing the Minio app deployment. These three values will be required by Kubernetes YML deployment performed in below sections.
Import Buzzy images into Azure container registry
This deployment uses Azure Container Registry (ACR) as the private container registry storing image repositories for Buzzy main and logging apps. It is also possible to directly pull images into Kubernetes nodes by importing your Docker Hub credentials (refer to Kubernetes documentation).
Deploy and Attach Azure Container Registry (ACR)
This deployment can be done via the Azure portal or Azure CLI.
Using Azure portal;
a. Click “Create a resource” button and search for “Container Registry”.
b. Click the “Create” button and follow the wizard to complete the registry creation using the same resource group created previously.
Refer Azure tutorial to create an ACR using Azure CLI.
c. Login to Azure Container Registry and integrate with AKS using below command.
Import Buzzy images to ACR repositories
Complete this step to import two images from Docker hub’s Buzzy image repositories shared with you by Buzzy team.
Run this command using Azure CLI to import Bussy main app image:
Refer to Azure documentation for image import instructions.
Deploy Azure Kubernetes Cluster
Azure Kubernetes Cluster is deployed using Azure Kubernetes Service. Login to Azure portal and click “Create a resource” button and then search for Kubernetes Service. You will be given options to select the resource group, node pool and node size during the deployment wizard depending on your availability, scalability and capacity requirements. This deployment enables load balancing service by default. Refer to Azure documentation for Kubernetes cluster deployment.
Integrate ACR repositories into AKS service
Once Kubernetes cluster deployment is completed, two container image repositories created previously have to be integrated prior to application deployment. Run this command using Azure CLI to integrate the registry:
$ az aks update -n your-cluster-name -g your-resource-group –attach-acr your-buzzy-acr-name
Refer to Azure documentation for container repository integration.
Buzzy main app deployment
You may refer to the sample Buzzy main app YML file below and make changes according to your deployment specifications and AKS cluster configurations. Make sure to change server domain names, URLs and other object/service names according to your own values.
Run following Kubectl command (kubectl is already installed when you installed Azure CLI):
Refer to CheatSheet for kubectl command help.
You might need to run this delete command, and then re run the create command if any errors received:
Run this command to review the status of Buzzy main app’s pod deployment progress:
Run this command to get load balancer IP address:
Or for detailed output:
Sample Buzzy main app YML file:
Buzzy Logging app deployment
Refer to sample Buzzy logging app YML file below and make changes according to your deployment specifications and AKS cluster configurations. Make sure to change server domain names, URLs and other object/service names according to your own values.
Run following Kubectl command ( Kubectl is already installed when you installed Azure CLI):
Refer to CheatSheet for kubectl command help.
Run this command to review the status of Buzzy logging app’s pod deployment progress:
Run this command to get load balancer IP address:
Or for detailed output:
Sample Buzzy logging app YML file:
DNS and HTTPS
DNS management
You can use Azure DNS or any third-party DNS tools to manage DNS records to resolve load balancer IPs for both app services.
Load balancer with HTTPS
The standard default load balancer created by AKS is a layer 4 load balancing and doesn’t support SSL offloading. To achieve this you may have to deploy an ingress controller that will direct from the routing rules on an external Application Gateway based on ingress rules. The following options can be implemented for a production grade deployment.
NGINX Ingress controller with cert-manager to generate your certificate. Refer to Azure documentation.
Application Gateway to manage your own routing rule that will point to the default layer 4 load balancer created by AKS. Refer to Azure documentation.
Last updated