SlideShare a Scribd company logo
© 2017 Cloud Technology Experts INC. All rights reserved.
KUBERNETES BASIC OBJECTS & DEMO
Damian Igbe
damianigbe@cloudtechnologyexperts.com
© 2017 Cloud Technology Experts INC. All rights reserved.
Cloud Technology Experts
Agenda
● Quick Kubernetes Concepts
● Kubernetes Architecture
● Kubernetes Fundamental Objects
● Demo
● Conclusion,Q&A & Meetup business
© 2017 Cloud Technology Experts INC. All rights reserved.
Scheduling: Decide where my containers should run
Lifecycle and health: Keep my containers running despite failures
Scaling: Make sets of containers bigger or smaller
Naming and discovery: Find where my containers are now
Load balancing: Distribute traffic across a set of containers
Storage volumes: Provide data to containers
Logging and monitoring: Track what’s happening with my containers
Debugging and introspection: Enter or attach to containers
Identity and authorization: Control who can do things to my containers
Container Orchestration
© 2017 Cloud Technology Experts INC. All rights reserved.
Want to automate orchestration for velocity & scale
Diverse workloads and use cases demand still more functionality
● Rolling updates and blue/green deployments
● Application secret and configuration distribution
● Continuous integration and deployment
● Batch processing
● Scheduled execution
...
A composable, extensible Platform is needed
© 2017 Cloud Technology Experts INC. All rights reserved.
Greek for “Helmsman”; also the root of the
words “governor” and “cybernetic”
• Infrastructure for containers
• Schedules, runs, and manages containers
on virtual and physical machines
• Platform for automating deployment,
scaling, and operations
Kubernetes
© 2017 Cloud Technology Experts INC. All rights reserved.
• Inspired and informed by Google’s
experiences and internal systems
• 100% Open source, written in Go
• One of the top 4 open source software
projects with highest velocity and
contribution
Kubernetes
© 2017 Cloud Technology Experts INC. All rights reserved.
Drive current state → desired state
Observed state is truth
Act independently
• choreography rather than
orchestration
Recurring pattern in the system
Kubernetes Control Loop
© 2017 Cloud Technology Experts INC. All rights reserved.
KUBERNETES ARCHITECTURE
© 2017 Cloud Technology Experts INC. All rights reserved.
Cluster Components
Master/Controller
● API Server (kube-apiserver)
● Scheduler (kube-scheduler)
● Controller manager (kube-controller-manager)
● etcd (stores cluster state)
Node
● Kubelet (“node agent”)
● Kube-proxy
● Container Runtime (Docker,rkt)
© 2017 Cloud Technology Experts INC. All rights reserved.
Kubernetes Architecture
© 2017 Cloud Technology Experts INC. All rights reserved.
Architecture: Master Node
Master Node (“Control Plane”)
kube-apiserver
- Point of interaction with the cluster
- Exposes http endpoint
kube-controller-manager
- Responsible for most of the important stuff
- Interacts with the api server to retrieve cluster state
- Responsible for configuring networking
- Allocates node CIDRs
- Ensures correct number of pods are running
- Reacts to Nodes being added / deleted
- Manages Service Accounts and security tokens
kube-scheduler
- Schedules newly created pods to a Node
© 2017 Cloud Technology Experts INC. All rights reserved.
Architecture: Master Node
Master Node (“Control Plane”)
Etcd
- Stores the state of the cluster
- Doesn’t necessarily have to be co-located with other components
- Must be backed up in a production scenario
© 2017 Cloud Technology Experts INC. All rights reserved.
Architecture: Worker Node
kubelet
● Agent for running Pods
● Mounts volumes for Pods where required
● Reports the status of Pods back to rest of system
kube-proxy
● Enforces network rules on each Node (uses iptables)
● Responsible for forwarding packets to correct destination
© 2017 Cloud Technology Experts INC. All rights reserved.
KUBERNETES FUNDAMENTAL OBJECTS
© 2017 Cloud Technology Experts INC. All rights reserved.
Kubernetes Fundamental Objects
● Pods
● Label/Selectors
● Replica Sets/Replication Controllers
● Deployments
● Services
● *ConfigMaps/Secrets*
© 2017 Cloud Technology Experts INC. All rights reserved.
Pod
● A pod is one or more containers
● Ensures co-location / shared fate
● Pods are scheduled, then do not move between nodes
● Containers share resources within the pod:
○ Volumes
○ Network / IP
○ Namespace
○ CPU / Memory allocations
© 2017 Cloud Technology Experts INC. All rights reserved.
A pod manifest file in Yaml
apiVersion: v1
kind: Pod
metadata:
name: redis-nginx
labels:
app: web
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
- name: nginx
image: nginx
ports:
- containerPort: 8080
© 2017 Cloud Technology Experts INC. All rights reserved.
Label/Selectors
● Labels are arbitrary metadata
● Attachable to nearly all API objects
e.g.: Pods, ReplicationControllers, Services...
● Simple key=value pairs
● Can be queried with selectors
● The only grouping mechanism
○ pods under a ReplicationController
○ pods in a Service
○ capabilities of a node (constraints
© 2017 Cloud Technology Experts INC. All rights reserved.
Example of Labels
● release=stable, release=beta, Release=alpha
● environment=dev, environment=qa,
environment=prod
● tier=frontend, tier=backend,
tier=middleware
● partition=customer1, partition=customer2
© 2017 Cloud Technology Experts INC. All rights reserved.
Pod manifest showing labels
apiVersion: v1
kind: Pod
metadata:
name: redis-nginx
labels:
app: web
env: test
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
- name: nginx
image: nginx
ports:
- containerPort: 8080
© 2017 Cloud Technology Experts INC. All rights reserved.
Labels are queryable metadata - selectors can do the queries:
● Equality based:
○ environment = production
○ tier != frontend
○ combinations: tier != frontend, version = 1.0.0
● Set based:
○ environment in (production, pre-production)
○ tier notin (frontend, backend)
○ partition or !partition
Label Selectors
© 2017 Cloud Technology Experts INC. All rights reserved.
● Define the number of replicas of a pod
● Will scheduled across all applicable nodes
● Can change replica value to scale up/down
● Which pods are scaled depends on RC selector
● Labels and selectors are used for grouping
● Can do quite complex things with RCs and labels
Replication Controllers
© 2017 Cloud Technology Experts INC. All rights reserved.
A RC manifest file in Yaml
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx
spec:
replicas: 3
selector:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
© 2017 Cloud Technology Experts INC. All rights reserved.
Replica Set is the next-generation Replication Controller. The only
difference between a Replica Set and a Replication Controller right
now is the selector support. Replica Set supports the new set-based
selector which allow filtering keys according to a set of values:
● In
● Notin
● exists (only the key identifier)
For example:
● environment in (production, qa)
● tier notin (frontend, backend)
● partition
● !partition
Replica Set
© 2017 Cloud Technology Experts INC. All rights reserved.
A RS manifest file in Yaml
apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
name: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
© 2017 Cloud Technology Experts INC. All rights reserved.
A Deployment is responsible for creating and updating instances of
your application
● Create a Deployment to bring up Pods and a
replica set. Deployment->ReplicatSet->Pods
● Check the status of a Deployment to see if it
succeeds or not.
● Later, update that Deployment to recreate the
Pods (for example, to use a new image).
● Rollback to an earlier Deployment revision if
the current Deployment isn’t stable.
Deployments
© 2017 Cloud Technology Experts INC. All rights reserved.
A Deployment manifest file in Yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: deploy1
spec:
selector:
matchLabels:
app: nginx
replicas: 4
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: containercm1
image: nginx
ports:
- containerPort: 80
env:
- name: weatherseasons
valueFrom:
configMapKeyRef:
name: weathervariable
key: weather
© 2017 Cloud Technology Experts INC. All rights reserved.
defines a logical set of Pods and a policy by which to access them
● As Pods are ephemeral, we can't depend on Pod IPs
● Services find pods that match certain selection criteria
● Services can load balance between multiple Pods
● Services can have a single IP that doesn’t change
● Services are used for service Discovery
Services
© 2017 Cloud Technology Experts INC. All rights reserved.
● A group of pods that act as one == Service
○ group == selector
● Defines access policy
○ ClusterIP, LoadBalanced, NodePort
● Gets a stable virtual IP and Port
○ Called the service portal
○ Also a DNS name
○ On prem additional loadbalancer is needed
● VIP is captured by kube-proxy
○ Watches the service consistency
○ Updates when backend changes
Services
© 2017 Cloud Technology Experts INC. All rights reserved.
apiVersion: v1
kind: Service
metadata:
name: railsapp
spec:
type: NodePort
selector:
app: nginx
ports:
- name: http
nodePort: 30002
port: 80
protocol: TCP
Services Manifest
© 2017 Cloud Technology Experts INC. All rights reserved.
DEPLOYMENTS AND SERVICES:
Demo with kubernetes Guestbook app
© 2017 Cloud Technology Experts INC. All rights reserved.
Q & A
© 2017 Cloud Technology Experts INC. All rights reserved.
Meetup Goals/Vision
● Focus of the meetup will be on CNCF Hosted Applications
(Kubernetes, Prometheus, Fluentd, gRPC,Linkerd, Opentracing,
rkt, containerd,CNI, CoreDNS)
● Also around Cloud Native Microservices apps, Devops, Docker
containers
● This is inline with CNCF goals of community education and
dissemination of information
● Hope to conduct Free Kubernetes Training but will discuss
with CNCF for sponsorship opportunities
● 2 speeches per meetup or 1 depending on the presentation?
● Online meetup streaming?
© 2017 Cloud Technology Experts INC. All rights reserved.
Announcements
● Kubecon and CloudNative Conference. December 6-8th.
https://www.cncf.io/event/cloudnativecon-north-america-2017/
● Ambassadors
https://www.cncf.io/people/ambassadors/
● Beta Certifications
https://www.cncf.io/blog/2017/06/15/sign-kubernetes-beta-certification-exam/
● Free Kubernetes Training
https://www.edx.org/course/introduction-kubernetes-linuxfoundationx-lfs158x
https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615
● Follow on twitter/linkedin
© 2017 Cloud Technology Experts INC. All rights reserved.
Damian Igbe, PhD
● PhD in Computer science
● Linux Systems Administration
● Technical Trainer by trade
● Kubernetes Certified Administrator
● Kubernetes Doc team contributor
● CTO of Cloud Technology Experts

More Related Content

What's hot (20)

PPTX
Kubernetes Basics
Rishabh Kumar
 
PPTX
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
PDF
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
PPTX
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Simplilearn
 
PDF
Kubernetes
Meng-Ze Lee
 
PDF
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
PDF
Kubernetes in Docker
Docker, Inc.
 
PPTX
Getting started with Docker
Ravindu Fernando
 
PDF
Kubernetes Deployment Strategies
Abdennour TM
 
PDF
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Edureka!
 
PDF
An Introduction to Kubernetes
Imesh Gunaratne
 
PDF
A Gentle Introduction To Docker And All Things Containers
Jérôme Petazzoni
 
PDF
Kubernetes Monitoring & Best Practices
Ajeet Singh Raina
 
PDF
Learning how AWS implement AWS VPC CNI
HungWei Chiu
 
PDF
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
Edureka!
 
PPTX
Cloud Native: what is it? Why?
Juan Pablo Genovese
 
PPTX
Introduction to helm
Jeeva Chelladhurai
 
PDF
Cloud Infrastructure with Crossplane
QAware GmbH
 
PDF
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Edureka!
 
PPTX
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
Kubernetes Basics
Rishabh Kumar
 
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Simplilearn
 
Kubernetes
Meng-Ze Lee
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
Kubernetes in Docker
Docker, Inc.
 
Getting started with Docker
Ravindu Fernando
 
Kubernetes Deployment Strategies
Abdennour TM
 
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Edureka!
 
An Introduction to Kubernetes
Imesh Gunaratne
 
A Gentle Introduction To Docker And All Things Containers
Jérôme Petazzoni
 
Kubernetes Monitoring & Best Practices
Ajeet Singh Raina
 
Learning how AWS implement AWS VPC CNI
HungWei Chiu
 
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
Edureka!
 
Cloud Native: what is it? Why?
Juan Pablo Genovese
 
Introduction to helm
Jeeva Chelladhurai
 
Cloud Infrastructure with Crossplane
QAware GmbH
 
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Edureka!
 
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 

Similar to Kubernetes basics and hands on exercise (20)

PDF
Introduction to Kubernetes Workshop
Bob Killen
 
PPTX
Introduction to kubernetes
Rishabh Indoria
 
PPTX
Kubernetes
Srinath Reddy
 
PDF
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
PPTX
Kubernetes
Lhouceine OUHAMZA
 
PPTX
Kubernetes-Presentation-Syed-Murtaza-Hassan
Syed Murtaza Hassan
 
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
PPTX
Introduction kubernetes 2017_12_24
Sam Zheng
 
PPTX
Introduction+to+Kubernetes-Details-D.pptx
SantoshPandey160
 
PDF
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
PDF
Intro to Kubernetes
Joonathan Mägi
 
PPTX
08 - kubernetes.pptx
RanjithM61
 
PDF
Kubernetes From Scratch .pdf
ssuser9b44c7
 
PDF
Introduction to kubernetes
Gabriel Carro
 
PDF
Kubernetes - how to orchestrate containers
inovex GmbH
 
PDF
Kubernetes a comprehensive overview
Gabriel Carro
 
PDF
Kubernetes - A Comprehensive Overview
Bob Killen
 
PDF
Kubernetes acomprehensiveoverview
Ankit Shukla
 
PPTX
Introduction to Kubernetes
Vishal Biyani
 
PDF
Scaling Microservices with Kubernetes
Deivid Hahn Fração
 
Introduction to Kubernetes Workshop
Bob Killen
 
Introduction to kubernetes
Rishabh Indoria
 
Kubernetes
Srinath Reddy
 
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
Kubernetes
Lhouceine OUHAMZA
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Syed Murtaza Hassan
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
Introduction kubernetes 2017_12_24
Sam Zheng
 
Introduction+to+Kubernetes-Details-D.pptx
SantoshPandey160
 
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
Intro to Kubernetes
Joonathan Mägi
 
08 - kubernetes.pptx
RanjithM61
 
Kubernetes From Scratch .pdf
ssuser9b44c7
 
Introduction to kubernetes
Gabriel Carro
 
Kubernetes - how to orchestrate containers
inovex GmbH
 
Kubernetes a comprehensive overview
Gabriel Carro
 
Kubernetes - A Comprehensive Overview
Bob Killen
 
Kubernetes acomprehensiveoverview
Ankit Shukla
 
Introduction to Kubernetes
Vishal Biyani
 
Scaling Microservices with Kubernetes
Deivid Hahn Fração
 
Ad

More from Cloud Technology Experts (6)

PDF
Managing kubernetes deployment with operators
Cloud Technology Experts
 
PDF
The rise of microservices
Cloud Technology Experts
 
PDF
Deploy prometheus on kubernetes
Cloud Technology Experts
 
PDF
Kubernetes on DC/OS
Cloud Technology Experts
 
PDF
Kubernetes scheduling and QoS
Cloud Technology Experts
 
PDF
Kubecon and cloudnative summit aAustin recap
Cloud Technology Experts
 
Managing kubernetes deployment with operators
Cloud Technology Experts
 
The rise of microservices
Cloud Technology Experts
 
Deploy prometheus on kubernetes
Cloud Technology Experts
 
Kubernetes on DC/OS
Cloud Technology Experts
 
Kubernetes scheduling and QoS
Cloud Technology Experts
 
Kubecon and cloudnative summit aAustin recap
Cloud Technology Experts
 
Ad

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 

Kubernetes basics and hands on exercise

  • 1. © 2017 Cloud Technology Experts INC. All rights reserved. KUBERNETES BASIC OBJECTS & DEMO Damian Igbe [email protected]
  • 2. © 2017 Cloud Technology Experts INC. All rights reserved. Cloud Technology Experts Agenda ● Quick Kubernetes Concepts ● Kubernetes Architecture ● Kubernetes Fundamental Objects ● Demo ● Conclusion,Q&A & Meetup business
  • 3. © 2017 Cloud Technology Experts INC. All rights reserved. Scheduling: Decide where my containers should run Lifecycle and health: Keep my containers running despite failures Scaling: Make sets of containers bigger or smaller Naming and discovery: Find where my containers are now Load balancing: Distribute traffic across a set of containers Storage volumes: Provide data to containers Logging and monitoring: Track what’s happening with my containers Debugging and introspection: Enter or attach to containers Identity and authorization: Control who can do things to my containers Container Orchestration
  • 4. © 2017 Cloud Technology Experts INC. All rights reserved. Want to automate orchestration for velocity & scale Diverse workloads and use cases demand still more functionality ● Rolling updates and blue/green deployments ● Application secret and configuration distribution ● Continuous integration and deployment ● Batch processing ● Scheduled execution ... A composable, extensible Platform is needed
  • 5. © 2017 Cloud Technology Experts INC. All rights reserved. Greek for “Helmsman”; also the root of the words “governor” and “cybernetic” • Infrastructure for containers • Schedules, runs, and manages containers on virtual and physical machines • Platform for automating deployment, scaling, and operations Kubernetes
  • 6. © 2017 Cloud Technology Experts INC. All rights reserved. • Inspired and informed by Google’s experiences and internal systems • 100% Open source, written in Go • One of the top 4 open source software projects with highest velocity and contribution Kubernetes
  • 7. © 2017 Cloud Technology Experts INC. All rights reserved. Drive current state → desired state Observed state is truth Act independently • choreography rather than orchestration Recurring pattern in the system Kubernetes Control Loop
  • 8. © 2017 Cloud Technology Experts INC. All rights reserved. KUBERNETES ARCHITECTURE
  • 9. © 2017 Cloud Technology Experts INC. All rights reserved. Cluster Components Master/Controller ● API Server (kube-apiserver) ● Scheduler (kube-scheduler) ● Controller manager (kube-controller-manager) ● etcd (stores cluster state) Node ● Kubelet (“node agent”) ● Kube-proxy ● Container Runtime (Docker,rkt)
  • 10. © 2017 Cloud Technology Experts INC. All rights reserved. Kubernetes Architecture
  • 11. © 2017 Cloud Technology Experts INC. All rights reserved. Architecture: Master Node Master Node (“Control Plane”) kube-apiserver - Point of interaction with the cluster - Exposes http endpoint kube-controller-manager - Responsible for most of the important stuff - Interacts with the api server to retrieve cluster state - Responsible for configuring networking - Allocates node CIDRs - Ensures correct number of pods are running - Reacts to Nodes being added / deleted - Manages Service Accounts and security tokens kube-scheduler - Schedules newly created pods to a Node
  • 12. © 2017 Cloud Technology Experts INC. All rights reserved. Architecture: Master Node Master Node (“Control Plane”) Etcd - Stores the state of the cluster - Doesn’t necessarily have to be co-located with other components - Must be backed up in a production scenario
  • 13. © 2017 Cloud Technology Experts INC. All rights reserved. Architecture: Worker Node kubelet ● Agent for running Pods ● Mounts volumes for Pods where required ● Reports the status of Pods back to rest of system kube-proxy ● Enforces network rules on each Node (uses iptables) ● Responsible for forwarding packets to correct destination
  • 14. © 2017 Cloud Technology Experts INC. All rights reserved. KUBERNETES FUNDAMENTAL OBJECTS
  • 15. © 2017 Cloud Technology Experts INC. All rights reserved. Kubernetes Fundamental Objects ● Pods ● Label/Selectors ● Replica Sets/Replication Controllers ● Deployments ● Services ● *ConfigMaps/Secrets*
  • 16. © 2017 Cloud Technology Experts INC. All rights reserved. Pod ● A pod is one or more containers ● Ensures co-location / shared fate ● Pods are scheduled, then do not move between nodes ● Containers share resources within the pod: ○ Volumes ○ Network / IP ○ Namespace ○ CPU / Memory allocations
  • 17. © 2017 Cloud Technology Experts INC. All rights reserved. A pod manifest file in Yaml apiVersion: v1 kind: Pod metadata: name: redis-nginx labels: app: web spec: containers: - name: redis image: redis ports: - containerPort: 6379 - name: nginx image: nginx ports: - containerPort: 8080
  • 18. © 2017 Cloud Technology Experts INC. All rights reserved. Label/Selectors ● Labels are arbitrary metadata ● Attachable to nearly all API objects e.g.: Pods, ReplicationControllers, Services... ● Simple key=value pairs ● Can be queried with selectors ● The only grouping mechanism ○ pods under a ReplicationController ○ pods in a Service ○ capabilities of a node (constraints
  • 19. © 2017 Cloud Technology Experts INC. All rights reserved. Example of Labels ● release=stable, release=beta, Release=alpha ● environment=dev, environment=qa, environment=prod ● tier=frontend, tier=backend, tier=middleware ● partition=customer1, partition=customer2
  • 20. © 2017 Cloud Technology Experts INC. All rights reserved. Pod manifest showing labels apiVersion: v1 kind: Pod metadata: name: redis-nginx labels: app: web env: test spec: containers: - name: redis image: redis ports: - containerPort: 6379 - name: nginx image: nginx ports: - containerPort: 8080
  • 21. © 2017 Cloud Technology Experts INC. All rights reserved. Labels are queryable metadata - selectors can do the queries: ● Equality based: ○ environment = production ○ tier != frontend ○ combinations: tier != frontend, version = 1.0.0 ● Set based: ○ environment in (production, pre-production) ○ tier notin (frontend, backend) ○ partition or !partition Label Selectors
  • 22. © 2017 Cloud Technology Experts INC. All rights reserved. ● Define the number of replicas of a pod ● Will scheduled across all applicable nodes ● Can change replica value to scale up/down ● Which pods are scaled depends on RC selector ● Labels and selectors are used for grouping ● Can do quite complex things with RCs and labels Replication Controllers
  • 23. © 2017 Cloud Technology Experts INC. All rights reserved. A RC manifest file in Yaml apiVersion: v1 kind: ReplicationController metadata: name: nginx spec: replicas: 3 selector: app: nginx template: metadata: name: nginx labels: app: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80
  • 24. © 2017 Cloud Technology Experts INC. All rights reserved. Replica Set is the next-generation Replication Controller. The only difference between a Replica Set and a Replication Controller right now is the selector support. Replica Set supports the new set-based selector which allow filtering keys according to a set of values: ● In ● Notin ● exists (only the key identifier) For example: ● environment in (production, qa) ● tier notin (frontend, backend) ● partition ● !partition Replica Set
  • 25. © 2017 Cloud Technology Experts INC. All rights reserved. A RS manifest file in Yaml apiVersion: extensions/v1beta1 kind: ReplicaSet metadata: name: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: name: nginx labels: app: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80
  • 26. © 2017 Cloud Technology Experts INC. All rights reserved. A Deployment is responsible for creating and updating instances of your application ● Create a Deployment to bring up Pods and a replica set. Deployment->ReplicatSet->Pods ● Check the status of a Deployment to see if it succeeds or not. ● Later, update that Deployment to recreate the Pods (for example, to use a new image). ● Rollback to an earlier Deployment revision if the current Deployment isn’t stable. Deployments
  • 27. © 2017 Cloud Technology Experts INC. All rights reserved. A Deployment manifest file in Yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: name: deploy1 spec: selector: matchLabels: app: nginx replicas: 4 template: metadata: labels: app: nginx spec: containers: - name: containercm1 image: nginx ports: - containerPort: 80 env: - name: weatherseasons valueFrom: configMapKeyRef: name: weathervariable key: weather
  • 28. © 2017 Cloud Technology Experts INC. All rights reserved. defines a logical set of Pods and a policy by which to access them ● As Pods are ephemeral, we can't depend on Pod IPs ● Services find pods that match certain selection criteria ● Services can load balance between multiple Pods ● Services can have a single IP that doesn’t change ● Services are used for service Discovery Services
  • 29. © 2017 Cloud Technology Experts INC. All rights reserved. ● A group of pods that act as one == Service ○ group == selector ● Defines access policy ○ ClusterIP, LoadBalanced, NodePort ● Gets a stable virtual IP and Port ○ Called the service portal ○ Also a DNS name ○ On prem additional loadbalancer is needed ● VIP is captured by kube-proxy ○ Watches the service consistency ○ Updates when backend changes Services
  • 30. © 2017 Cloud Technology Experts INC. All rights reserved. apiVersion: v1 kind: Service metadata: name: railsapp spec: type: NodePort selector: app: nginx ports: - name: http nodePort: 30002 port: 80 protocol: TCP Services Manifest
  • 31. © 2017 Cloud Technology Experts INC. All rights reserved. DEPLOYMENTS AND SERVICES: Demo with kubernetes Guestbook app
  • 32. © 2017 Cloud Technology Experts INC. All rights reserved. Q & A
  • 33. © 2017 Cloud Technology Experts INC. All rights reserved. Meetup Goals/Vision ● Focus of the meetup will be on CNCF Hosted Applications (Kubernetes, Prometheus, Fluentd, gRPC,Linkerd, Opentracing, rkt, containerd,CNI, CoreDNS) ● Also around Cloud Native Microservices apps, Devops, Docker containers ● This is inline with CNCF goals of community education and dissemination of information ● Hope to conduct Free Kubernetes Training but will discuss with CNCF for sponsorship opportunities ● 2 speeches per meetup or 1 depending on the presentation? ● Online meetup streaming?
  • 34. © 2017 Cloud Technology Experts INC. All rights reserved. Announcements ● Kubecon and CloudNative Conference. December 6-8th. https://www.cncf.io/event/cloudnativecon-north-america-2017/ ● Ambassadors https://www.cncf.io/people/ambassadors/ ● Beta Certifications https://www.cncf.io/blog/2017/06/15/sign-kubernetes-beta-certification-exam/ ● Free Kubernetes Training https://www.edx.org/course/introduction-kubernetes-linuxfoundationx-lfs158x https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615 ● Follow on twitter/linkedin
  • 35. © 2017 Cloud Technology Experts INC. All rights reserved. Damian Igbe, PhD ● PhD in Computer science ● Linux Systems Administration ● Technical Trainer by trade ● Kubernetes Certified Administrator ● Kubernetes Doc team contributor ● CTO of Cloud Technology Experts