kubernetes101 - pune kubernetes meetup 6
TRANSCRIPT
![Page 1: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/1.jpg)
KUBERNETES 101
HANDS ON WORKSHOP
KUBERNETES MEETUP PUNE10 June 2017
![Page 2: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/2.jpg)
HARSHAL SHAHSolutions Architect
infraCloud technologies (www.infracloud.io )
https://twitter.com/harshal2623
1st Kubernetes partner India2nd in APAC region
Rancher partner - APAC
![Page 3: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/3.jpg)
InfraCloud has published a FREE eBook on
“Scaling and deploying Kubernetes”
http://info.rancher.com/deploying-scaling-kubernetes-ebook
![Page 4: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/4.jpg)
TIMELINES
Time (Minutes - total 135) Agenda
00 - 15 Introduction & Setting up
15 - 45 Quick walkthrough of concepts
45 - 75 3 concepts, code & labs - 10 minute each
75 - 80 Break
80 - 110 3 concept, code & labs - 10 min each
110 - 135 Open House
![Page 5: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/5.jpg)
Lab - Setup Kubernetes in GKE & laptop
• GKE Cluster creation
• Kubectl on Google Cloud Console
• Run command “kubectl proxy --port=8080”
• Click this button
• Append “/ui/” as shown in below highlight to
open the Kubernetes Dashboard
● git clone https://github.com/infracloudio/kubernetes-101
![Page 6: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/6.jpg)
TABLE OF CONTAINERS.. ..
• What is Kubernetes, exactly?
• How to setup a Kubernetes Cluster?
• Various ways to get started with a Kubernetes cluster
• Kubernetes Architecture
• Kubernetes Concepts
• POD, Deployments, Services, Labels & Selectors etc.
• Kubectl Usage
• Deploying app with Helm
![Page 7: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/7.jpg)
KUBERNETES - THE BOOKISH DEFINITION
• Kubernetes is an open-source platform for automating deployment, scaling, and operations of application containers across clusters of hosts, providing container-centric infrastructure (From
http://kubernetes.io/docs/whatisk8s/)
Open source project by Google
Primarily targeted at containerized
workloads
Platform - automates deployment, scaling etc.
Abstracts hosts and underlying
infrastructure from you
Portable - Run on public/private cloud, data
center, your laptop -doesn’t matter
Self - healing: It restarts, replaces, scales, monitors
Containers
Extensible - replace certain components if you want
to. Extend with pluggable architecture
![Page 8: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/8.jpg)
KUBERNETES HAS COMMON PATTERNS/DESIGNS
Need to run related processes together in a
shared context
Integrating with underlying storage (Block or Bucket
based)
Check health of applications and maintain
certain number of instances.
Scale instances based on triggers.
Load balancing between multiple instances of a
container
Provide easy and scalable way to locate and reach
services (Aka service discovery and naming)
Monitoring and log management
Tagging and searching instances dynamically to
do certain operations (For example list all web servers
across all applications)
Rolling updates, Canary deployments
Everything is API based- so can be integrated with
external systems.
![Page 9: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/9.jpg)
SETTING UP KUBERNETES
On Cloud & managed
Google Container
EngineStackpointCloud
Tectonic from CoreOS
OpenShift Online
DIY - any cloud/data center
Kubeadm(official utility)
DIY On steroids
KOPS (Targeted to
AWS)
Kismatic from Apprenda
Rancher -provides
enterprise features, multi cluster support
Redhat OpenShift -comes with complete lifecycle features
Many more: http://kubernetes.io/docs/getting-started-guides
Platform9
![Page 10: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/10.jpg)
KUBERNETES ARCHITECTURE
Image Source: info.rancher.com/deploying-scaling-kubernetes-ebook
![Page 11: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/11.jpg)
POD
• Related containers together
• Share same IP, port space & storage etc.
• It’s a single unit for all practical purposes
Code & Demo: Pod - create and destroy
Pod
flask
redis
NFSiSCSIGCE
10.10.1.100
![Page 12: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/12.jpg)
POD - LAB
![Page 13: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/13.jpg)
What just happened?
* Courtesy Julia Evans blog which
is an awesome place to learn many
things http://jvns.ca
Twitter : @b0rk
![Page 14: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/14.jpg)
HEALTHCHECK
Hey, app v1... You ready?
KubeletPod
app v1
![Page 15: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/15.jpg)
HEALTHCHECK - LAB
![Page 16: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/16.jpg)
DEPLOYMENT
• Drive desired state
• Maintain desired POD instances
• Enable deployment mechanisms such as rolling deploy, Canary, pause/resume etc.
Deployment
ReplicaSet
Pod
![Page 17: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/17.jpg)
DEPLOYMENT LAB
![Page 18: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/18.jpg)
ROLLING UPGRADE - DEPLOYMENT LAB
![Page 19: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/19.jpg)
SERVICES
• Provide a fixed endpoint for PODs irrespective of deletion/movement/modification of POD
• Expose services/endpoints to outside cluster or to world
• Services utilize labels to target PODs to represent
![Page 20: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/20.jpg)
SERVICE TYPES
ExternalName (Kubernetes 1.5 onwards)
• Serves as a way to return an alias to an external service residing outside the cluster.
ClusterIP (Default)
• Exposes service only within cluster
NodePort
• Creates a ClusterIP + exposes the same port on every node/host. This is typically used if you want to use an external loadBalancer
LoadBalancer
• NodePort+Creates a LB in cloud provider (Such as ELB) and points to respective ports
![Page 21: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/21.jpg)
SERVICES- LAB
![Page 22: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/22.jpg)
LABELS AND SELECTORS
Labels:
“relase”:”1.4”
“environment”:”QA”
“app”:”billing”
Selectors:
env = prod
release in (1.3, 1.4)
app != payment
• Classification mechanism
• Labels
• Tag things
• Think like “roles”
• Selectors
• Filters & conditions
![Page 23: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/23.jpg)
EXAMPLE
Pod
hello
Pod
hello
labels:version: v1track: stable
labels:version: v1track: test
selector: “version=v1” selector: “track=stable”
Pod
hello
Pod
hello
labels:version: v1track: stable
labels:version: v1track: test
![Page 24: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/24.jpg)
SECRETS & CONFIG MAPS
• Secrets
• Deliver sensitive data to intended target
• ConfigMap
• Configuration properties
![Page 25: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/25.jpg)
NAMESPACES & NODES
• Namespaces
• Logically separate cluster
• Nodes
• Info about nodes
![Page 26: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/26.jpg)
MORE TYPES
Storage classes for handling persistent data. They interact with cloud
provider's storage.
StatefulSet - for managing clusters with
strong identity requirements (Kafka,
Elastic, Zookeeper etc.)
DaemonSet - things which need to run on a
set or all nodes of cluster. For example
logging agents
Job - ensures a certain number of PODs execute
the process and upon completion terminates.
(For batch jobs)
![Page 27: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/27.jpg)
RESOURCES• The workshop material & codelabs at
https://github.com/GoogleCloudPlatform/kubernetes-workshops
• http://kubernetesbyexample.com
• http://info.rancher.com/deploying-scaling-kubernetes-ebook
• Another awesome resource for kubernetes hands on is from Kamal Marhubi at Part1, Part2, Part3
![Page 28: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/28.jpg)
Scalable Microservices with Kubernetes
https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615
![Page 29: Kubernetes101 - Pune Kubernetes Meetup 6](https://reader038.vdocument.in/reader038/viewer/2022100803/5aaba4677f8b9ac7658b460d/html5/thumbnails/29.jpg)
ধন্যবাদ!
Dank je!Kiitos!આભાર!
धन्यवाद!Grazie!
Je vous remercie!
ありがとうございました!
ਤੁਹਾਡਾ ਧੰਨਵਾਦ!
நன்றி!ధన్యవాదాలు!
നന്ദി!
THANK YOU!