MicroServices with
Containers, Kubernetes &
ServiceMesh
Akash Agrawal | 11-10-2019
Agenda
● Understanding MicroServices
● Understanding Containers / Kubernetes / GKE / ServiceMesh
● Combine: Containers / Kubernetes / GKE / ServiceMesh for MicroService
Architecture
About Me
● Having 11+ years of experience in IT Industry
● Previously I worked with various clients like Sabre Travel Technologies /
Citi Bank / Goldman Sachs / L&T Infotech etc.
● From last couple of years, I work as Independent Consultant:
○ I work with different startups helping them to design/improve their solutions
around Kubernetes & Cloud (as Technical Adviser / Architect)
○ Trainer around Cloud & Kubernetes Ecosystem
● I am Google recognized expert for Google Cloud Platform called Google
Developer Expert (GDE)
Understanding MicroServices
MicroServices
● Bunch of Services (Application Components) interact with each other to
provide a business capability
● Represent a Distributed System
● Services are Independent, Isolated
MicroServices
Source: https://3.bp.blogspot.com/-
KuuEG5UU4Bc/Vs9aXomwtUI/AAAAAAAAET
g/TkeZI7_7GV8/s1600/presentationMicroservic
eArchitecture.jpg
12 Factor Applications
● Website: https://12factor.net/
● Define the guidelines for building Applications in MicroService Architecture
Codebase Port Binding
Dependencies Concurrency
Config Disposability
Backing Services Dev/Prod Parity
Build/Release/Run Logs
Process Admin Process
Structuring/Restructuring MicroServices
● This decomposition can be designed around:
○ Functional decomposition
○ Technical decomposition
MicroServices Challenges
● Since there are so many moving parts in MicroServices, it comes with
complexity & challenges:
○ Isolation
○ Orchestration & Elasticity (Scaling Out & Scaling In)
○ Traffic - Control / Visibility / Security
Understanding Containers /
Kubernetes / GKE / ServiceMesh
Containers
● Kind of Sandbox
● Package your application & it’s dependencies (application dependencies)
● Container Images, Containers, Container Runtime
● Built around Linux features like namespace, shared kernel etc.
● Container Runtimes: Docker, Rkt etc.
Docker
● Docker is a open source platform for developers and sysadmins to
develop, deploy and run applications with containers (called containerized
applications)
● It works on the principle of Build/Ship/Run:
○ Build: Build Container Images on local Laptop or automate it through Continuous
Integration Pipeline
○ Ship: Ship Container Images through Container Registry e.g. DockerHub, DTR, GCR, ECR
etc.
○ Run: Run anywhere on Cloud/On-Prem etc.
Docker (or Docker Engine) Architecture
● Docker follows Client-Server Architecture
● Components:
○ Server: Long Running Program/Daemon (dockerd, /usr/bin/dockerd)
○ Rest API: Interfaces that can be used to talk to Daemon
○ Client: Command Line Interface (docker, /usr/bin/docker)
● Client & Server talks through REST apis over Unix Sockets
(/var/run/docker.sock) or a Network Interface
Docker Architecture
Kubernetes Overview
● Kubernetes is an Open Source system for Container Orchestration
(Deployment/Management/Scaling)
● Focused around:
○ Scheduling
○ Scaling (Manual/Auto) - Out/In
○ Self Healing / Auto Repairing
Kubernetes Flow
Source: https://software.danielwatrous.com/wp-content/uploads/2017/02/kubernetes-overview.png
Kubernetes Resources/Objects
● Pod (Single/Multi Container Pod)
● Service (ClusterIP/NodePort/LoadBalancer)
● Controller Objects:
○ ReplicaSet
○ Deployment
○ StatefulSet
○ Job
○ ...
Kubernetes Resources/Objects
● Namespace
● ConfigMap
● Secret
● Label & Selectors
Kubernetes Components
● Control Plane (Master Node) Components:
○ API Server
○ Scheduler
○ Controller Manager
○ Etcd
● Data Plane (Worker Node) Components:
○ Kubelet
○ Kube-Proxy
○ Others
■ Container Runtime
Kubernetes Components
Source: https://carltsuis-blog.readthedocs.io/en/latest/kubernetes/components-of-k8s.png
GKE Overview
● Managed solution for Kubernetes on GCP
● Provides reliable, efficient & secured way to run Kubernetes Cluster
● No Control Plane to manage (GCP will take care of that)
○ Control Plane HA (in multiple Zones) - Optional/Flexibility
○ Auto Repairing / Patching of Control Plane Nodes
● Focused around:
○ Cluster Scaling (Manual/Auto)
○ Self Healing / Auto Repairing (of Nodes)
○ Node Pools (CPU/GPU pools)
GKE Features
● Fully Managed
● Auto Scaling / Auto Upgrade / Auto Repair
● Accelerators Support - GPUs/TPUs
● Various Cluster Topology supported : Zonal, Multi-Zonal, Regional Clusters
● Integration - Stackdriver, IAM, VPC etc.
● Workload Portability & Migration (through GKE on-Prem)
● ...
ServiceMesh
● Istio
● LinkerD
● AWS App Mesh
● ...
Istio
● Open Source Service Mesh
● Treats Kubernetes as First Class Citizen (but not limited to)
Let’s combine: Containers,
Kubernetes, GKE & ServiceMesh
for MicroService Architecture
Akash Agrawal
LinkedIn : akash-agrawal-58a97813
Twitter : @akkiagrawal29
Thanks

MicroServices with Containers, Kubernetes & ServiceMesh