SlideShare a Scribd company logo
Deploy and Manage Containers
on K8S
http://bit.ly/docker_k8s_talk
Prasanna Veerapandi (bala)
bala@nus.edu.sg
About me
Now
- Lecturer at Institute of System Science
- Creates and teaches
- Python For Data, Ops and Things
- Cloud DevOps Foundation
- Containers for Deploying and Scaling Apps
Past
- Application consultant - Web Application development & DevOps
- Mobile Application Developer
Objective
Introduction to containers
from a
Developer’s perspective
What is a container ?
Virtual Machines
Server
Host OS
Hypervisor (type 2)
Guest
OS
Run
time
App
#0
Guest
OS
Run
time
App
#0
Guest
OS
Run
time
App
#1
Virtualmachines
VMs virtualizes the hardware
Containers
Server
Linux
LXC
Runtime
App
#0
App
#0
Run
time
App
#1
Virtualmachines
Container
VMs virtualizes the hardware
Container virtualizes Linux
Server
Host OS
Hypervisor (type 2)
Guest
OS
Run
time
App
#0
Guest
OS
Run
time
App
#0
Guest
OS
Run
time
App
#1
LXC Enabling Technologies
Namespaces - isolation
- Virtualizes Linux resources (process, network, filesystem, etc) for one or
more processes
- Analogy: Java packages, XML namespaces
CGroups - resource limits
- Hard and soft limit on resources eg. CPU shares, memory, bandwidth, etc
Overlay filesystem - bottom of the well view
- Provides a unified view of multiple directories by transparently
overlaying and merging them
NUS-ISS Learning Day 2018- Deploying a microservices app using docker and kubernetes
Docker
Container
Server
Linux
LXC
Runtime
App
#0
App
#0
Run
time
App
#1
A set of LXC management tools
for creating “containerize”
application
- Application running in their
own namespaces
- Their own view of the the
file systems
- Constrained to a specific
set of resources
An “image” format
Let’s Code
A simple web server using
NodeJS and Express
Cloning and Customizing the App
- Create an application directory
- Copy the files over to the new directory
- package.json - application manifest
- Files and directories
- (Re)Install the required libraries
- Customize the content
Containerize It
Applications’ files
node
Dockerfile
docker build -t myapp:latest .
myapp
Run It
Applications’ files
node
Dockerfile
docker run -d -p 3000:3000 
--name app0 myapp:latest
myapp
Docker Workflow
App image
Running
deploy
build push
Container
registry
pull
deploy
Space and Volumes
- Containers are ephemeral
- Any files you create in the container will be gone once you remove
the container
- Mapping host directory into the container
- Sharing of common data
- Creating and saving artifacts
- Mapping a container’s volume into another container
- Data only container eg database
- Mapping storages into a container
- Data from NFS, other drives
Volumes
VOLUME /myapp/public
/data
docker run -d -v /data:/myapp/public 
-p 3000:3000 --name app0 myapp:latest
Mounted under /myapp/public
NUS-ISS Learning Day 2018- Deploying a microservices app using docker and kubernetes
Growing Big
The picture can't be displayed.
Servers with Docker Loadbalancer
The picture can't be displayed. The picture can't be displayed. The picture can't be displayed.
But…
Need to setup environment
Deal with hardware and software failures
Keeping services up and monitoring them
Build a infrastructure framework to deal with deployments
…
The picture can't be displayed.
The picture can't be displayed.
The picture can't be displayed.
The picture can't be displayed.
The picture can't be displayed.
“Ops”
Servers
“Dev”
Applications
The picture can't be displayed.
Or you can use
What is Kubernetes?
A container cluster management system
- Manage Docker, rkt
Support applications by providing the following
- scaling/replication, load balancing, rolling updates,
health checks, services discovery, etc.
Alternatives
- Docker Swarm, Mesos Marathon, Fleet
Kubernetes Architecture (vastly simplified)The picture can't be displayed.
The picture can't be displayed.
The picture can't be displayed.
Kubernetesnodes
Kuberneres
Master
Kublet
kubectl
POD - a deployable unit of container(s)
localhost:3306
MySQL
database
Payara
Application Server
NodeJS
Deployment
kubectl run deployment/kapps --image=chukmunnlee/kapps:latest 
--port=3000
Creates and schedules a pod
onto a node in the cluster
The picture can't be displayed.The picture can't be displayed. The picture can't be displayed.
3000
PODS are ephemeral
Services
kubectl expose deployment/kapps --port=8080 --target-port=3000
Provides location and
referential transparency by
providing a stable IP address
The picture can't be displayed.The picture can't be displayed. The picture can't be displayed.
3000
8080
Scaling
kubectl scale deployment/kapps --replicas=3
Replication controller resolves
differences between declared
and actual
The picture can't be displayed.The picture can't be displayed. The picture can't be displayed.
3000
8080
3000 3000
Pet vs Sheep/Cattle
Vertical scaling Horizontal scaling
Container Friendly Applications
https://12factor.net/

More Related Content

PPTX
Azure Application Modernization
PDF
Containing your microservice sprawl
PPTX
Cloud computing
PDF
Microsoft Azure Explained - Hitesh D Kesharia
PDF
Cloud Native Java Microservices
PDF
Application Evolution Strategy
PDF
Building an Integrated Supply Chain for APIs
PDF
Accelerating Time to Market
Azure Application Modernization
Containing your microservice sprawl
Cloud computing
Microsoft Azure Explained - Hitesh D Kesharia
Cloud Native Java Microservices
Application Evolution Strategy
Building an Integrated Supply Chain for APIs
Accelerating Time to Market

What's hot (20)

PPTX
2015 cloud trend and cloud DR
PDF
Pivotal Digital Transformation Forum: Becoming a Data Driven Enterprise
PPTX
Cloud to Cloud and Cloud to Enterprise Integration - WSO2Con 2014 USA
PPTX
PaaS on Openstack
PDF
WSO2Con ASIA 2016: Planning Your Cloud Strategy
PPTX
Going Cloud Native at Comcast: How We Migrated a Massive Legacy SOA Platform ...
PPTX
Transforming Culture at Bloomberg
PDF
App Modernization
PDF
WSO2Con USA 2017: Journey of Migration from Legacy ESB to Modern WSO2 ESB Pla...
PDF
Cloud Native Operations
PDF
How to Use iPaaS to Scale Your Business - Case Study
PPTX
Event-Driven Serverless Architecture - the next big thing in the cloud (Cleme...
PPTX
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
PDF
devops, microservices, and platforms, oh my!
PPTX
The Cloud Native Journey
PPTX
How iPaaS Overcomes the Challenges of Cloud Integration
PDF
Webinar: iPaaS in the Enterprise - What to Look for in a Cloud Integration Pl...
PDF
Building a SaaS using WSO2 Stratos
PPTX
Why commercetools APIs are Differentiated
PPTX
Enhance your multi-cloud application performance using Redis Enterprise P2
2015 cloud trend and cloud DR
Pivotal Digital Transformation Forum: Becoming a Data Driven Enterprise
Cloud to Cloud and Cloud to Enterprise Integration - WSO2Con 2014 USA
PaaS on Openstack
WSO2Con ASIA 2016: Planning Your Cloud Strategy
Going Cloud Native at Comcast: How We Migrated a Massive Legacy SOA Platform ...
Transforming Culture at Bloomberg
App Modernization
WSO2Con USA 2017: Journey of Migration from Legacy ESB to Modern WSO2 ESB Pla...
Cloud Native Operations
How to Use iPaaS to Scale Your Business - Case Study
Event-Driven Serverless Architecture - the next big thing in the cloud (Cleme...
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
devops, microservices, and platforms, oh my!
The Cloud Native Journey
How iPaaS Overcomes the Challenges of Cloud Integration
Webinar: iPaaS in the Enterprise - What to Look for in a Cloud Integration Pl...
Building a SaaS using WSO2 Stratos
Why commercetools APIs are Differentiated
Enhance your multi-cloud application performance using Redis Enterprise P2
Ad

Similar to NUS-ISS Learning Day 2018- Deploying a microservices app using docker and kubernetes (20)

PDF
Containers in a Kubernetes World
PDF
A curtain-raiser to the container world Docker & Kubernetes
PDF
Containerizing the Cloud with Kubernetes and Docker
PDF
99cloud Docker Training module 2
PDF
Pydata 2020 containers meetup
PDF
DEVOPS UNIT 4 docker and services commands
PDF
Using kubernetes to lose your fear of using containers
PDF
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
PPTX
Docker and kubernetes_introduction
PDF
kubernetes_start_tutorial_by_ruben_tejero.pdf
PPTX
K8s in 3h - Kubernetes Fundamentals Training
PDF
Getting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdf
PDF
Driving Digital Transformation With Containers And Kubernetes Complete Deck
PPTX
The Best Docker and Kubernetes Online Training Courses.pptx
PDF
Gentle introduction to containers and kubernetes
PPSX
Docker Kubernetes Istio
PDF
Docker, but what it is?
PPTX
Docker Kubernetes Istio
PDF
Nugwc k8s session-16-march-2021
PDF
Kubernetes Docker Container Implementation Ppt PowerPoint Presentation Slide ...
Containers in a Kubernetes World
A curtain-raiser to the container world Docker & Kubernetes
Containerizing the Cloud with Kubernetes and Docker
99cloud Docker Training module 2
Pydata 2020 containers meetup
DEVOPS UNIT 4 docker and services commands
Using kubernetes to lose your fear of using containers
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Docker and kubernetes_introduction
kubernetes_start_tutorial_by_ruben_tejero.pdf
K8s in 3h - Kubernetes Fundamentals Training
Getting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdf
Driving Digital Transformation With Containers And Kubernetes Complete Deck
The Best Docker and Kubernetes Online Training Courses.pptx
Gentle introduction to containers and kubernetes
Docker Kubernetes Istio
Docker, but what it is?
Docker Kubernetes Istio
Nugwc k8s session-16-march-2021
Kubernetes Docker Container Implementation Ppt PowerPoint Presentation Slide ...
Ad

More from NUS-ISS (20)

PDF
Designing Impactful Services and User Experience - Lim Wee Khee
PDF
Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen...
PDF
The Importance of Cybersecurity for Digital Transformation
PDF
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
PDF
Understanding GenAI/LLM and What is Google Offering - Felix Goh
PDF
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
PDF
Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica...
PDF
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
PDF
Supply Chain Security for Containerised Workloads - Lee Chuk Munn
PDF
Future of Learning - Yap Aye Wee.pdf
PDF
Future of Learning - Khoong Chan Meng
PPTX
Site Reliability Engineer (SRE), We Keep The Lights On 24/7
PDF
Product Management in The Trenches for a Cloud Service
PDF
Overview of Data and Analytics Essentials and Foundations
PDF
Predictive Analytics
PDF
Feature Engineering for IoT
PDF
Master of Technology in Software Engineering
PDF
Master of Technology in Enterprise Business Analytics
PDF
Diagnosing Complex Problems Using System Archetypes
PPTX
Satisfying the ‘-ilities’ of an Enterprise Cloud Service
Designing Impactful Services and User Experience - Lim Wee Khee
Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen...
The Importance of Cybersecurity for Digital Transformation
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
Understanding GenAI/LLM and What is Google Offering - Felix Goh
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica...
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
Supply Chain Security for Containerised Workloads - Lee Chuk Munn
Future of Learning - Yap Aye Wee.pdf
Future of Learning - Khoong Chan Meng
Site Reliability Engineer (SRE), We Keep The Lights On 24/7
Product Management in The Trenches for a Cloud Service
Overview of Data and Analytics Essentials and Foundations
Predictive Analytics
Feature Engineering for IoT
Master of Technology in Software Engineering
Master of Technology in Enterprise Business Analytics
Diagnosing Complex Problems Using System Archetypes
Satisfying the ‘-ilities’ of an Enterprise Cloud Service

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf
Network Security Unit 5.pdf for BCA BBA.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
The Rise and Fall of 3GPP – Time for a Sabbatical?
Assigned Numbers - 2025 - Bluetooth® Document
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
sap open course for s4hana steps from ECC to s4
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

NUS-ISS Learning Day 2018- Deploying a microservices app using docker and kubernetes