Kubernetes (k8s) is an ideal platform for running microservices due to its abilities to support heterogeneous technologies, independent development by small teams, efficient use of resources through scaling, rolling upgrades without outages, and high availability and fault tolerance. The presentation demonstrates running a sample three-tier microservices application on Kubernetes, including deploying the application pods and services, scaling pods, handling failures through replication, and performing rolling upgrades.
2. About me
Mahendra Laxaman
Senior Technical Consultant
IT Infrastructure Consultancy (ITIC) division
LSEG Technology (previously MIT)
https://www.linkedin.com/in/mahendra-
laxaman-b3771514/
Servers
Networking
OS and Containerized platforms
SAN
Databases
Cloud
Infrastructure Security
Other system software
We do consultancy for
3. Flow of the presentation
● Microservices architecture
● Ideal platform traits to run microservices
● Learn by reverse engineering
● First microservice in kubernetes
● Scaling
● High availability and FT
● Rolling upgrades
5. One-thing that do everything - monolithic
mobile
app
web
browser
gateway
web
driver
account
function
inventory
function
shipping
function
6. Do one thing and do it right - microservices
mobile
app
web
browser
gateway
web frontend
account
service
inventory
service
shipping
service
account
db
inventory
db
Shipping
db
Tier 1 Tier 2 Tier 3
14. Kubernetes
● Kubernetes being the state-of-the-art platform for microservices that support
above traits
● It is called the orchestration platform
current
state
desired
state
orchestration
19. Lets install kubectl
● The Kubernetes command-line tool
● Run commands against Kubernetes clusters
Install
Linux:
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/linux/amd64/kubectl
chmod +x kubectl
Windows:
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/windows/amd64/kubectl.exe
20. Helloworld to kubernetes
Install nginx
● kubectl run nginx --image=nginx:1.10.0 --requests=cpu=200m
● kubectl expose deployment nginx --port=80 --type=NodePort
Install tomcat
● kubectl run tomcat --image=tomcat --requests=cpu=100m
● kubectl expose deployment tomcat --port 8080 --type=NodePort
This is called imperative method
21. Deploy nginx using a config files
=
kubectl create -f nginx.yaml
nginx.yaml
This is called declarative method
kubectl run nginx --image=nginx:1.10.0 --requests=cpu=200m
24. Deploy a three-tier microservice application
kubectl create -f tier1.yaml kubectl create -f tier2.yaml kubectl create -f tier3.yaml
1. Take the message in
2. Append my hostname
3. Pass to the next tier
client tier1 tier2 tier3
25. What is running
● These are called pods
● It’s a stripped-down version of VM
HW emulation
Kernel
Dependencies
Application
Dependencies
Application
VM
POD
26. Pod on rest is called ‘image’
kubectl run nginx --image=nginx:1.10.0 --requests=cpu=200m
dependencies
nginx Executable -> Process
Image -> POD
https://hub.docker.com/
27. Create the connectivity (service)
client tier1 tier2 tier3
tier2
tier1
Single next hop
kubectl create -f tier1_svc.yaml kubectl create -f tier2_svc.yaml kubectl create -f tier3_svc.yaml
client tier1 tier3
tier2
tier1 tier2 tier3
tier1 tier2
tier2
Load balancers between each tier
28. What is this ‘Service’
‘Services’ provide connectivity and load balancing
38. Scaling
● Scaling
○ Manually adding new replicas
● Horizontal Pod Autoscaler (HPA)
○ Matric based automatic scale
39. Rolling updates and Rollbacks
● Update without outage
● If unsuccessful rollback to previous state
Editor's Notes
steering wheel of a ship -> helm
Docker being the ship kubernetes is the captain of the ship in Greek
The traditional way of software development is following monolithic architecture.
Which involves multiple functions built in to one package.
When the functionalities grow, this results very inefficient when developing as well as when running.
The major problem seems to be the total development speed bottlenecked by the slowest development team.
The traditional way of software development is following monolithic architecture.
Which involves multiple functions built in to one package.
When the functionalities grow, this results very inefficient when developing as well as when running.
The major problem seems to be the total development speed bottlenecked by the slowest development team.