SlideShare a Scribd company logo
1 of 31
Kubernetes Introduction
Milos Zubal
Waterford Tech. Meetup 31.01.2018
Who’s this?!
@MilosZubal
Software Engineer at
(we’re hiring! ;) )
10+ years of backend Java happiness
https://www.linkedin.com/in/miloszubal/
https://github.com/mzubal
https://twitter.com/MilosZubal
What are we
going to cover
today?
● Big Picture of Kubernetes (k8s)
● History and main features of k8s
● Small recap of containers
● Architecture of k8s
● Main k8s primitives + examples
● Other features
● Running Kubernetes
● Demo
● Bonus: Czech accent all along the
way! :)
(all of that in 30-35 minutes - managers would
call this “ambitious plan”)
Why Microservices? To tame the kludgy Monolith?
(the whole story at: https://cloud.google.com/kubernetes-engine/kubernetes-comic/)
Let’s go Microservices, but what about...
● Service Discovery
● Load Balancing
● Networking
● Storage
● Monitoring
● Clustering
● Logs
● Many other things...
Kubernetes - Big Picture
Is this like Serverless?
● Better term would be “Server-agnostic”
● K8s API tries to be as server-agnostic
as possible
● K8s API is declarative
○ You defined the desired state
rather than actions
Kubernetes - few facts
● Open-source container orchestration platform
● Kubernetes == greek for “Helmsman” or “Pilot”
● Often abbreviated as k8s
● Based on Google’s internal system (Borg), which reflects their experience of running
containers for more than 15 years
● First released in 2015 and later donated to the Cloud Native Computing Foundation
● Big and vibrant community
● Biggest contributors - Google and RedHat
Kubernetes - popularity
Containers recap
● Containers == lightweight “VMs”
● They are basically cleverly isolated
processes running on the same
OS/kernel (using
cgroups/namespaces)
● You can adjust networking/volumes
between host and containers
● Current container techs. - docker,
rkt, lmctfy
Kubernetes - Architecture
Kubernetes - Architecture
● Master - a node holding the configuration and managing the cluster
● Node - a worker machine (bare metal, virtual, cloud) hosting Pods
● Kubectl - console for the API, allows modifying/uploading configuration
● API - REST api to modify the configuration (which is stored in etcd)
● Scheduler - gathers info about Nodes (utilisation) and decides where to spawn new
Pods
● Controller Manager - Checks and enforces the current config in the cluster (e.g.
ReplicaSet)
● Kubelet - agent running on each Node, providing info to master, creating Pods
● Kube-proxy - serves for inter-Pod and inter-Node communication
● Pod - container(s) running the actual application
Pod - contains the app
● Basic unit in k8s, can expose ports
● One or more containers sharing the same
namespace, resources, volumes, network
(localhost), ports, etc.
● Each container is defined by its image
● Limits for CPU / RAM
● Set of labels (we will learn more about them later)
● Can have health / readiness checks
● Containers in pod get automatically restarted in case
they crash or fail the health check
● Pod might get rescheduled to other Node
● You can also mount Volumes to Pods or inject
some configuration (via ConfigMaps and Secrets)
ReplicaSet - scaling / self-healing
● A set of Pods based on a Number of Pods, Pod Template and a Selector
● Allows defining clusters of the same Pod (application)
● Number of Pods - the desired number of replicas to be running in cluster
● Pod Template - basically the same like Pod definition (image, labels, resources)
● Selector - a set of matchers to match the Pods in cluster by labels
○ E.g. “app: elastic AND version: 6.1.2 AND env: prod”
○ Usually matches the labels defined in the Pod Template
● Kubernetes makes sure there is the exact number of defined Pods in the cluster
Replica Set 1
Replica Set 2
Replica Set 3
Replica Set 4
Replica Set 5
Service - service discover / load-balancing
● Addresses/ports of Pods are dynamically assigned every time a Pod is created
○ You cannot rely on them when trying to call an app running in other Pod
● Service solves the problem by providing a stable clusterIp/port for Pod(s)
● The Service is defined by a selector (the same as in ReplicaSet) and a port
● E.g. “app: elastic AND version: 6.1.2 AND env: prod” + port: 9200
● 3 modes of operation to choose from: userspace, iptables (default) and ipvs
○ K8s will alter the iptables accordingly on all the Nodes
● The Service Discovery is implemented either by injecting variables or using DNS
○ E.g. ELASTIC_SERVICE_HOST / ELASTIC_SERVICE_PORT get injected into
every Pod
○ Or there is ‘elastic’ DNS record, so all the other Pods can rely on that
Service
Volumes / Persistent Volumes - Storage
● Not exactly the same thing as Docker volumes
● Volume - tight to a Pod lifecycle (survives container restarts)
● Persistent Volumes - can be reused by another Pod (of the same type)
● Many adapters supported - local volumes, AWS EBS, GCEPersistentDisk, Ceph,
Gluster, ScaleIO and many others
● Persistent Volume Claim - a way to decouple the definition of storage and apps
claiming that storage (claim can be reused)
● Storage Class - a way to define properties of the storage (IOPS, zone, etc.) - the
claim can be based on these (e.g. demanding a fast volume in us-east)
Deployments
● Deployments provide a way to define a deployment strategy for a Pod
● Its definition is very similar to ReplicaSet, but it adds the strategy
● 2 strategies - Recreate and RollingUpdate
● RollingUpdate
○ maxUnavailable - max. number or percentage of Pods unavailable during update
○ maxSurge - max. number or percentage to create over the replica count
○ You can also define a time period for which the Pod must be healthy before
moving to another
Deployments 1
Deployments 2
Deployments 3
Some of the other Primitives
● Network Policies - defining access in the cluster and to/from outside
● Ingress - inbound http rules, TLS termination, external loadbalancing, etc.
● Jobs - one-time jobs
● StatefulSet - solution to master/slave stores (e.g. MySQL, Redis, etc.)
● Namespaces - means to separate different “parts” of cluster (e.g. by environment)
Deployment Options
● Local - minikube (used in the demo later)
● Hosted - Google (GKE), RedHat (OpenShift), Microsoft (Azure CS), AWS (EKS) and
many others
● VMs - Vagrant, vSphere (Vmware), oVirt
● Bare Metal - CentOS, Fedora, Ubuntu, CoreOS
Resources
● https://kubernetes.io/
● https://cloud.google.com/kubernetes-engine/kubernetes-comic/
● https://speakerdeck.com/luxas/intro-to-the-cloud-native-world-of-kubernetes-helsinki-
october-meetup
● http://lmgtfy.com/?q=kubernetes
● http://shop.oreilly.com/product/0636920043874.do
(well, in case we have the time...)
Thanks!
Any Questions?
Head is going to explode? (Don’t
worry, mine is too!)
See you later!
Later Gator!

More Related Content

What's hot

Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101
inside-BigData.com
 

What's hot (20)

Container orchestration
Container orchestrationContainer orchestration
Container orchestration
 
Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)
 
Endocode Kubernetes Meetup: Architecture Patterns for Microservices in Kubern...
Endocode Kubernetes Meetup: Architecture Patterns for Microservices in Kubern...Endocode Kubernetes Meetup: Architecture Patterns for Microservices in Kubern...
Endocode Kubernetes Meetup: Architecture Patterns for Microservices in Kubern...
 
Introdution to Docker (theory and hands on) dbCafé - dbTrento
Introdution to Docker (theory and hands on) dbCafé - dbTrentoIntrodution to Docker (theory and hands on) dbCafé - dbTrento
Introdution to Docker (theory and hands on) dbCafé - dbTrento
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101
 
Container-relevant Upstream Kernel Developments
Container-relevant Upstream Kernel DevelopmentsContainer-relevant Upstream Kernel Developments
Container-relevant Upstream Kernel Developments
 
Docker internals
Docker internalsDocker internals
Docker internals
 
Gluster as Native Storage for Containers - past, present and future
Gluster as Native Storage for Containers - past, present and futureGluster as Native Storage for Containers - past, present and future
Gluster as Native Storage for Containers - past, present and future
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and Windows
 
Leverage LXC/LXD with Kubernetes
Leverage LXC/LXD with KubernetesLeverage LXC/LXD with Kubernetes
Leverage LXC/LXD with Kubernetes
 
Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6
 
Container (Docker) Orchestration Tools
Container (Docker) Orchestration ToolsContainer (Docker) Orchestration Tools
Container (Docker) Orchestration Tools
 
Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
 
Deploy at scale with CoreOS Kubernetes and Apache Stratos
Deploy at scale with CoreOS Kubernetes and Apache StratosDeploy at scale with CoreOS Kubernetes and Apache Stratos
Deploy at scale with CoreOS Kubernetes and Apache Stratos
 
Running Docker with OpenStack | Docker workshop #1
Running Docker with OpenStack | Docker workshop #1Running Docker with OpenStack | Docker workshop #1
Running Docker with OpenStack | Docker workshop #1
 
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copyLinux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
 
DevOps in AWS with Kubernetes
DevOps in AWS with KubernetesDevOps in AWS with Kubernetes
DevOps in AWS with Kubernetes
 

Similar to Kubernetes Introduction

Similar to Kubernetes Introduction (20)

Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
 
Introduction to istio
Introduction to istioIntroduction to istio
Introduction to istio
 
Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209
 
Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)
 
Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...
 Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra... Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...
Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...
 
Containers > VMs
Containers > VMsContainers > VMs
Containers > VMs
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 
Kubernetes-introduction to kubernetes for beginers.pptx
Kubernetes-introduction to kubernetes for beginers.pptxKubernetes-introduction to kubernetes for beginers.pptx
Kubernetes-introduction to kubernetes for beginers.pptx
 
Introduction to rook
Introduction to rookIntroduction to rook
Introduction to rook
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
K8s@Pollfish - Can you run a monolith on k8s?
K8s@Pollfish - Can you run a monolith on k8s?K8s@Pollfish - Can you run a monolith on k8s?
K8s@Pollfish - Can you run a monolith on k8s?
 
ARCHITECTING TENANT BASED QOS IN MULTI-TENANT CLOUD PLATFORMS
ARCHITECTING TENANT BASED QOS IN MULTI-TENANT CLOUD PLATFORMSARCHITECTING TENANT BASED QOS IN MULTI-TENANT CLOUD PLATFORMS
ARCHITECTING TENANT BASED QOS IN MULTI-TENANT CLOUD PLATFORMS
 
Kubernetes: My BFF
Kubernetes: My BFFKubernetes: My BFF
Kubernetes: My BFF
 
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
 
Distributed Tensorflow with Kubernetes - data2day - Jakob Karalus
Distributed Tensorflow with Kubernetes - data2day - Jakob KaralusDistributed Tensorflow with Kubernetes - data2day - Jakob Karalus
Distributed Tensorflow with Kubernetes - data2day - Jakob Karalus
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
[WSO2Con EU 2018] Deploying Applications in K8S and Docker
[WSO2Con EU 2018] Deploying Applications in K8S and Docker[WSO2Con EU 2018] Deploying Applications in K8S and Docker
[WSO2Con EU 2018] Deploying Applications in K8S and Docker
 

Recently uploaded

+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 

Recently uploaded (20)

kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 

Kubernetes Introduction

  • 2. Who’s this?! @MilosZubal Software Engineer at (we’re hiring! ;) ) 10+ years of backend Java happiness https://www.linkedin.com/in/miloszubal/ https://github.com/mzubal https://twitter.com/MilosZubal
  • 3. What are we going to cover today? ● Big Picture of Kubernetes (k8s) ● History and main features of k8s ● Small recap of containers ● Architecture of k8s ● Main k8s primitives + examples ● Other features ● Running Kubernetes ● Demo ● Bonus: Czech accent all along the way! :) (all of that in 30-35 minutes - managers would call this “ambitious plan”)
  • 4. Why Microservices? To tame the kludgy Monolith? (the whole story at: https://cloud.google.com/kubernetes-engine/kubernetes-comic/)
  • 5. Let’s go Microservices, but what about... ● Service Discovery ● Load Balancing ● Networking ● Storage ● Monitoring ● Clustering ● Logs ● Many other things...
  • 7. Is this like Serverless? ● Better term would be “Server-agnostic” ● K8s API tries to be as server-agnostic as possible ● K8s API is declarative ○ You defined the desired state rather than actions
  • 8. Kubernetes - few facts ● Open-source container orchestration platform ● Kubernetes == greek for “Helmsman” or “Pilot” ● Often abbreviated as k8s ● Based on Google’s internal system (Borg), which reflects their experience of running containers for more than 15 years ● First released in 2015 and later donated to the Cloud Native Computing Foundation ● Big and vibrant community ● Biggest contributors - Google and RedHat
  • 10. Containers recap ● Containers == lightweight “VMs” ● They are basically cleverly isolated processes running on the same OS/kernel (using cgroups/namespaces) ● You can adjust networking/volumes between host and containers ● Current container techs. - docker, rkt, lmctfy
  • 12. Kubernetes - Architecture ● Master - a node holding the configuration and managing the cluster ● Node - a worker machine (bare metal, virtual, cloud) hosting Pods ● Kubectl - console for the API, allows modifying/uploading configuration ● API - REST api to modify the configuration (which is stored in etcd) ● Scheduler - gathers info about Nodes (utilisation) and decides where to spawn new Pods ● Controller Manager - Checks and enforces the current config in the cluster (e.g. ReplicaSet) ● Kubelet - agent running on each Node, providing info to master, creating Pods ● Kube-proxy - serves for inter-Pod and inter-Node communication ● Pod - container(s) running the actual application
  • 13. Pod - contains the app ● Basic unit in k8s, can expose ports ● One or more containers sharing the same namespace, resources, volumes, network (localhost), ports, etc. ● Each container is defined by its image ● Limits for CPU / RAM ● Set of labels (we will learn more about them later) ● Can have health / readiness checks ● Containers in pod get automatically restarted in case they crash or fail the health check ● Pod might get rescheduled to other Node ● You can also mount Volumes to Pods or inject some configuration (via ConfigMaps and Secrets)
  • 14. ReplicaSet - scaling / self-healing ● A set of Pods based on a Number of Pods, Pod Template and a Selector ● Allows defining clusters of the same Pod (application) ● Number of Pods - the desired number of replicas to be running in cluster ● Pod Template - basically the same like Pod definition (image, labels, resources) ● Selector - a set of matchers to match the Pods in cluster by labels ○ E.g. “app: elastic AND version: 6.1.2 AND env: prod” ○ Usually matches the labels defined in the Pod Template ● Kubernetes makes sure there is the exact number of defined Pods in the cluster
  • 20. Service - service discover / load-balancing ● Addresses/ports of Pods are dynamically assigned every time a Pod is created ○ You cannot rely on them when trying to call an app running in other Pod ● Service solves the problem by providing a stable clusterIp/port for Pod(s) ● The Service is defined by a selector (the same as in ReplicaSet) and a port ● E.g. “app: elastic AND version: 6.1.2 AND env: prod” + port: 9200 ● 3 modes of operation to choose from: userspace, iptables (default) and ipvs ○ K8s will alter the iptables accordingly on all the Nodes ● The Service Discovery is implemented either by injecting variables or using DNS ○ E.g. ELASTIC_SERVICE_HOST / ELASTIC_SERVICE_PORT get injected into every Pod ○ Or there is ‘elastic’ DNS record, so all the other Pods can rely on that
  • 22. Volumes / Persistent Volumes - Storage ● Not exactly the same thing as Docker volumes ● Volume - tight to a Pod lifecycle (survives container restarts) ● Persistent Volumes - can be reused by another Pod (of the same type) ● Many adapters supported - local volumes, AWS EBS, GCEPersistentDisk, Ceph, Gluster, ScaleIO and many others ● Persistent Volume Claim - a way to decouple the definition of storage and apps claiming that storage (claim can be reused) ● Storage Class - a way to define properties of the storage (IOPS, zone, etc.) - the claim can be based on these (e.g. demanding a fast volume in us-east)
  • 23. Deployments ● Deployments provide a way to define a deployment strategy for a Pod ● Its definition is very similar to ReplicaSet, but it adds the strategy ● 2 strategies - Recreate and RollingUpdate ● RollingUpdate ○ maxUnavailable - max. number or percentage of Pods unavailable during update ○ maxSurge - max. number or percentage to create over the replica count ○ You can also define a time period for which the Pod must be healthy before moving to another
  • 27. Some of the other Primitives ● Network Policies - defining access in the cluster and to/from outside ● Ingress - inbound http rules, TLS termination, external loadbalancing, etc. ● Jobs - one-time jobs ● StatefulSet - solution to master/slave stores (e.g. MySQL, Redis, etc.) ● Namespaces - means to separate different “parts” of cluster (e.g. by environment)
  • 28. Deployment Options ● Local - minikube (used in the demo later) ● Hosted - Google (GKE), RedHat (OpenShift), Microsoft (Azure CS), AWS (EKS) and many others ● VMs - Vagrant, vSphere (Vmware), oVirt ● Bare Metal - CentOS, Fedora, Ubuntu, CoreOS
  • 29. Resources ● https://kubernetes.io/ ● https://cloud.google.com/kubernetes-engine/kubernetes-comic/ ● https://speakerdeck.com/luxas/intro-to-the-cloud-native-world-of-kubernetes-helsinki- october-meetup ● http://lmgtfy.com/?q=kubernetes ● http://shop.oreilly.com/product/0636920043874.do
  • 30. (well, in case we have the time...)
  • 31. Thanks! Any Questions? Head is going to explode? (Don’t worry, mine is too!) See you later! Later Gator!