This document provides an overview of moving applications to Azure Kubernetes Service (AKS). It discusses microservices architecture and how containers can help deploy microservices. It introduces Docker and shows how to containerize an application. It then explains Kubernetes and its main objects like pods, services, replica sets and deployments. It demonstrates pushing container images to Azure Container Registry (ACR) and deploying the containerized application to an AKS cluster. The document aims to help understand microservices, containers, Kubernetes and how to leverage Azure services to deploy applications to AKS.
2. About Me
Name : Hussein Salman
Experience: I have over 12 years of experience in software development and architecture
Role: Manager at Avanade
Certifications: PMP, CSM, MCSD, MCSA Cloud and AWS Architect
http://husseinsalman.com
@husseinsalmann
3. Goals
• Overview of Microservices
• Containerize applications using Docker
• Understand main Kubernetes Objects
• Leverage Azure Services
• Push Docker images into Azure Container Registry
• Deploy application into Azure Kubernetes cluster
4. What are Microservices?
A software architecture style in
which complex applications are
composed of small,
independent processes
communicating with other using
language-agnostic APIs. These
services are small, highly
decoupled and focus on doing a
small task, facilitating a modular
approach to system-building.
[Figure 1 , martinfowler]
6. Monolithic Architecture Challenges
Scalability is compromised
Lack of Agility
(difficult to understand and modify)
Long-term commitment to
technology stack
Continuous Deployment
(To update one component, you have to
deploy the entire application)
Team Productivity
Reliability
(Single point of failure)
7. What about Microservice Challenges?
• Debugging is difficult
• Monitoring/Logging is difficult
• Distributed databases make transactions hard
• Distributed services adds more network communication
• Cluster and orchestration tools overhead
• Operational and tooling overhead on dev teams
• Increasing Deployment Complexities
11. Docker
Leading open-source containerization platform
Docker containers wrap up a piece of software in a
complete filesystem that contains everything it needs to
run: code, runtime, system tools, system libraries –
anything you can install on a server. This guarantees that it
will always run the same, regardless of the environment it
is running in.
Tools: Docker CLI, Docker Engine, Docker Swarm,
Docker Compose
16. Container Management at Scale
• Where to run the containers?
• How to manage them on multiple hosts?
• What happens if a host is down?
• How to keep them running despite of failure?
• What about scaling?
• How to update them?
• Where are the containers and how to connect?
20. Azure Kubernetes Service (AKS)
Managed Kubernetes Cluster in Azure:
• Control Plane Is free
• Pay only for worker nodes
• Same software and tooling for regular
K8
Easily Integrate with Azure Services:
• Security: RBAC and Azure AD integration
• Azure Monitor
• Virtual network integration
• Azure DevOps
21. Azure Container Registry (ACR)
Geo-replicationManage images for all
types of containers
Keep container
images close
Expand registry
functionality
23. Node
Pod
Container
Pod 1
Container 1
Pod 2
• The smallest and simplest unit in the Kubernetes
object model in terms of deployment and scaling
• Encapsulates container(s), storage, network IPs, and
deployment options
• Represent a running process in the cluster (Worker
Node)
• A group of one or more containers
• Containers within a pod share an IP address and port
space, and can find each other via localhost
Container 2
Container
Pod 1
25. Replica Set
Node
Front-end
Pod B
Front-end
Pod C
Replica Set
Replicas: 3
Template:
Front-end
Pod
Front-end
Pod A
• Ensures high availability
• A higher level concept that manages
multiple instances of the same pod
• Defining container images and how many
pod instances
• Responsible for reconciling desired state
and self-healing
Desired State
3
Actual State
32
26. Deployment
• A Deployment describes declarative updates for
Pods and Replica Sets
• Application deployment with zero downtime
• Updates happen in rolling fashing
• Deployment’s rollout history is kept in the
system so that you can rollback anytime
Replica Set
Pod
Container
Pod
Container ….
Deployment
Updates & Rollback
Scaling, self-healing
27. What type of object being defined
Application Yaml Files - Deployment
Pods are labeled app: web-ui
deployment use labels to find & manage pods
Specify instances of pod running
Listen on container port 80
Pull the image and run the container
Podtemplate
Give a name to the deployment
28. Application Yaml Files - Service
type of object being defined
Give a name to the service
Determine the set of the pods a service can target
us
Map incoming traffic on port 4200 to port 80 on pod
Select the service type