Skip to main content

Highly scalable multi-container apps using AKS

Earlier I had written a series of posts on how to build a Continuous Deployment pipeline along with Continuous Integration for multi-container application using Docker and Visual Studio Team System (VSTS). Today I begin a new series of posts about building highly scalable application using Docker. While the earlier series was using Docker Swarm as an Orchestration Engine running in Azure Container Service (ACS), this series will be based on the Azure Container Service (AKS). AKS provides Kubernetes as managed service in Azure.

One of the reason for moving away from Docker Swarm is based on the recent announcement from Microsoft that Kubernetes is available as a new managed service. Kubernetes is becoming a de facto standard for container orchestration. Although Azure will support existing Docker Swam & DC OS cluster deployments, the future seems to be moving in the direction of Kubernetes.

Pre-requisites

I will be building this demo on top of the previous codebase. The pre-requisites mentioned in the earlier series are applicable here as well like VSTS account for Continuous Integration, Github as source code management tool, DockerHub account for storing Docker images. In fact I will be reusing the CI pipeline built in the earlier series to push images to DockerHub. The major change is the Azure subscription with the right privileges to create Kubernetes cluster.

What to expect during this series?

I will be focusing more on Azure Container Service features during this series. Some of the things I intend to cover include

  • Provision Kubernetes cluster using AKS preview
  • Understand concepts related to Kubernetes like namespace, pods and deployments, service etc.
  • Deploy multi-container app to Kubernetes cluster
  • Use Init Containers for managing dependent services across multiple containers
  • Use Persistent Volumes (PV) and Persistent Volume Claims (PVC) with SQL Server 2017 on Linux with Azure Disk
  • Manage Secrets in Kubernetes
  • Manually Scale services using Kubernetes
  • Manage secrets using Azure Key Vault
  • Auto scale services using Kubernetes
  • Monitor containers using Prometheus and Grafana
  • Extend Kubernetes features using supporting tool like Helm, Istio etc

For now the list seems quite long. I am sure as I go along more tools and concepts will be clear and I will share them along the way.

Quick overview of the application

Application overview

The demo application we will be using is built on ASP.NET Core framework and has a MVC front end and a basic web API. There is also SQL Server 2017 on Linux which acts as a persistent storage. All these 3 components are running inside Docker containers. As we go along we might add new features to the application which will help to showcase the power of Docker and Kubernetes along with key services provided by Azure.

I am excited to take this journey and hope the readers will also find it interesting. Get ready to play around with the Kubrnetes CLI using kubectl. Feel free to add any other related topic using the comments section and I will be happy to accommodate them during this series.

Until next time code with passion and strive for excellence.

Comments

Popular Posts

Unit Test Application Configuration Settings

BackgroundAll the post I had written this month so far were related to the Entity Framework learning series. This time I thought of taking a diversion and share a quick method of unit testing setting which might be stored in the Application Configuration file (App.config) of a DotNet application. Unit Test Application Configuration SettingsLets fire up Visual Studio and create a simple console application. You can name it whatever you want. I have named the project as AppConfigTest. Once the project is created right click on Add and select Add New Item option in the solution explorer window. Select Application Configuration File option and click Add. This will automatically name the new file as App.config.Since this file used to configure settings at application level there is a possibility of someone changing these setting unknowingly. It can lead to severe problems later. It might also happen that the settings are different in different environments like development machines, test s…

Integrate SQL Server 2017 Linux with ASP.NET Core using Docker

In the previous post, we saw how to initialize a SQL Server 2017 on Linux database running inside Docker container. This post is continuation of my exploration about Docker containers for stateful applications. In this post we will explore how to integrate the SQ Server 2017 on Linux container with ASP.Net Core Web API also running inside a Docker container. We will perform following activitiesUpdate Docker compose file to build the SQL server imageUpdate Web API project to use SQL Server Database instead of In memory databaseBuild and run the application containers using Docker compose commandsQuery Data from SQL container using the MVC web front endUpdate Docker compose file to build the SQL server imageDocker provides Docker Compose as a tool for defining and running multi-container Docker applications. I already have an existing docker compose file which I have been using for my series of post on implementing continuous deployment of multi container apps. In a compose file we defi…

Setup MacBook almost at the speed of light

BackgroundI bought a new MacBook recently. It is always fascinating to setup your new machine. But it is also a pain to look for all the tools that you have on your old machine and port it to the new machine. Sometime back I started learning abount Ansible which helps to automate routine tasks. I came across a blog by Jeff Geerling who is the author of book Ansible for DevOps. Jeff and many others had used Ansible to setup their machines. I took inspiration from these guys blogs to automate the process of setting up a new MacBook Pro. Here is my experience.Why Ansible?Ansible is very easy to understand. It uses human readbale YAML syntax to describe the different actions which needs to be performed. Group of Ansible actions which are executed as part of a playbook are idempotent. It does not have a side effect on the setup. The same playbook can be run multiple times. Only the changes will be applied incrementally.
How did I use Ansible?I started off by cloning the Git repository of Ge…