Skip to main content

Highly scalable multi-container apps using AKS

Background

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…

Build custom SQL Server 2017 Linux Docker image

BackgroundIn the earlier series of posts on continuous deployment of multi-container apps, I had used two containers for ASP.Net Core MVC web site and ASP.Net Core Web API. This post is a sort of continuation. In the earlier version we were using in memory database to store the data. This approach is useful in a proof of concept or a quick demo application. In an enterprise scenario we would use some sort  of persistent data store to store the data. It is very easy to containerize the stateless services and web front ends. When we move towards stateful processing, things start to get interesting.Containers by their very nature are supposed to be ephemeral. This means that containers can be stopped and destroyed and a new one built and put in place with minimum setup and configuration. If we destroy the container and replace it with a new one what happens to the data stored inside the container? Can we use containers to run database related processes? How can the stateless containers c…

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…