SlideShare a Scribd company logo
BAO HUYNH
Site Reliabity Engineering
I. CONTAINER RECALL
II. KUBERNETES – A RISING HERO
III. K8S ARCHITECTURE
IV. KEY CONCEPTS
V. DEMOS
AGENDA
AGENDA
I. CONTAINER RECALL
○ Microservice & Container approach
○ Docker
II. KUBERNETES – A RISING HERO
III. K8S ARCHITECTURE
IV. KEY CONCEPTS
V. DEMOS
I.CONTAINER RECALL
I.CONTAINER RECALL
I.CONTAINER RECALL
CaaS (Container as a Servicer)
AGENDA
I. DOCKER RECALL
II. KUBERNETES – A RISING HERO
o Kuber-what ?
o Why Kuberenetes
III. K8S ARCHITECTURE
IV. KEY CONCEPTS
“Kubernetes is an open-source platform for :
- automating deployment
- scaling
- operations of containers
across cluster of host
à providing container-centric infrastructure”
- from Kubernetes’ father with love -
II.KUBERNETES – A RISING HERO
II.KUBERNETES – A RISING HERO
II.KUBERNETES – A RISING HERO
/ CU-BÉ NÉ-ĐỊT /
II.KUBERNETES – A RISING HERO
II.KUBERNETES – A RISING HERO
KUBERNETES, WHY ?
VM1
# ssh root@VM1
# docker run nginx –p 8080:80 …
VM2
# ssh root@VM2
# docker run nginx –p 8080:80 …
…...
…...
…...
II.KUBERNETES – A RISING HERO
KUBERNETES, WHY ?
• Deployment/Provision one or multiple containers
• Replicas of containers on multihost
• Data volumes for persistent storage management
• Multihost Overlay networking
• ……..
KUBERNETES, WHY ?
II.KUBERNETES – A RISING HERO
AGENDA
I. DOCKER RECALL
II. KUBERNETES – A RISING HERO
III. K8S ARCHITECTURE
○ Master node
○ Worker node
○ Additional Services
IV. KEY CONCEPTS
V. DEMOS
Master (Control plane for Kubernetes)
● kube-API Server: gatekeeper to handle HTTP request
between control plan & workers.
● kube-Scheduler: evaluates workload and place it on a
matching resource
● kube-Cluster controller: manages all core component
control loops:
- Monitors the cluster state via the apiserver
- Steers the cluster towards the desired state with
cloud-provider (AWS, GCP, Azure,..) component.
● etcd: provide highly available key-value database
III. K8S ARCHITECTURE
● the ‘place’, where pod/containers run on,
care ‘workload’ of cluster
● Daemon:
- kubelet: managing pod lifecycle on its
host + interact with APIServer (master)
- kube-proxy: load balancing/connection
forwarding between pods.
Nodes/Workers
III. K8S ARCHITECTURE
§ Kube-dns - Provides cluster wide DNS Services. Services
are resolvable to <service>.<namespace>.svc.cluster.local.
§ Heapster - Metrics Collector for kubernetes cluster, used by
some resources: Horizontal Pod Autoscaler or Dashboard
Metrics,…
§ Kube-dashboard - A general purpose web based UI for
kubernetes.
III. K8S ARCHITECTURE
Additional Services
AGENDA
I. DOCKER RECALL
II. KUBERNETES – A RISING HERO
III. K8S ARCHITECTURE
IV. KEY CONCEPTS
○ Pod/Deloyment/Service
○ Storage
○ ConfigMap/Secret
○ Authentication and Identity with RBAC
○ Networking
V. DEMOS
POD *
DEPLOYEMENT *
SERVICE *
Pod - A pod is the smallest unit of work/management
resource within Kubernetes.
Pods comprise of:
IV. KEY CONCEPTS (Pod)
Pod - example manisfest
IV. KEY CONCEPTS (Pod)
ReplicationController – keeps track of pod replicas and their
lifecycle.
ReplicaSet - Next Generation ReplicationController. Supports
set-based selectors.
IV. KEY CONCEPTS (Deployement)
Deployment
§ Type of replicaton - backed by ReplicaSets
§ Keeps track of state change history
§ Provides scaling/update/rollback functionality
IV. KEY CONCEPTS (Deployement)
SCALING
IV. KEY CONCEPTS (manual scaling deployment)
kubectl scale deployments/kubernetes-bootcamp --replicas=4
IV. KEY CONCEPTS (Deployement update 1/3)
IV. KEY CONCEPTS (Deployement update 2/3)
IV. KEY CONCEPTS (Deployement rollback 3/3)
DaemonSet - Pod will run on all
healthy nodes (Bypasses default
schedule)
Use case: Ideal for cluster wide
services such as log forwarding, or
health monitoring.
IV. KEY CONCEPTS (DaemonSet)
IV. KEY CONCEPTS (Deployment Summary)
Node Scope Scaling/Update/
Rollback
Label-Selector
support
ReplicationController One/Multiple/All No No
ReplicationSet One/Multiple/All No Yes
Deployment One/Multiple/All Yes Yes
DaemonSet All (mandatory)
(by pass scheduler)
No Yes
Service
● Logical set of Pods (and ways to access them)
● Four major Service Types:
○ CluterIP – internal access only
○ NodePort – external access via port on host
(mapping port containter = port on host)
○ LoadBalancer – external access via a
loadBalancer static IP (created by AWS, GCP,…
○ ExternalName - used to references endpoints
OUTSIDE the cluster by providing a static
internally referenced DNS name.
IV. KEY CONCEPTS (Service)
Put things together (Pod + Deployment + Service)
IV. KEY CONCEPTS (Pod/Deployement/Service)
LABEL &
SELECTOR
Ø Label - Key-value pairs that are used to identify,
describe and group together related sets of objects.
Ø Selector - Selectors use labels to filter/select objects.
Support 2 kinds of selection:
● Equality-based selector: (=, ==, !=)
● Set-based selector: ( In, NotIn, Exists, DoesNotExist )
IV. KEY CONCEPTS (labels & selector)
IV. KEY CONCEPTS (labels & selector)
Labels:
app: nginx
tier: frontned
Annotations
description: “nginx frontend”
Selector:
app: nginx
tier: frontend
IV. KEY CONCEPTS (labels & selector)
Equality-based selectors
Set-based selectors
Valid Operators:
● In
● NotIn
● Exists
● DoesNotExist
Supported Objects with set-
based selectors:
● Job
● Deployment
● ReplicaSet
● DaemonSet
● PersistentVolumeClaims
IV. KEY CONCEPTS (labels & selector)
STORAGE
Volume - Storage that is tied to the Pod
Lifecycle, consumable by one/more
containers within the pod (local resource)
IV. KEY CONCEPTS (Storage)
PersistentVolume (PV) -
represents a external
resource (linked to a backing
storage resource: NFS,
GCEPersistentDisk, EFS,..).
Lifecycle are provisioned
ahead of time &
independently from a pod.
IV. KEY CONCEPTS (Storage)
PersistentVolumeClaim
● mapping PV to pod’s storage.
● PVCs are scoped to namespaces
● Supports accessModes like PVs
IV. KEY CONCEPTS (Volume-Claim)
● Abstraction on top of
Persisten Volume with
configuration
● Uses an external system
defined by the provisioner to
dynamically consume and
allocate storage.
● Storage Class Fields
○ Provisioner
○ Parameters
○ reclaimPolicy
IV. KEY CONCEPTS (Storage class)
CONFIGMAP
&
SECRET
ConfigMap - shared variable/value between pods.
Could be retrieved by 2 ways:
q Pod’s Environment variable
q Volume mount
Secret - Functionally identical to ConfigMaps, but stored
encoded as base64, and encrypted at rest (if configured).
IV. KEY CONCEPTS (ConfigMap/Secret)
● Can be used in Pod Config:
○ Injected as a file in Volume Mount
○ Passed as an environment variable
IV. KEY CONCEPTS (ConfigMap/Secret)
AUTHENTICATION
WITH RBAC
(role-based access control)
K8S AUTHENTICATION MODEL
ServiceAccount
(defined at Pod)
RoleBinding/
ClusterRoleBinding
Role/
ClusterRole
API Server
Pod’s Token
(Authencate via RBAC plugin)
(Who-will-do)(What-to-do)
(ex: HTTP request
GET,POST,PUSH,DELETE
MASTER NODE
WORKER NODE
transfer
IV. KEY CONCEPTS (RBAC)
Architecture
Overview
Who
am I
???
Why
am I
here
???
[Cluster]Role
● Manage Resource
Permissions
● Resources: target
(pods/deployment/…)
● Verbs: actions
(get/list/watch/…)
IV. KEY CONCEPTS (RBAC)
● Mapping permission
of [Cluster]Role to
specific subjects:
○ User
○ Group
○ ServiceAccount
[Cluster]RoleBinding
IV. KEY CONCEPTS (RBAC)
IV. KEY CONCEPTS (RBAC)
1) All Pods can communicate with all other Pods without NAT
2) All nodes can communicate with all Pods (and vice-versa) without NAT.
3) The IP that a Pod sees itself as is the same IP that others see it as.
- from Kubernetes’ mother with love -
IV. KEY CONCEPTS (Networking)
IV. KEY CONCEPTS (Networking)
Containers talks in same Pod:
+ Use the same ClusterIP
+ Communicate via IPC/not via network
IV. KEY CONCEPTS (Networking)
Pods talks in
same Node
IV. KEY CONCEPTS (Networking)
Pods talks in Kubernetes cluster (1/3)
1) All Pods can
communicate with
all other Pods
without NAT
Pods talks in Kubernetes cluster (2/3)
IV. KEY CONCEPTS (Networking)
IV. KEY CONCEPTS (Networking)
Pods talks in Kubernetes cluster (3/3)
IV. KEY CONCEPTS (Networking)
AGENDA
I. DOCKER RECALL
II. KUBERNETES – A RISING HERO
III. K8S ARCHITECTURE
IV. KEY CONCEPTS
V. DEMOS
○ Horizontal Pod Autoscaling (HPA)
○ Wordpress webpage
IV. DEMO (HPA)
Demand
Capacity
Time
Resources
Autoscaling
Resources
IV. DEMO (HPA)
Kubelet daemon on each node
collect information metrics
(RAM,CPU,..) about pods
à Sent back to Metrics Server
(on Master node) for making
decision (scale-up/scale-down)
AGENDA
I. DOCKER RECALL
II. KUBERNETES – A RISING HERO
III. K8S ARCHITECTURE
IV. KEY CONCEPTS
V. DEMOS
○ Horizontal Pod Autoscaling (HPA)
○ Wordpress webpage
● Setup Kubernetes cluster on AWS EC2,
including etcds, master, workers (nodes)
● Deploy a WordPress site on Kubernetes
with default page at /
● Use Ingress for load balancing in
Kubernetes
● User request http://<dns_site>/careers, the
browser will be redirected to default page
(at /)
IV. DEMO (webpage requirement)
q AWS as cloud-provider
q Kubernetes cluster setup (master/workers)
q Wordpress container (deploy on all worker)
Backend storage for wordpress (EFS volume1)
q Mysql container as database
Backend storage for mysql (EFS volume2)
q Ingress/Ingress controller for loadbalancing & path-
based routing
IV. DEMO (webpage analysis)
QUESTIONS &
a little ANSWERS
# Deploy resources through manifest
kubectl create -f <name_of_manifeset>
Ex: kubectl create -f nginx.yaml
# Delete resource trough manifest
kubectl delete -f <name_of_manifeset>
Ex: kubectl delete -f nginx.yaml
# List resource on specific namespace,
# if not specify (--namespace=default) will be used.
kubectl get pods --namespace=foo
deployments
rolebindings
……..
# Get running logs of specific pod
kubectl logs <name_of_pod>
# Get details of resource (endpoint, configuration, container, resource usage,..)
kubectl describe pods <name_of_pod> --namespace=foo
deployments <name_of_deployment>
rolebindings <name_of_rolebindings>
Common kubectl command (1/3)
# Check the status of control plan (master node)
kubectl get componentstatuses
# Get ALL pods/deployement/services/nodes
kb get ingress,nodes,pods,services,deployments --all-namespaces
kb get all --all-namespaces
# Export information about pods/deployment/services/nodes into YAML,JSON,...
kubectl get nodes -o yaml | grep ExternalIP -C 1
kubectl get pods -o yaml | grep podIP
# Export information with COLUMN Customization
kubectl get po -o custom-columns=POD:metadata.name,NODE:spec.nodeName --sort-by
spec.nodeName -n kube-system
# View resource usage on each pod/node
kubectl top pods/nodes
Common kubectl command (2/3)
Common kubectl command (3/3)
# Attach to container & run specific cmd inside it
kubectl exec -it <name_of_pod> <linux_cmd_to_run>
Ex: kubectl exec –it nginx_app_axere1234 curl 10.20.30.40:443
kubectl exec –it nginx_app_adfb987 bash à login to shell of container
# Rolling Update
kubectl set image deployment/nginx-deployment nginx-container=nginx:1.15.4
# Checkstatus of rolling Update
kubectl rollout status deployment/nginx-deployment
# Rollout/Rollback to previous state
kubectl rollout undo deployment/nginx-deployment
# Get health-check of Kubernetes Cluster
kops validate cluster

More Related Content

What's hot

Introduction to Kubernetes - Docker Global Mentor Week 2016
Introduction to Kubernetes - Docker Global Mentor Week 2016Introduction to Kubernetes - Docker Global Mentor Week 2016
Introduction to Kubernetes - Docker Global Mentor Week 2016
Opsta
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple
Wojciech Barczyński
 
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and KubelessBuilding Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Bitnami
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)
Opsta
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
Docker, Inc.
 
Environment management in a continuous delivery world (3)
Environment management in a continuous delivery world (3)Environment management in a continuous delivery world (3)
Environment management in a continuous delivery world (3)
Victor Iglesias
 
Cloud spanner architecture and use cases
Cloud spanner architecture and use casesCloud spanner architecture and use cases
Cloud spanner architecture and use cases
GDG Cloud Bengaluru
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
Amy Chen
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
Janakiram MSV
 
Lessons learned from the charts repo
Lessons learned from the charts repoLessons learned from the charts repo
Lessons learned from the charts repo
Victor Iglesias
 
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-stepSetting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Oleg Chunikhin
 
Are you ready to be edgy? Bringing applications to the edge of the network
Are you ready to be edgy? Bringing applications to the edge of the networkAre you ready to be edgy? Bringing applications to the edge of the network
Are you ready to be edgy? Bringing applications to the edge of the network
Megan O'Keefe
 
Kubernetes basics and hands on exercise
Kubernetes basics and hands on exerciseKubernetes basics and hands on exercise
Kubernetes basics and hands on exercise
Cloud Technology Experts
 
A Primer on Kubernetes and Google Container Engine
A Primer on Kubernetes and Google Container EngineA Primer on Kubernetes and Google Container Engine
A Primer on Kubernetes and Google Container Engine
RightScale
 
Containerd + buildkit breakout
Containerd + buildkit breakoutContainerd + buildkit breakout
Containerd + buildkit breakout
Docker, Inc.
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
Knoldus Inc.
 
GPU enablement for data science on OpenShift | DevNation Tech Talk
GPU enablement for data science on OpenShift | DevNation Tech TalkGPU enablement for data science on OpenShift | DevNation Tech Talk
GPU enablement for data science on OpenShift | DevNation Tech Talk
Red Hat Developers
 
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
Phil Estes
 
Deploying your first application with Kubernetes
Deploying your first application with KubernetesDeploying your first application with Kubernetes
Deploying your first application with Kubernetes
OVHcloud
 

What's hot (20)

Introduction to Kubernetes - Docker Global Mentor Week 2016
Introduction to Kubernetes - Docker Global Mentor Week 2016Introduction to Kubernetes - Docker Global Mentor Week 2016
Introduction to Kubernetes - Docker Global Mentor Week 2016
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple
 
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and KubelessBuilding Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
Environment management in a continuous delivery world (3)
Environment management in a continuous delivery world (3)Environment management in a continuous delivery world (3)
Environment management in a continuous delivery world (3)
 
Cloud spanner architecture and use cases
Cloud spanner architecture and use casesCloud spanner architecture and use cases
Cloud spanner architecture and use cases
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
 
Lessons learned from the charts repo
Lessons learned from the charts repoLessons learned from the charts repo
Lessons learned from the charts repo
 
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-stepSetting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-step
 
Are you ready to be edgy? Bringing applications to the edge of the network
Are you ready to be edgy? Bringing applications to the edge of the networkAre you ready to be edgy? Bringing applications to the edge of the network
Are you ready to be edgy? Bringing applications to the edge of the network
 
Kubernetes basics and hands on exercise
Kubernetes basics and hands on exerciseKubernetes basics and hands on exercise
Kubernetes basics and hands on exercise
 
A Primer on Kubernetes and Google Container Engine
A Primer on Kubernetes and Google Container EngineA Primer on Kubernetes and Google Container Engine
A Primer on Kubernetes and Google Container Engine
 
Containerd + buildkit breakout
Containerd + buildkit breakoutContainerd + buildkit breakout
Containerd + buildkit breakout
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
 
GPU enablement for data science on OpenShift | DevNation Tech Talk
GPU enablement for data science on OpenShift | DevNation Tech TalkGPU enablement for data science on OpenShift | DevNation Tech Talk
GPU enablement for data science on OpenShift | DevNation Tech Talk
 
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
 
Deploying your first application with Kubernetes
Deploying your first application with KubernetesDeploying your first application with Kubernetes
Deploying your first application with Kubernetes
 

Similar to Kubernetes - A Rising Hero

Kuberenetes - From Zero to Hero
Kuberenetes  - From Zero to HeroKuberenetes  - From Zero to Hero
Kuberenetes - From Zero to Hero
Ori Stoliar
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
Bob Killen
 
Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)
Idan Atias
 
Introduction to istio
Introduction to istioIntroduction to istio
Introduction to istio
Andrea Monacchi
 
Kubernetes - how to orchestrate containers
Kubernetes - how to orchestrate containersKubernetes - how to orchestrate containers
Kubernetes - how to orchestrate containers
inovex GmbH
 
Multi-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerMulti-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service Broker
Amazon Web Services
 
Kubernetes for Beginners
Kubernetes for BeginnersKubernetes for Beginners
Kubernetes for Beginners
DigitalOcean
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
reInvent 2021 Recap and k9s review
reInvent 2021 Recap and k9s reviewreInvent 2021 Recap and k9s review
reInvent 2021 Recap and k9s review
Faheem Memon
 
Getting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdf
Getting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdfGetting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdf
Getting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdf
ssuser348b1c
 
Introduction to rook
Introduction to rookIntroduction to rook
Introduction to rook
Rohan Gupta
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
Vishal Biyani
 
kubernetes.pdf
kubernetes.pdfkubernetes.pdf
kubernetes.pdf
crezzcrezz
 
Rook - cloud-native storage
Rook - cloud-native storageRook - cloud-native storage
Rook - cloud-native storage
Karol Chrapek
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
Inhye Park
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
Shimi Bandiel
 
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
Docker-Hanoi
 
Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016
aspyker
 
Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016
Sharma Podila
 
Openshift service broker and catalog ocp-meetup july 2018
Openshift service broker and catalog  ocp-meetup july 2018Openshift service broker and catalog  ocp-meetup july 2018
Openshift service broker and catalog ocp-meetup july 2018
Michael Calizo
 

Similar to Kubernetes - A Rising Hero (20)

Kuberenetes - From Zero to Hero
Kuberenetes  - From Zero to HeroKuberenetes  - From Zero to Hero
Kuberenetes - From Zero to Hero
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
 
Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)
 
Introduction to istio
Introduction to istioIntroduction to istio
Introduction to istio
 
Kubernetes - how to orchestrate containers
Kubernetes - how to orchestrate containersKubernetes - how to orchestrate containers
Kubernetes - how to orchestrate containers
 
Multi-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerMulti-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service Broker
 
Kubernetes for Beginners
Kubernetes for BeginnersKubernetes for Beginners
Kubernetes for Beginners
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
reInvent 2021 Recap and k9s review
reInvent 2021 Recap and k9s reviewreInvent 2021 Recap and k9s review
reInvent 2021 Recap and k9s review
 
Getting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdf
Getting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdfGetting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdf
Getting-Started-with-Containers-and-Kubernetes_-March-2020-CNCF-Webinar.pdf
 
Introduction to rook
Introduction to rookIntroduction to rook
Introduction to rook
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
kubernetes.pdf
kubernetes.pdfkubernetes.pdf
kubernetes.pdf
 
Rook - cloud-native storage
Rook - cloud-native storageRook - cloud-native storage
Rook - cloud-native storage
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
 
Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016
 
Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016
 
Openshift service broker and catalog ocp-meetup july 2018
Openshift service broker and catalog  ocp-meetup july 2018Openshift service broker and catalog  ocp-meetup july 2018
Openshift service broker and catalog ocp-meetup july 2018
 

More from Huynh Thai Bao

Service Mesh 101 - Digging into your service
Service Mesh 101 - Digging into your service Service Mesh 101 - Digging into your service
Service Mesh 101 - Digging into your service
Huynh Thai Bao
 
K8s Webhook Admission
K8s Webhook AdmissionK8s Webhook Admission
K8s Webhook Admission
Huynh Thai Bao
 
CICD pipelines with GitOps
CICD pipelines with GitOpsCICD pipelines with GitOps
CICD pipelines with GitOps
Huynh Thai Bao
 
ELK - Optimizations & Updates
ELK - Optimizations & UpdatesELK - Optimizations & Updates
ELK - Optimizations & Updates
Huynh Thai Bao
 
K8s-zero-downtime-the-missing-part
K8s-zero-downtime-the-missing-partK8s-zero-downtime-the-missing-part
K8s-zero-downtime-the-missing-part
Huynh Thai Bao
 
Cassandra - decentralized structured database
Cassandra - decentralized structured databaseCassandra - decentralized structured database
Cassandra - decentralized structured database
Huynh Thai Bao
 
Skaffold - faster development on K8S
Skaffold - faster development on K8SSkaffold - faster development on K8S
Skaffold - faster development on K8S
Huynh Thai Bao
 
Vault - Enhancement for K8S secret security
Vault - Enhancement for K8S secret securityVault - Enhancement for K8S secret security
Vault - Enhancement for K8S secret security
Huynh Thai Bao
 
Enabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for ImplementationEnabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for Implementation
Huynh Thai Bao
 
GCP Best Practices for SRE Team
GCP Best Practices for SRE TeamGCP Best Practices for SRE Team
GCP Best Practices for SRE Team
Huynh Thai Bao
 

More from Huynh Thai Bao (10)

Service Mesh 101 - Digging into your service
Service Mesh 101 - Digging into your service Service Mesh 101 - Digging into your service
Service Mesh 101 - Digging into your service
 
K8s Webhook Admission
K8s Webhook AdmissionK8s Webhook Admission
K8s Webhook Admission
 
CICD pipelines with GitOps
CICD pipelines with GitOpsCICD pipelines with GitOps
CICD pipelines with GitOps
 
ELK - Optimizations & Updates
ELK - Optimizations & UpdatesELK - Optimizations & Updates
ELK - Optimizations & Updates
 
K8s-zero-downtime-the-missing-part
K8s-zero-downtime-the-missing-partK8s-zero-downtime-the-missing-part
K8s-zero-downtime-the-missing-part
 
Cassandra - decentralized structured database
Cassandra - decentralized structured databaseCassandra - decentralized structured database
Cassandra - decentralized structured database
 
Skaffold - faster development on K8S
Skaffold - faster development on K8SSkaffold - faster development on K8S
Skaffold - faster development on K8S
 
Vault - Enhancement for K8S secret security
Vault - Enhancement for K8S secret securityVault - Enhancement for K8S secret security
Vault - Enhancement for K8S secret security
 
Enabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for ImplementationEnabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for Implementation
 
GCP Best Practices for SRE Team
GCP Best Practices for SRE TeamGCP Best Practices for SRE Team
GCP Best Practices for SRE Team
 

Recently uploaded

Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
Kamal Acharya
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 

Recently uploaded (20)

Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 

Kubernetes - A Rising Hero

  • 2. I. CONTAINER RECALL II. KUBERNETES – A RISING HERO III. K8S ARCHITECTURE IV. KEY CONCEPTS V. DEMOS AGENDA
  • 3. AGENDA I. CONTAINER RECALL ○ Microservice & Container approach ○ Docker II. KUBERNETES – A RISING HERO III. K8S ARCHITECTURE IV. KEY CONCEPTS V. DEMOS
  • 7. AGENDA I. DOCKER RECALL II. KUBERNETES – A RISING HERO o Kuber-what ? o Why Kuberenetes III. K8S ARCHITECTURE IV. KEY CONCEPTS
  • 8. “Kubernetes is an open-source platform for : - automating deployment - scaling - operations of containers across cluster of host à providing container-centric infrastructure” - from Kubernetes’ father with love - II.KUBERNETES – A RISING HERO
  • 9. II.KUBERNETES – A RISING HERO
  • 10. II.KUBERNETES – A RISING HERO / CU-BÉ NÉ-ĐỊT /
  • 11. II.KUBERNETES – A RISING HERO
  • 12. II.KUBERNETES – A RISING HERO
  • 13. KUBERNETES, WHY ? VM1 # ssh root@VM1 # docker run nginx –p 8080:80 … VM2 # ssh root@VM2 # docker run nginx –p 8080:80 … …... …... …... II.KUBERNETES – A RISING HERO
  • 15. • Deployment/Provision one or multiple containers • Replicas of containers on multihost • Data volumes for persistent storage management • Multihost Overlay networking • …….. KUBERNETES, WHY ? II.KUBERNETES – A RISING HERO
  • 16. AGENDA I. DOCKER RECALL II. KUBERNETES – A RISING HERO III. K8S ARCHITECTURE ○ Master node ○ Worker node ○ Additional Services IV. KEY CONCEPTS V. DEMOS
  • 17.
  • 18. Master (Control plane for Kubernetes) ● kube-API Server: gatekeeper to handle HTTP request between control plan & workers. ● kube-Scheduler: evaluates workload and place it on a matching resource ● kube-Cluster controller: manages all core component control loops: - Monitors the cluster state via the apiserver - Steers the cluster towards the desired state with cloud-provider (AWS, GCP, Azure,..) component. ● etcd: provide highly available key-value database III. K8S ARCHITECTURE
  • 19. ● the ‘place’, where pod/containers run on, care ‘workload’ of cluster ● Daemon: - kubelet: managing pod lifecycle on its host + interact with APIServer (master) - kube-proxy: load balancing/connection forwarding between pods. Nodes/Workers III. K8S ARCHITECTURE
  • 20. § Kube-dns - Provides cluster wide DNS Services. Services are resolvable to <service>.<namespace>.svc.cluster.local. § Heapster - Metrics Collector for kubernetes cluster, used by some resources: Horizontal Pod Autoscaler or Dashboard Metrics,… § Kube-dashboard - A general purpose web based UI for kubernetes. III. K8S ARCHITECTURE Additional Services
  • 21. AGENDA I. DOCKER RECALL II. KUBERNETES – A RISING HERO III. K8S ARCHITECTURE IV. KEY CONCEPTS ○ Pod/Deloyment/Service ○ Storage ○ ConfigMap/Secret ○ Authentication and Identity with RBAC ○ Networking V. DEMOS
  • 23. Pod - A pod is the smallest unit of work/management resource within Kubernetes. Pods comprise of: IV. KEY CONCEPTS (Pod)
  • 24. Pod - example manisfest IV. KEY CONCEPTS (Pod)
  • 25. ReplicationController – keeps track of pod replicas and their lifecycle. ReplicaSet - Next Generation ReplicationController. Supports set-based selectors. IV. KEY CONCEPTS (Deployement)
  • 26. Deployment § Type of replicaton - backed by ReplicaSets § Keeps track of state change history § Provides scaling/update/rollback functionality IV. KEY CONCEPTS (Deployement)
  • 27. SCALING IV. KEY CONCEPTS (manual scaling deployment) kubectl scale deployments/kubernetes-bootcamp --replicas=4
  • 28. IV. KEY CONCEPTS (Deployement update 1/3)
  • 29. IV. KEY CONCEPTS (Deployement update 2/3)
  • 30. IV. KEY CONCEPTS (Deployement rollback 3/3)
  • 31. DaemonSet - Pod will run on all healthy nodes (Bypasses default schedule) Use case: Ideal for cluster wide services such as log forwarding, or health monitoring. IV. KEY CONCEPTS (DaemonSet)
  • 32. IV. KEY CONCEPTS (Deployment Summary) Node Scope Scaling/Update/ Rollback Label-Selector support ReplicationController One/Multiple/All No No ReplicationSet One/Multiple/All No Yes Deployment One/Multiple/All Yes Yes DaemonSet All (mandatory) (by pass scheduler) No Yes
  • 33. Service ● Logical set of Pods (and ways to access them) ● Four major Service Types: ○ CluterIP – internal access only ○ NodePort – external access via port on host (mapping port containter = port on host) ○ LoadBalancer – external access via a loadBalancer static IP (created by AWS, GCP,… ○ ExternalName - used to references endpoints OUTSIDE the cluster by providing a static internally referenced DNS name. IV. KEY CONCEPTS (Service)
  • 34. Put things together (Pod + Deployment + Service)
  • 35. IV. KEY CONCEPTS (Pod/Deployement/Service)
  • 37. Ø Label - Key-value pairs that are used to identify, describe and group together related sets of objects. Ø Selector - Selectors use labels to filter/select objects. Support 2 kinds of selection: ● Equality-based selector: (=, ==, !=) ● Set-based selector: ( In, NotIn, Exists, DoesNotExist ) IV. KEY CONCEPTS (labels & selector)
  • 38. IV. KEY CONCEPTS (labels & selector)
  • 39. Labels: app: nginx tier: frontned Annotations description: “nginx frontend” Selector: app: nginx tier: frontend IV. KEY CONCEPTS (labels & selector) Equality-based selectors
  • 40. Set-based selectors Valid Operators: ● In ● NotIn ● Exists ● DoesNotExist Supported Objects with set- based selectors: ● Job ● Deployment ● ReplicaSet ● DaemonSet ● PersistentVolumeClaims IV. KEY CONCEPTS (labels & selector)
  • 42. Volume - Storage that is tied to the Pod Lifecycle, consumable by one/more containers within the pod (local resource) IV. KEY CONCEPTS (Storage)
  • 43. PersistentVolume (PV) - represents a external resource (linked to a backing storage resource: NFS, GCEPersistentDisk, EFS,..). Lifecycle are provisioned ahead of time & independently from a pod. IV. KEY CONCEPTS (Storage)
  • 44. PersistentVolumeClaim ● mapping PV to pod’s storage. ● PVCs are scoped to namespaces ● Supports accessModes like PVs IV. KEY CONCEPTS (Volume-Claim)
  • 45. ● Abstraction on top of Persisten Volume with configuration ● Uses an external system defined by the provisioner to dynamically consume and allocate storage. ● Storage Class Fields ○ Provisioner ○ Parameters ○ reclaimPolicy IV. KEY CONCEPTS (Storage class)
  • 46.
  • 48. ConfigMap - shared variable/value between pods. Could be retrieved by 2 ways: q Pod’s Environment variable q Volume mount Secret - Functionally identical to ConfigMaps, but stored encoded as base64, and encrypted at rest (if configured). IV. KEY CONCEPTS (ConfigMap/Secret)
  • 49. ● Can be used in Pod Config: ○ Injected as a file in Volume Mount ○ Passed as an environment variable IV. KEY CONCEPTS (ConfigMap/Secret)
  • 51. K8S AUTHENTICATION MODEL ServiceAccount (defined at Pod) RoleBinding/ ClusterRoleBinding Role/ ClusterRole API Server Pod’s Token (Authencate via RBAC plugin) (Who-will-do)(What-to-do) (ex: HTTP request GET,POST,PUSH,DELETE MASTER NODE WORKER NODE transfer IV. KEY CONCEPTS (RBAC)
  • 54. [Cluster]Role ● Manage Resource Permissions ● Resources: target (pods/deployment/…) ● Verbs: actions (get/list/watch/…) IV. KEY CONCEPTS (RBAC)
  • 55. ● Mapping permission of [Cluster]Role to specific subjects: ○ User ○ Group ○ ServiceAccount [Cluster]RoleBinding IV. KEY CONCEPTS (RBAC)
  • 57.
  • 58. 1) All Pods can communicate with all other Pods without NAT 2) All nodes can communicate with all Pods (and vice-versa) without NAT. 3) The IP that a Pod sees itself as is the same IP that others see it as. - from Kubernetes’ mother with love - IV. KEY CONCEPTS (Networking)
  • 59. IV. KEY CONCEPTS (Networking) Containers talks in same Pod: + Use the same ClusterIP + Communicate via IPC/not via network
  • 60. IV. KEY CONCEPTS (Networking) Pods talks in same Node
  • 61. IV. KEY CONCEPTS (Networking) Pods talks in Kubernetes cluster (1/3) 1) All Pods can communicate with all other Pods without NAT
  • 62. Pods talks in Kubernetes cluster (2/3) IV. KEY CONCEPTS (Networking)
  • 63. IV. KEY CONCEPTS (Networking) Pods talks in Kubernetes cluster (3/3)
  • 64. IV. KEY CONCEPTS (Networking)
  • 65. AGENDA I. DOCKER RECALL II. KUBERNETES – A RISING HERO III. K8S ARCHITECTURE IV. KEY CONCEPTS V. DEMOS ○ Horizontal Pod Autoscaling (HPA) ○ Wordpress webpage
  • 67. IV. DEMO (HPA) Kubelet daemon on each node collect information metrics (RAM,CPU,..) about pods à Sent back to Metrics Server (on Master node) for making decision (scale-up/scale-down)
  • 68. AGENDA I. DOCKER RECALL II. KUBERNETES – A RISING HERO III. K8S ARCHITECTURE IV. KEY CONCEPTS V. DEMOS ○ Horizontal Pod Autoscaling (HPA) ○ Wordpress webpage
  • 69. ● Setup Kubernetes cluster on AWS EC2, including etcds, master, workers (nodes) ● Deploy a WordPress site on Kubernetes with default page at / ● Use Ingress for load balancing in Kubernetes ● User request http://<dns_site>/careers, the browser will be redirected to default page (at /) IV. DEMO (webpage requirement)
  • 70. q AWS as cloud-provider q Kubernetes cluster setup (master/workers) q Wordpress container (deploy on all worker) Backend storage for wordpress (EFS volume1) q Mysql container as database Backend storage for mysql (EFS volume2) q Ingress/Ingress controller for loadbalancing & path- based routing IV. DEMO (webpage analysis)
  • 71.
  • 73.
  • 74. # Deploy resources through manifest kubectl create -f <name_of_manifeset> Ex: kubectl create -f nginx.yaml # Delete resource trough manifest kubectl delete -f <name_of_manifeset> Ex: kubectl delete -f nginx.yaml # List resource on specific namespace, # if not specify (--namespace=default) will be used. kubectl get pods --namespace=foo deployments rolebindings …….. # Get running logs of specific pod kubectl logs <name_of_pod> # Get details of resource (endpoint, configuration, container, resource usage,..) kubectl describe pods <name_of_pod> --namespace=foo deployments <name_of_deployment> rolebindings <name_of_rolebindings> Common kubectl command (1/3)
  • 75. # Check the status of control plan (master node) kubectl get componentstatuses # Get ALL pods/deployement/services/nodes kb get ingress,nodes,pods,services,deployments --all-namespaces kb get all --all-namespaces # Export information about pods/deployment/services/nodes into YAML,JSON,... kubectl get nodes -o yaml | grep ExternalIP -C 1 kubectl get pods -o yaml | grep podIP # Export information with COLUMN Customization kubectl get po -o custom-columns=POD:metadata.name,NODE:spec.nodeName --sort-by spec.nodeName -n kube-system # View resource usage on each pod/node kubectl top pods/nodes Common kubectl command (2/3)
  • 76. Common kubectl command (3/3) # Attach to container & run specific cmd inside it kubectl exec -it <name_of_pod> <linux_cmd_to_run> Ex: kubectl exec –it nginx_app_axere1234 curl 10.20.30.40:443 kubectl exec –it nginx_app_adfb987 bash à login to shell of container # Rolling Update kubectl set image deployment/nginx-deployment nginx-container=nginx:1.15.4 # Checkstatus of rolling Update kubectl rollout status deployment/nginx-deployment # Rollout/Rollback to previous state kubectl rollout undo deployment/nginx-deployment # Get health-check of Kubernetes Cluster kops validate cluster