Wednesday, September 13, 2017

Multi Container Applications Using Azure Container Service

Azure Container Service:   As  the  usage  of  containers  increase  in enterprise,  one  important  aspect  of  it  is  the  production  class  clustering  of  containers  and  provide  an  architecture  to  host the containerized  applications.  In  this  context  Azure Container Service   provides   pre  configured  templates  and  built  in  components  to  create, manage  and  configure clustered  virtual machines,  ready  to  run containerized applications. 

Azure Container  Service   supports  3  popular   container  orchestration  platforms  to  host  containerized  applications.
  • DC/OS  which  is a distributed operating system based on the Apache Mesos distributed systems kernel
  • Docker Swarm which provides native clustering for Docker
  • Kubernetes  which is a popular open-source, production-grade container orchestrator tool.
The  good  thing  with  Azure  Container Service  is  that  it  provides  a  common  template for all these 3 major platforms  and  with a  switch  of a  single  parameter  complete  environment  can be deployed.  The  following  code piece  shows that  aspect.  The  3 parameter  values are self explanatory.

orchestratorType": {
      "type": "string",
      "defaultValue": "Kubernetes",
      "allowedValues": [
        "Kubernetes",
        "DCOS",
        "Swarm"
      ],
      "metadata": {
        "description": "The type of orchestrator used to manage the applications on the cluster."
      }
    }

Organizations  with  existing  investment  in Azure  Services  are  better  to  handle  the  Azure Container Services,  because  these  container  orchestration  platforms  are  built  using  Azure components  only, and  no  need  to  learn any  additional  networking  or clustering  concepts. For example  the  following  Azure  Services /  Components  are  created  when  deploying a DCOS/Swarm/Kubernetes Cluster.
  • Vitual Machine Scale Set  :  This  provides  Elastic Scaling  for  Agent  Nodes.
  • Availability Set  :  Provides  High Availability for  Master Nodes
  • Load Balancer :  Provides  Load  Balancing  Across  Nodes
  • Network Security Group :  Provides  various  access controls  for  Nodes
  • Network, Storage, Virtual Machines  :  Traditional  Components.
Multi Container Applications :

While  the  container  orchestration  platforms   are meant  for  deploying  any  container,  a  typical application  architecture  will  involve  many  containers  that  are  tied  together. This is  typically known as  Multi Container  Application.  The  following  are  typical  multi  container  frameworks that  Azure  Container Service  supports.

Docker Compose,   is  the  Multi Container  framework  to  be  deployed  on  Docker  Swarm Clusters. Azure Container  Service  supports  Docker  Compose.  The  following code snipper (Courtesy  From Microsoft Azure Site)  gives a  simple view  of  multi container application using Docker Compose.  As  evident  it  uses  two  containers that  are connected.

web:
  image: adtd/web:0.1
  ports:
    - "80:80"
  links:
    - rest:rest-demo-azure.marathon.mesos
rest:
  image: adtd/rest:0.1
  ports:
    - "8080:8080"


Kubernets Service Config ,   is  the  multi container  framework to be deployed on Kubernetes cluster on ACS.  The  following  example  from  Azure  GitHub page  provides a  multi container application  that  can  be  deployed  to  Azure  Container Service  using  kubectl  command line.

guestbook-all-in-one.yaml

DC/OS  also  supports  multi  container  applications  using  an option called  PODS. Azure  supports  deployment  into DC/OS  using  marathon REST API.  The  following  link shows how to create a POD  with multiple containers.

DCOS Multi Containers

While Azure  Container Service documentation DCOS  provides  deployment  of a  single container using Marathon,  the  above  multi container  application is also expected to  work.

So with  these  options  it  is  much  easier  for organizations  to  switch to container based  application development  and  subsequent  deployment  for  production  into Azure Container Service.

No comments:

Post a Comment