SlideShare a Scribd company logo
1 of 46
Download to read offline
Deep Dive into Kubernetes
Part 1
Imesh Gunaratne, WSO2
Agenda
● Kubernetes Architecture
● Container Orchestration:
○ Pods
○ Replica Sets
○ Deployments
● Internal Routing
○ Services
● External Routing
○ Ingresses & Ingress Controllers
Agenda Cont.
● Configuration Management
○ Config Maps
● Credentials Management
○ Secrets
● Persistent Volumes
● Rolling Out Updates
● Autoscaling
○ Horizontal Pod Autoscalers
Agenda Cont.
● Package Management
○ Helm
● Hello World Example
Kubernetes Architecture
Kubernetes Architecture
Node 1 Node 2 Node nMaster
API
Overlay Network
UI
CLI
Container Registry
API Server
Scheduler
Controller
etcd
Container Orchestration
Pods
● A pod is a group of containers that
share the file system, users, network
interfaces, etc
● By default a pod will include two
containers: one for the given docker
image and other for the network
interface
C1 C2 Cn
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
spec:
containers:
- name: myapp-container
image: busybox
command: ['sh', '-c', 'echo
Hello Kubernetes! && sleep 3600']
Replica Sets
● Replica Sets are used for
orchestrating pods
● They define the docker images,
resources, env. variables, ports,
etc required for creating pods
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: frontend
labels:
app: guestbook
spec:
replicas: 3
selector:
matchLabels:
tier: frontend
matchExpressions:
- {key: tier, operator: In}
template:
metadata:
labels:
...
spec:
containers:
- name: php-redis
image: foo:bar
ports:
- containerPort: 80
Replica Set
C1 C2
Deployments
● A deployment is used for
orchestrating pods via replica sets:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
Replica Set
Deployment
C1 C2
Internal Routing
Services
kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376
Replica Set
Deployment
Service
● A service provides a layer 4 load
balancer for pods:
C1 C2
Pod to Pod Communication
Replica Set A
Deployment A
ServiceA
C1 C2
Deployment B
Replica Set B
C3 C4
ServiceB
External Routing
Ingresses
Replica Set
Deployment
Service
Ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations:
nginx.ingress.kubernetes.io/rewri
te-target: /
spec:
rules:
- http:
paths:
- path: /testpath
backend:
serviceName: test
servicePort: 80
● An ingress is used for configuring a
load balancer for external routing
C1 C2
Ingresses
Replica Set
Deployment
Service
Ingress
Ingress
Controller
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations:
nginx.ingress.kubernetes.io/rewri
te-target: /
spec:
rules:
- http:
paths:
- path: /testpath
backend:
serviceName: test
servicePort: 80
● An ingress is used for configuring a
load balancer for external routing
C1 C2
Ingresses
Replica Set
Deployment
Service
Ingress
Ingress
Controller
LoadBalancer
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations:
nginx.ingress.kubernetes.io/rewri
te-target: /
spec:
rules:
- http:
paths:
- path: /testpath
backend:
serviceName: test
servicePort: 80
● An ingress is used for configuring a
load balancer for external routing
C1 C2
Configuration Management
ConfigMaps
Replica Set
Deployment
Service
Ingress
Ingress
Controller
LoadBalancer
Config MapsConfig Files
● Configuration files can be injected
into pods using ConfigMaps
● A ConfigMap can be created for
key/value pairs, files and folders
Config MapsConfig Maps
C1 C2
Credentials Management
Config Maps
Secrets
Replica Set
Deployment
Service
Ingress
Ingress
Controller
LoadBalancer
Config Files
● Sensitive data such as
credentials, encryption keys can
be securely injected using
secrets
Config MapsConfig MapsConfig MapsSecrets
Config Maps
Credentials
C1 C2
Persistent Volumes
Config Maps
Persistent Volumes
Replica Set
Deployment
Config Files
Config Maps
Credentials
C1 C2
Persistent Volume ClaimPersistent Volumes
Service
● PVC defines volume size, and
type: ReadOnly, ReadWrite,
ReadWriteMany
Persistent Volume Types
● GCEPersistentDisk
● AWSElasticBlockStore
● AzureFile
● AzureDisk
● FC (Fibre Channel)**
● FlexVolume
● Flocker
● NFS
● iSCSI
● RBD (Ceph Block Device)
● CephFS
● Cinder (OpenStack block storage)
● Glusterfs
● VsphereVolume
● Quobyte Volumes
● VMware Photon
● Portworx Volumes
● ScaleIO Volumes
● StorageOS
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes
Rolling Out Updates
Deployment Process
Deployment V1 V1 Deploying...
Replica Set V1
Deployment V1 V1 Deploying...
Deployment Process
Replica Set V1
Deployment V1
P1 - V1 P2 - V1 Service
C1 C2
V1 Pods Starting...
Deployment Process
C1
Replica Set V1
Deployment V1
P1 - V1 P2 - V1 Service
C2
V1 Pods Activating...
Deployment Process
C1
Replica Set V1
Deployment V1
C2
P1 - V1 P2 - V1 Service
V1 Pods Healthy
Deployment Process
C1
Replica Set V1
Deployment V1
C2
P1 - V1 P2 - V1
Deployment V2
Service
Deploying V2...
Rolling Update Process
C1
Replica Set V1
Deployment V1
C2
P1 - V1 P2 - V1
Deployment V2
Replica Set V2
Service
Deploying V2...
Rolling Update Process
Replica Set V1
Deployment V1
C2
P1 - V1 P2 - V1
Deployment V2
Replica Set V2
P1 - V2Service
C3
V2 Pods Starting...
C4
P2 - V2
C1
Rolling Update Process
C1
Replica Set V1
Deployment V1
C2
P1 - V1 P2 - V1
Deployment V2
Replica Set V2
C3
P1 - V2Service
V2 Pods Activating...
P2 - V2
C4
Rolling Update Process
Replica Set V1
Deployment V1
P1 - V1 P2 - V1
Deployment V2
Replica Set V2
C3 C4
P1 - V2 P2 - V2
C1 C2
Service
V2 Pods Healthy
Rolling Update Process
Autoscaling
Horizontal Pod Autoscalers
Replica Set
Deployment
Service
● Enable autoscaling for pods based on CPU utilization
Horizontal Pod
Autoscaler
Resource Metrics API
C1 C2
Package Management
Helm
● Helm is the Kubernetes package manager.
● It uses Charts for defining, installing and upgrading
applications on Kubernetes.
● Runtime configurations can be templated and
parameterized.
● Existing Charts can be reused and added as dependencies to
new Charts.
● Helm is managed by CNCF.
https://docs.helm.sh
Helm Hello World
# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
Name: hello-world
spec:
replicas: 1
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-world
image:
gcr.io/google-samples/node-hello
:1.0
ports:
- containerPort: 8080
protocol: TCP
# chart.yaml
name: apps/v1
version:
# templates/service.yaml
kind: Service
apiVersion: v1
metadata:
name: hello-world
spec:
type: NodePort
selector:
app: hello-world
ports:
- protocol: TCP
port: 8080
targetPort: 8080
Hello World Demo
Questions & Feedback
References
References
● Kubernetes Documentation:
○ https://kubernetes.io/docs/
● An Introduction to Kubernetes:
○ https://www.slideshare.net/imesh/an-introduction-to-kubernetes
● WSO2Con US 2015 Kubernetes: a platform for automating deployment,
scaling, and operations:
○ https://www.slideshare.net/BrianGrant11/wso2con-us-2015-kube
rnetes-a-platform-for-automating-deployment-scaling-and-operati
ons
● Kubernetes: An Overview:
○ https://thenewstack.io/kubernetes-an-overview/
References Cont.
● Helm Documentation:
○ https://docs.helm.sh
● The missing CI/CD Kubernetes component: Helm package manager
○ https://medium.com/@gajus/the-missing-ci-cd-kubernetes-compon
ent-helm-package-manager-1fe002aac680
Thank You!

More Related Content

What's hot

Helm – The package manager for Kubernetes
Helm – The package manager for KubernetesHelm – The package manager for Kubernetes
Helm – The package manager for KubernetesFabianRosenthal1
 
Steering the Course with Helm
Steering the Course with HelmSteering the Course with Helm
Steering the Course with HelmDirk Jablonski
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes waysparkfabrik
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionEric Gustafson
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersPlatform9
 
Kubernetes Application Deployment with Helm - A beginner Guide!
Kubernetes Application Deployment with Helm - A beginner Guide!Kubernetes Application Deployment with Helm - A beginner Guide!
Kubernetes Application Deployment with Helm - A beginner Guide!Krishna-Kumar
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Megan O'Keefe
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsJulian Mazzitelli
 
Kubernetes - introduction
Kubernetes - introductionKubernetes - introduction
Kubernetes - introductionSparkbit
 
Secrets in Kubernetes
Secrets in KubernetesSecrets in Kubernetes
Secrets in KubernetesJerry Jalava
 

What's hot (20)

Hands-on Helm
Hands-on Helm Hands-on Helm
Hands-on Helm
 
Helm – The package manager for Kubernetes
Helm – The package manager for KubernetesHelm – The package manager for Kubernetes
Helm – The package manager for Kubernetes
 
Helm 3
Helm 3Helm 3
Helm 3
 
Helm intro
Helm introHelm intro
Helm intro
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Steering the Course with Helm
Steering the Course with HelmSteering the Course with Helm
Steering the Course with Helm
 
01. Kubernetes-PPT.pptx
01. Kubernetes-PPT.pptx01. Kubernetes-PPT.pptx
01. Kubernetes-PPT.pptx
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It Matters
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
 
Helm.pptx
Helm.pptxHelm.pptx
Helm.pptx
 
Kubernetes Application Deployment with Helm - A beginner Guide!
Kubernetes Application Deployment with Helm - A beginner Guide!Kubernetes Application Deployment with Helm - A beginner Guide!
Kubernetes Application Deployment with Helm - A beginner Guide!
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
 
Ingress overview
Ingress overviewIngress overview
Ingress overview
 
Kubernetes - introduction
Kubernetes - introductionKubernetes - introduction
Kubernetes - introduction
 
Secrets in Kubernetes
Secrets in KubernetesSecrets in Kubernetes
Secrets in Kubernetes
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 

Similar to Deep Dive into Kubernetes - Part 1

WSO2 Kubernetes Reference Architecture - Nov 2017
WSO2 Kubernetes Reference Architecture - Nov 2017WSO2 Kubernetes Reference Architecture - Nov 2017
WSO2 Kubernetes Reference Architecture - Nov 2017Imesh Gunaratne
 
Docker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker eeDocker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker eeDocker, Inc.
 
Introduction to Kubernetes with demo
Introduction to Kubernetes with demoIntroduction to Kubernetes with demo
Introduction to Kubernetes with demoOpsta
 
Deploying WSO2 Middleware on Kubernetes
Deploying WSO2 Middleware on KubernetesDeploying WSO2 Middleware on Kubernetes
Deploying WSO2 Middleware on KubernetesImesh Gunaratne
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 introTerry Cho
 
CI/CD Across Multiple Environments
CI/CD Across Multiple EnvironmentsCI/CD Across Multiple Environments
CI/CD Across Multiple EnvironmentsKarl Isenberg
 
DockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaDockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaŁukasz Piątkowski
 
Data Engineer's Lunch #50: Airbyte for Data Engineering
Data Engineer's Lunch #50: Airbyte for Data EngineeringData Engineer's Lunch #50: Airbyte for Data Engineering
Data Engineer's Lunch #50: Airbyte for Data EngineeringAnant Corporation
 
Sprint 140
Sprint 140Sprint 140
Sprint 140ManageIQ
 
Introduction to Kubernetes and GKE
Introduction to Kubernetes and GKEIntroduction to Kubernetes and GKE
Introduction to Kubernetes and GKEOpsta
 
Extended and embedding: containerd update & project use cases
Extended and embedding: containerd update & project use casesExtended and embedding: containerd update & project use cases
Extended and embedding: containerd update & project use casesPhil Estes
 
Kubeadm Deep Dive (Kubecon Seattle 2018)
Kubeadm Deep Dive (Kubecon Seattle 2018)Kubeadm Deep Dive (Kubecon Seattle 2018)
Kubeadm Deep Dive (Kubecon Seattle 2018)Liz Frost
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...Oleg Shalygin
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKevin Lynch
 
FIWARE Global Summit - Leveraging Kubernetes for FIWARE Components Automations
FIWARE Global Summit - Leveraging Kubernetes for FIWARE Components AutomationsFIWARE Global Summit - Leveraging Kubernetes for FIWARE Components Automations
FIWARE Global Summit - Leveraging Kubernetes for FIWARE Components AutomationsFIWARE
 
Docker Enterprise Workshop - Technical
Docker Enterprise Workshop - TechnicalDocker Enterprise Workshop - Technical
Docker Enterprise Workshop - TechnicalPatrick Chanezon
 
Advanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the FieldAdvanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the FieldAriel Moskovich
 
Extending kubernetes
Extending kubernetesExtending kubernetes
Extending kubernetesGigi Sayfan
 

Similar to Deep Dive into Kubernetes - Part 1 (20)

WSO2 Kubernetes Reference Architecture - Nov 2017
WSO2 Kubernetes Reference Architecture - Nov 2017WSO2 Kubernetes Reference Architecture - Nov 2017
WSO2 Kubernetes Reference Architecture - Nov 2017
 
Docker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker eeDocker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker ee
 
Introduction to Kubernetes with demo
Introduction to Kubernetes with demoIntroduction to Kubernetes with demo
Introduction to Kubernetes with demo
 
Kubernetes Intro
Kubernetes IntroKubernetes Intro
Kubernetes Intro
 
Deploying WSO2 Middleware on Kubernetes
Deploying WSO2 Middleware on KubernetesDeploying WSO2 Middleware on Kubernetes
Deploying WSO2 Middleware on Kubernetes
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
CI/CD Across Multiple Environments
CI/CD Across Multiple EnvironmentsCI/CD Across Multiple Environments
CI/CD Across Multiple Environments
 
DockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaDockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing Aurea
 
Data Engineer's Lunch #50: Airbyte for Data Engineering
Data Engineer's Lunch #50: Airbyte for Data EngineeringData Engineer's Lunch #50: Airbyte for Data Engineering
Data Engineer's Lunch #50: Airbyte for Data Engineering
 
Sprint 140
Sprint 140Sprint 140
Sprint 140
 
Introduction to Kubernetes and GKE
Introduction to Kubernetes and GKEIntroduction to Kubernetes and GKE
Introduction to Kubernetes and GKE
 
Extended and embedding: containerd update & project use cases
Extended and embedding: containerd update & project use casesExtended and embedding: containerd update & project use cases
Extended and embedding: containerd update & project use cases
 
Kubeadm Deep Dive (Kubecon Seattle 2018)
Kubeadm Deep Dive (Kubecon Seattle 2018)Kubeadm Deep Dive (Kubecon Seattle 2018)
Kubeadm Deep Dive (Kubecon Seattle 2018)
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
 
helm, the real world
helm, the real worldhelm, the real world
helm, the real world
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the Datacenter
 
FIWARE Global Summit - Leveraging Kubernetes for FIWARE Components Automations
FIWARE Global Summit - Leveraging Kubernetes for FIWARE Components AutomationsFIWARE Global Summit - Leveraging Kubernetes for FIWARE Components Automations
FIWARE Global Summit - Leveraging Kubernetes for FIWARE Components Automations
 
Docker Enterprise Workshop - Technical
Docker Enterprise Workshop - TechnicalDocker Enterprise Workshop - Technical
Docker Enterprise Workshop - Technical
 
Advanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the FieldAdvanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the Field
 
Extending kubernetes
Extending kubernetesExtending kubernetes
Extending kubernetes
 

More from Imesh Gunaratne

Planning WSO2 Deployments on Pivotal Cloud Foundry
Planning WSO2 Deployments on Pivotal Cloud FoundryPlanning WSO2 Deployments on Pivotal Cloud Foundry
Planning WSO2 Deployments on Pivotal Cloud FoundryImesh Gunaratne
 
Planning WSO2 Deployments on DC/OS
Planning WSO2 Deployments on DC/OSPlanning WSO2 Deployments on DC/OS
Planning WSO2 Deployments on DC/OSImesh Gunaratne
 
Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 2Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 2Imesh Gunaratne
 
WSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for DC/OSWSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for DC/OSImesh Gunaratne
 
WSO2 API Manager Reference Architecture for Pivotal Cloud Foundry
WSO2 API Manager Reference Architecture for Pivotal Cloud FoundryWSO2 API Manager Reference Architecture for Pivotal Cloud Foundry
WSO2 API Manager Reference Architecture for Pivotal Cloud FoundryImesh Gunaratne
 
WSO2 Cloud and Platform as a Service Strategy
WSO2 Cloud and Platform as a Service StrategyWSO2 Cloud and Platform as a Service Strategy
WSO2 Cloud and Platform as a Service StrategyImesh Gunaratne
 
Planning Your Cloud Strategy
Planning Your Cloud StrategyPlanning Your Cloud Strategy
Planning Your Cloud StrategyImesh Gunaratne
 
Deploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersDeploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersImesh Gunaratne
 
Multitenancy in WSO2 Carbon 5 (C5)
Multitenancy in WSO2 Carbon 5 (C5)Multitenancy in WSO2 Carbon 5 (C5)
Multitenancy in WSO2 Carbon 5 (C5)Imesh Gunaratne
 
Deploying WSO2 Middleware on Mesos
Deploying WSO2 Middleware on MesosDeploying WSO2 Middleware on Mesos
Deploying WSO2 Middleware on MesosImesh Gunaratne
 
Service Oriented Architecture & Beyond
Service Oriented Architecture & BeyondService Oriented Architecture & Beyond
Service Oriented Architecture & BeyondImesh Gunaratne
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java DevelopersImesh Gunaratne
 
WSO2 Cloud Strategy Update
WSO2 Cloud Strategy UpdateWSO2 Cloud Strategy Update
WSO2 Cloud Strategy UpdateImesh Gunaratne
 
Scale into Multi-Cloud with Containers
Scale into Multi-Cloud with ContainersScale into Multi-Cloud with Containers
Scale into Multi-Cloud with ContainersImesh Gunaratne
 
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App FactoryRevolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App FactoryImesh Gunaratne
 
Making a Better World with Technology Innovations
Making a Better World with Technology InnovationsMaking a Better World with Technology Innovations
Making a Better World with Technology InnovationsImesh Gunaratne
 
Introduction to WSO2 Private PaaS 4.1.0
Introduction to WSO2 Private PaaS 4.1.0Introduction to WSO2 Private PaaS 4.1.0
Introduction to WSO2 Private PaaS 4.1.0Imesh Gunaratne
 
Private PaaS for the Enterprise - Apache Stratos & WSO2 Private PaaS
Private PaaS for the Enterprise - Apache Stratos & WSO2 Private PaaSPrivate PaaS for the Enterprise - Apache Stratos & WSO2 Private PaaS
Private PaaS for the Enterprise - Apache Stratos & WSO2 Private PaaSImesh Gunaratne
 

More from Imesh Gunaratne (20)

Planning WSO2 Deployments on Pivotal Cloud Foundry
Planning WSO2 Deployments on Pivotal Cloud FoundryPlanning WSO2 Deployments on Pivotal Cloud Foundry
Planning WSO2 Deployments on Pivotal Cloud Foundry
 
Planning WSO2 Deployments on DC/OS
Planning WSO2 Deployments on DC/OSPlanning WSO2 Deployments on DC/OS
Planning WSO2 Deployments on DC/OS
 
Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 2Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 2
 
WSO2 Container Strategy
WSO2 Container StrategyWSO2 Container Strategy
WSO2 Container Strategy
 
WSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for DC/OSWSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for DC/OS
 
WSO2 API Manager Reference Architecture for Pivotal Cloud Foundry
WSO2 API Manager Reference Architecture for Pivotal Cloud FoundryWSO2 API Manager Reference Architecture for Pivotal Cloud Foundry
WSO2 API Manager Reference Architecture for Pivotal Cloud Foundry
 
WSO2 Cloud and Platform as a Service Strategy
WSO2 Cloud and Platform as a Service StrategyWSO2 Cloud and Platform as a Service Strategy
WSO2 Cloud and Platform as a Service Strategy
 
Planning Your Cloud Strategy
Planning Your Cloud StrategyPlanning Your Cloud Strategy
Planning Your Cloud Strategy
 
Deploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersDeploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on Containers
 
Multitenancy in WSO2 Carbon 5 (C5)
Multitenancy in WSO2 Carbon 5 (C5)Multitenancy in WSO2 Carbon 5 (C5)
Multitenancy in WSO2 Carbon 5 (C5)
 
Deploying WSO2 Middleware on Mesos
Deploying WSO2 Middleware on MesosDeploying WSO2 Middleware on Mesos
Deploying WSO2 Middleware on Mesos
 
Service Oriented Architecture & Beyond
Service Oriented Architecture & BeyondService Oriented Architecture & Beyond
Service Oriented Architecture & Beyond
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
 
WSO2 Cloud Strategy Update
WSO2 Cloud Strategy UpdateWSO2 Cloud Strategy Update
WSO2 Cloud Strategy Update
 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
 
Scale into Multi-Cloud with Containers
Scale into Multi-Cloud with ContainersScale into Multi-Cloud with Containers
Scale into Multi-Cloud with Containers
 
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App FactoryRevolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
 
Making a Better World with Technology Innovations
Making a Better World with Technology InnovationsMaking a Better World with Technology Innovations
Making a Better World with Technology Innovations
 
Introduction to WSO2 Private PaaS 4.1.0
Introduction to WSO2 Private PaaS 4.1.0Introduction to WSO2 Private PaaS 4.1.0
Introduction to WSO2 Private PaaS 4.1.0
 
Private PaaS for the Enterprise - Apache Stratos & WSO2 Private PaaS
Private PaaS for the Enterprise - Apache Stratos & WSO2 Private PaaSPrivate PaaS for the Enterprise - Apache Stratos & WSO2 Private PaaS
Private PaaS for the Enterprise - Apache Stratos & WSO2 Private PaaS
 

Recently uploaded

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 

Deep Dive into Kubernetes - Part 1

  • 1. Deep Dive into Kubernetes Part 1 Imesh Gunaratne, WSO2
  • 2. Agenda ● Kubernetes Architecture ● Container Orchestration: ○ Pods ○ Replica Sets ○ Deployments ● Internal Routing ○ Services ● External Routing ○ Ingresses & Ingress Controllers
  • 3. Agenda Cont. ● Configuration Management ○ Config Maps ● Credentials Management ○ Secrets ● Persistent Volumes ● Rolling Out Updates ● Autoscaling ○ Horizontal Pod Autoscalers
  • 4. Agenda Cont. ● Package Management ○ Helm ● Hello World Example
  • 6. Kubernetes Architecture Node 1 Node 2 Node nMaster API Overlay Network UI CLI Container Registry API Server Scheduler Controller etcd
  • 8. Pods ● A pod is a group of containers that share the file system, users, network interfaces, etc ● By default a pod will include two containers: one for the given docker image and other for the network interface C1 C2 Cn apiVersion: v1 kind: Pod metadata: name: myapp-pod labels: app: myapp spec: containers: - name: myapp-container image: busybox command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 3600']
  • 9. Replica Sets ● Replica Sets are used for orchestrating pods ● They define the docker images, resources, env. variables, ports, etc required for creating pods apiVersion: apps/v1 kind: ReplicaSet metadata: name: frontend labels: app: guestbook spec: replicas: 3 selector: matchLabels: tier: frontend matchExpressions: - {key: tier, operator: In} template: metadata: labels: ... spec: containers: - name: php-redis image: foo:bar ports: - containerPort: 80 Replica Set C1 C2
  • 10. Deployments ● A deployment is used for orchestrating pods via replica sets: apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 Replica Set Deployment C1 C2
  • 12. Services kind: Service apiVersion: v1 metadata: name: my-service spec: selector: app: MyApp ports: - protocol: TCP port: 80 targetPort: 9376 Replica Set Deployment Service ● A service provides a layer 4 load balancer for pods: C1 C2
  • 13. Pod to Pod Communication Replica Set A Deployment A ServiceA C1 C2 Deployment B Replica Set B C3 C4 ServiceB
  • 15. Ingresses Replica Set Deployment Service Ingress apiVersion: extensions/v1beta1 kind: Ingress metadata: name: test-ingress annotations: nginx.ingress.kubernetes.io/rewri te-target: / spec: rules: - http: paths: - path: /testpath backend: serviceName: test servicePort: 80 ● An ingress is used for configuring a load balancer for external routing C1 C2
  • 16. Ingresses Replica Set Deployment Service Ingress Ingress Controller apiVersion: extensions/v1beta1 kind: Ingress metadata: name: test-ingress annotations: nginx.ingress.kubernetes.io/rewri te-target: / spec: rules: - http: paths: - path: /testpath backend: serviceName: test servicePort: 80 ● An ingress is used for configuring a load balancer for external routing C1 C2
  • 17. Ingresses Replica Set Deployment Service Ingress Ingress Controller LoadBalancer apiVersion: extensions/v1beta1 kind: Ingress metadata: name: test-ingress annotations: nginx.ingress.kubernetes.io/rewri te-target: / spec: rules: - http: paths: - path: /testpath backend: serviceName: test servicePort: 80 ● An ingress is used for configuring a load balancer for external routing C1 C2
  • 19. ConfigMaps Replica Set Deployment Service Ingress Ingress Controller LoadBalancer Config MapsConfig Files ● Configuration files can be injected into pods using ConfigMaps ● A ConfigMap can be created for key/value pairs, files and folders Config MapsConfig Maps C1 C2
  • 21. Config Maps Secrets Replica Set Deployment Service Ingress Ingress Controller LoadBalancer Config Files ● Sensitive data such as credentials, encryption keys can be securely injected using secrets Config MapsConfig MapsConfig MapsSecrets Config Maps Credentials C1 C2
  • 23. Config Maps Persistent Volumes Replica Set Deployment Config Files Config Maps Credentials C1 C2 Persistent Volume ClaimPersistent Volumes Service ● PVC defines volume size, and type: ReadOnly, ReadWrite, ReadWriteMany
  • 24. Persistent Volume Types ● GCEPersistentDisk ● AWSElasticBlockStore ● AzureFile ● AzureDisk ● FC (Fibre Channel)** ● FlexVolume ● Flocker ● NFS ● iSCSI ● RBD (Ceph Block Device) ● CephFS ● Cinder (OpenStack block storage) ● Glusterfs ● VsphereVolume ● Quobyte Volumes ● VMware Photon ● Portworx Volumes ● ScaleIO Volumes ● StorageOS https://kubernetes.io/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes
  • 27. Replica Set V1 Deployment V1 V1 Deploying... Deployment Process
  • 28. Replica Set V1 Deployment V1 P1 - V1 P2 - V1 Service C1 C2 V1 Pods Starting... Deployment Process
  • 29. C1 Replica Set V1 Deployment V1 P1 - V1 P2 - V1 Service C2 V1 Pods Activating... Deployment Process
  • 30. C1 Replica Set V1 Deployment V1 C2 P1 - V1 P2 - V1 Service V1 Pods Healthy Deployment Process
  • 31. C1 Replica Set V1 Deployment V1 C2 P1 - V1 P2 - V1 Deployment V2 Service Deploying V2... Rolling Update Process
  • 32. C1 Replica Set V1 Deployment V1 C2 P1 - V1 P2 - V1 Deployment V2 Replica Set V2 Service Deploying V2... Rolling Update Process
  • 33. Replica Set V1 Deployment V1 C2 P1 - V1 P2 - V1 Deployment V2 Replica Set V2 P1 - V2Service C3 V2 Pods Starting... C4 P2 - V2 C1 Rolling Update Process
  • 34. C1 Replica Set V1 Deployment V1 C2 P1 - V1 P2 - V1 Deployment V2 Replica Set V2 C3 P1 - V2Service V2 Pods Activating... P2 - V2 C4 Rolling Update Process
  • 35. Replica Set V1 Deployment V1 P1 - V1 P2 - V1 Deployment V2 Replica Set V2 C3 C4 P1 - V2 P2 - V2 C1 C2 Service V2 Pods Healthy Rolling Update Process
  • 37. Horizontal Pod Autoscalers Replica Set Deployment Service ● Enable autoscaling for pods based on CPU utilization Horizontal Pod Autoscaler Resource Metrics API C1 C2
  • 39. Helm ● Helm is the Kubernetes package manager. ● It uses Charts for defining, installing and upgrading applications on Kubernetes. ● Runtime configurations can be templated and parameterized. ● Existing Charts can be reused and added as dependencies to new Charts. ● Helm is managed by CNCF. https://docs.helm.sh
  • 40. Helm Hello World # templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: Name: hello-world spec: replicas: 1 template: metadata: labels: app: hello-world spec: containers: - name: hello-world image: gcr.io/google-samples/node-hello :1.0 ports: - containerPort: 8080 protocol: TCP # chart.yaml name: apps/v1 version: # templates/service.yaml kind: Service apiVersion: v1 metadata: name: hello-world spec: type: NodePort selector: app: hello-world ports: - protocol: TCP port: 8080 targetPort: 8080
  • 44. References ● Kubernetes Documentation: ○ https://kubernetes.io/docs/ ● An Introduction to Kubernetes: ○ https://www.slideshare.net/imesh/an-introduction-to-kubernetes ● WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, and operations: ○ https://www.slideshare.net/BrianGrant11/wso2con-us-2015-kube rnetes-a-platform-for-automating-deployment-scaling-and-operati ons ● Kubernetes: An Overview: ○ https://thenewstack.io/kubernetes-an-overview/
  • 45. References Cont. ● Helm Documentation: ○ https://docs.helm.sh ● The missing CI/CD Kubernetes component: Helm package manager ○ https://medium.com/@gajus/the-missing-ci-cd-kubernetes-compon ent-helm-package-manager-1fe002aac680