SlideShare a Scribd company logo
Containers and Kubernetes
Leo’s Notes
Leopold Gault
Program Agenda
1. Containers:
1. The need for containers
2. Technical overview of containers
2. Kubernetes:
1. The need for Kubernetes
2. Technical overview of Kubernetes
Program Agenda
1. Containers:
1. The need for containers
2. Technical overview of containers
2. Kubernetes:
1. The need for Kubernetes
2. Technical overview of Kubernetes
The need for containers
1. The need for micro-services
2. The need for infrastructure as code
Monolithic vs SOA vs Microservice
Monolithic applications VS Microservices
Monolithic application Microservices (APIs)
Monolithic applications VS Microservices
Monolithic cake
Microservices cake
The need for containers
1. The need for micro-services
2. The need for infrastructure as code
Subject covered orally
Program Agenda
1. Containers:
1. The need for containers
2. Technical overview of containers
2. Kubernetes:
1. The need for Kubernetes
2. Technical overview of Kubernetes
Containers: what they are
A container is an image of a set of applications and configuration-
data.
Such image is:
• Immutable
• Portable
• Can be saved in a “photo album”: an images-repository.
Virtual Machines vs. Containers
Virtual Machines
● Each virtual machine (VM) includes the
app, the necessary binaries and libraries
and an entire guest operating system
Containers
● Containers include the app & all of its dependencies, but
share the OS kernel with other containers.
● Run as an isolated process in the userspace of the host OS
VMs
Containers
Let’s have a look at Wikipedia’s listing
Different levels of virtualization
source
Version of 14th Sept 2017
Different types of containers
• Linux Containers (LXC)
• OpenVZ
• Warden Containers (used by Pivotal CloudFoundry)
• RKT (developed by CoreOS)
• Docker
• Implementations of the Open Containers Initiative (OCI)
• …
OS-level virtualization solutions
Dockerfile
Container image
docker build
Repo
Docker registry docker run
Container runtime:
Linux kernel + Docker engine
Highlight about Docker
Building container images
My mongoDB :
FROM ubuntu_base_image
RUN apt-get update
RUN apt-get install
mongoDB
EXPOSE 8080
ENTRY POINT
/uns/binn/mongoDb
DockerFile
Ubuntu_base_image
(from private or
public registry)
Docker deamon
> docker build
Container image
Repo
My Docker
registry
Leo’s container
image
Container image
Repo
Docker registry
docker run -p 4000 :8080 friendlyhello
Container runtime:
Linux kernel + Docker engine
:8080
:4000
About building images on top of other images
Files that are removed by subsequent layers in the system are
actually still present in the images; they’re just inaccessible.
E.g.
In terms of building images, this also means that if
server.js is changed, layer B and layer C will have to
be rebuilt (so you have to order your layers from
the least likely to change to most likely)
Image
Image
Image
Although “BigFile” is no longer accessible in the image
‘Layer C’, it is still present in Layer A, which Layer C is
built on.
With the right tools, BigFile can still be accessed by
anyone having access to the image Layer C.
In terms of network traffic, this also means that
whenever you push or pull Layer C, BigFile is still
transmitted through the network.
Program Agenda
1. Containers:
1. The need for containers
2. Technical overview of containers
2. Kubernetes:
1. The need for Kubernetes
2. Technical overview of Kubernetes
The need for Kubernetes
1. The need for declarative infrastructure as code
2. The need for cluster management of container-engines
Subject covered orally
The need for Kubernetes
1. The need for declarative infrastructure as code
2. The need for cluster management of container-engines
Containers management platforms
Manage distributed containers, and their lifecycle
Containers
Management
Platform
Containers management platforms
Manage distributed containers, and their lifecycle
Docker Swarm
Program Agenda
1. Containers:
1. The need for containers
2. Technical overview of containers
2. Kubernetes:
1. The need for Kubernetes
2. Technical overview of Kubernetes
Components of a K8s cluster
Components of a cluster
kube-apiserver
etcd
kube-scheduler
kube-controller-manager
Kubelet
connected to
Master node
Worker node
cloud-controller-manager
It is the front-end for the Kubernetes
control plane
controls
kube-proxy
Container runtime
(Docker, rkt, runc, etc.)
Components of a cluster
kube-apiserver
etcd
kube-scheduler
kube-controller-manager
Kubelet
connected to
Master node
Worker node
cloud-controller-manager
Distributed key-value store.
Provides a dynamic configuration
registry.
controls
kube-proxy
Container runtime
(Docker, rkt, runc, etc.)
Components of a cluster
kube-apiserver
etcd
kube-scheduler
kube-controller-manager
Kubelet
connected to
Master node
Worker node
cloud-controller-manager
Watches newly created pods that
have no node assigned yet, and
selects a node for them to run on.
controls
kube-proxy
Container runtime
(Docker, rkt, runc, etc.)
Components of a cluster
kube-apiserver
etcd
kube-scheduler
kube-controller-manager
Kubelet
connected to
Master node
Worker node
cloud-controller-manager
controls
kube-proxy
Container runtime
(Docker, rkt, runc, etc.)
Component on the master that runs controllers.
These controllers include:
• Node Controller: detects when nodes go down, and responds.
• Replication Controller: maintains the correct number of pods for every replication
controller object (replicaset?) in the system.
• Endpoints Controller: deploys the “Endpoints object” (i.e. services and pods) into the
cluster.
• Service Account & Token Controllers: Creates default accounts and API access tokens for
new namespaces.
Components of a cluster
kube-apiserver
etcd
kube-scheduler
kube-controller-manager
Kubelet
connected to
Master node
Worker node
cloud-controller-manager
controls
kube-proxy
Container runtime
(Docker, rkt, runc, etc.)
Runs controllers that interact with the underlying cloud providers.
Those controllers are specific to the cloud-provider. Those controllers are:
• Node Controller: when a node stops responding, it checks with the cloud
provider to determine if this node has been deleted
• Route Controller: sets up routes in the underlying cloud infrastructure
• Service Controller: creates, updates and deletes cloud provider load balancers
• Volume Controller: creates, attaches, and mounts volumes, and interacts with
the cloud provider to orchestrate volumes
Components of a cluster
kube-apiserver
etcd
kube-scheduler
kube-controller-manager
Kubelet
connected to
controls
Master node
Worker node
cloud-controller-manager
Makes sure that containers are running in a pod.
The kubelet takes a set of PodSpecs that are provided through various
mechanisms and ensures that the containers described in those PodSpecs
are running and healthy.
kube-proxy
Container runtime
(Docker, rkt, runc, etc.)
Components of a cluster
kube-apiserver
etcd
kube-scheduler
kube-controller-manager
Kubelet
connected to
controls
Master node
Worker node
cloud-controller-manager
kube-proxy
Enables the Kubernetes service abstraction by
maintaining network rules on the host and performing
connection forwarding.
Container runtime
(Docker, rkt, runc, etc.)
Pods, services, deployments
Pods
IP2
Shared storage
Node 1
IP1
Shared storage
(volume)
Leo:
You normally put in a pod just one container, or a
handful of containers that are tightly coupled (e.g. a
Tomcat container + a Git syncrhonizer; with both apps
interacting thru a local filesystem).
You achieve horizontal scaling by replicating pods; not
by replicating containers within a pod.
Created from an image
Example of anti-pattern Pod
Node 1
IP1
Pod spec
Example of pod spec
Communication between containers within a same
pod
Node 1
IP1
Shared storage
(volume)
From: localhost:8080
To: localhost:3306
Kubernetes has an “IP-per-pod model”: containers within a
same pod share the same IP address, and communicate with
each other using distinct ports, on localhost.
I know this is anti-pattern. It
is just an example.
Pods and network
Private overlay network within the Kubernetes cluster
Node 1
Node 2
Real network
IP3IP1
IP2
The need for services
Private overlay network within the Kubernetes cluster
Node 1
Node 2
Real network
IP3IP1
IP2
Weblogic cluster
Managed server1
Managed server2
App which is a client of the
Weblogic cluster
Services and network
Private overlay network within the Kubernetes cluster
Node 1
Node 2
Real network
IP3
ServiceA
IP4
IP1
IP2
Acts like a LB
between Pods
Service
A level of abstraction providing an external and durable access to a set of pods.
A service :
• encompasses serval Pods,
• has its own (private) IP (thus allowing consuming services to use the Service’s IP,
instead of the Pod’s, which may change frequently),
• load balances the IP packets it receives to its Pods.
Services and network
Private overlay network within the Kubernetes cluster
Node 1
Node 2
Real network
IP3
ServiceA
IP4
IP1
IP2
Can optionally be made
reachable from the real
network
Acts like a LB
between Pods
Services and network
Private overlay network within the Kubernetes cluster
Real network
IP3
ServiceA
IP4
IP1
IP2
Can optionally be made
reachable from the real
network
Port of your choosing
E.g. with the service-type “NodePort”:
each hosting node will act as a NAT
server specifically for this IP; i.e. it will
associate one of its port to the IP4
Acts like a LB
between Pods
Port of your choosing
Service
A level of abstraction providing an external and durable access to a set of pods.
A service :
• encompasses serval Pods,
• has its own (private) IP (thus allowing consuming services to use the Service’s IP,
instead of the Pod’s, which may change frequently),
• load balances the IP packets it receives to its Pods.
• Provides 3 types of access:
• ClusterIP: the service is only visible from inside the cluster
Services and network
Private overlay network within the Kubernetes cluster
Node 1
Node 2
Real network
IP3
ServiceA
IP4
IP1
IP2
Acts like a LB
between Pods
Service
A level of abstraction providing an external and durable access to a set of pods.
A service :
• encompasses serval Pods,
• has its own (private) IP (thus allowing consuming services to use the Service’s IP,
instead of the Pod’s, which may change frequently),
• load balances the IP packets it receives to its Pods.
• Provides 3 types of access:
• ClusterIP: the service is only visible from inside the cluster
• NodePort: each node in the cluster maps an external port to the service’s private IP
Services and network
Private overlay network within the Kubernetes cluster
Real network
IP3
ServiceA
IP4
IP1
IP2
Can optionally be made
reachable from the real
network
Port of your choosing
E.g. with the service-type “NodePort”:
each hosting node will act as a NAT
server specifically for this IP; i.e. it will
associate one of its port to the IP4
Acts like a LB
between Pods
Port of your choosing
Service
A level of abstraction providing an external and durable access to a set of pods.
A service :
• encompasses serval Pods,
• has its own (private) IP (thus allowing consuming services to use the Service’s IP,
instead of the Pod’s, which may change frequently),
• load balances the IP packets it receives to its Pods.
• Provides 3 types of access:
• ClusterIP: the service is only visible from inside the cluster
• NodePort: each node in the cluster maps an external port to the service’s private IP
• LoadBalancer: a LB from the cloud provider will forward the traffic from the service the
nodes within it. (like NodePort, but on top of this, an external LB is configured to balance the
traffic between the nodes:servicePort?)
Services and network
Private overlay network within the Kubernetes cluster
Real (private) network
IP3
ServiceA
IP4
IP1
IP2
Port of your choosing
Acts like a LB
between Pods
Port of your choosing
load balancer
(cloud service)
Services identify their pods (and deployments) thanks to labels
Deployment features
Additional: enforce replicasets, by
• deploying the pods,
• monitoring them,
• Stop/restart them,
• redeploying them on another node if
needed.
• Perform rolling updates
• Undo an update if requested
Deployments
Deployments are a declarative way to ensure that the number of Pods running is equal to what the user declared to want.
Deployments keep our Pods up and running, even when the nodes they run on fail.
If Pods are declaratively updated (e.g. container image changed) or scaled, the Deployment will handle that.
Deployment spec vs Pod spec
Example of deployment Example of pod
The same as a pod spec
Specific to deployment spec
Deployment spec vs Pod spec
Example of deployment Example of pod
The same as a pod spec
Specific to deployment spec
Deployment spec vs Pod spec
Example of deployment Example of pod
The same as a pod spec
Specific to deployment spec
Services identify their pods,
and thus their deployments,
thanks to labels
Deployments
Pod
deployment1 (replicas==1)
Pod(s) host
E.g. of deployment spec
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template: # create pods using pod definition in this template
metadata:
# unlike pod-nginx.yaml, the name is not included in the meta data as a unique name is
# generated from the deployment name
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
deployment.yaml

More Related Content

What's hot

Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes
Joonathan Mägi
 
Kubernetes
KubernetesKubernetes
Kubernetes
erialc_w
 
Continuous Delivery the hard way with Kubernetes
Continuous Delivery the hard way with KubernetesContinuous Delivery the hard way with Kubernetes
Continuous Delivery the hard way with Kubernetes
Luke Marsden
 
Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6
Opcito Technologies
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Rishabh Indoria
 
Kubernetes presentation
Kubernetes presentationKubernetes presentation
Kubernetes presentation
GauranG Bajpai
 
Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Docker
docker-athens
 
Kubernetes Node Deep Dive
Kubernetes Node Deep DiveKubernetes Node Deep Dive
Kubernetes Node Deep Dive
Lei (Harry) Zhang
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
Rishabh Kumar
 
Kubernetes Hands-On Guide
Kubernetes Hands-On GuideKubernetes Hands-On Guide
Kubernetes Hands-On Guide
Stratoscale
 
Kubernetes Immersion
Kubernetes ImmersionKubernetes Immersion
Kubernetes Immersion
Juan Larriba
 
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App FactoryRevolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Imesh Gunaratne
 
kubernetes 101
kubernetes 101kubernetes 101
kubernetes 101
SeungWoo Lee
 
Quick introduction to Kubernetes
Quick introduction to KubernetesQuick introduction to Kubernetes
Quick introduction to Kubernetes
Eduardo Garcia Moyano
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
Araf Karsh Hamid
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Eric Gustafson
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Raffaele Di Fazio
 
What is Kubernets
What is  KubernetsWhat is  Kubernets
What is Kubernets
Echelon Edge Pvt Ltd
 
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
Kubernetes: An Introduction to the Open Source Container Orchestration PlatformKubernetes: An Introduction to the Open Source Container Orchestration Platform
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
Michael O'Sullivan
 
Continuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approachContinuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approach
Juan Larriba
 

What's hot (20)

Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Continuous Delivery the hard way with Kubernetes
Continuous Delivery the hard way with KubernetesContinuous Delivery the hard way with Kubernetes
Continuous Delivery the hard way with Kubernetes
 
Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Kubernetes presentation
Kubernetes presentationKubernetes presentation
Kubernetes presentation
 
Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Docker
 
Kubernetes Node Deep Dive
Kubernetes Node Deep DiveKubernetes Node Deep Dive
Kubernetes Node Deep Dive
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes Hands-On Guide
Kubernetes Hands-On GuideKubernetes Hands-On Guide
Kubernetes Hands-On Guide
 
Kubernetes Immersion
Kubernetes ImmersionKubernetes Immersion
Kubernetes Immersion
 
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App FactoryRevolutionizing WSO2 PaaS with Kubernetes & App Factory
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
 
kubernetes 101
kubernetes 101kubernetes 101
kubernetes 101
 
Quick introduction to Kubernetes
Quick introduction to KubernetesQuick introduction to Kubernetes
Quick introduction to Kubernetes
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
What is Kubernets
What is  KubernetsWhat is  Kubernets
What is Kubernets
 
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
Kubernetes: An Introduction to the Open Source Container Orchestration PlatformKubernetes: An Introduction to the Open Source Container Orchestration Platform
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
 
Continuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approachContinuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approach
 

Similar to Containers and Kubernetes -Notes Leo

Container Orchestration using kubernetes
Container Orchestration using kubernetesContainer Orchestration using kubernetes
Container Orchestration using kubernetes
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
DevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to KubernetesDevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
Meiyappan Kannappa
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
Eueung Mulyana
 
Kubernetes for Java developers
Kubernetes for Java developersKubernetes for Java developers
Kubernetes for Java developers
Robert Barr
 
Introducing Kubernetes
Introducing Kubernetes Introducing Kubernetes
Introducing Kubernetes
VikRam S
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
Getting started with google kubernetes engine
Getting started with google kubernetes engineGetting started with google kubernetes engine
Getting started with google kubernetes engine
Shreya Pohekar
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
Gayan Gunarathne
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
Gayan Gunarathne
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
csegayan
 
Kubernetes-Meetup
Kubernetes-MeetupKubernetes-Meetup
Kubernetes-Meetup
Vaibhav Kohli
 
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Patrick Chanezon
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
Terry Cho
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
Henryk Konsek
 
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Develop and deploy Kubernetes  applications with Docker - IBM Index 2018Develop and deploy Kubernetes  applications with Docker - IBM Index 2018
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Patrick Chanezon
 
Introduction to Containers & Diving a little deeper into the benefits of Con...
 Introduction to Containers & Diving a little deeper into the benefits of Con... Introduction to Containers & Diving a little deeper into the benefits of Con...
Introduction to Containers & Diving a little deeper into the benefits of Con...
Synergetics Learning and Cloud Consulting
 
Introduction to Virtual Kubelet
Introduction to Virtual KubeletIntroduction to Virtual Kubelet
Introduction to Virtual Kubelet
Mitchell Pronschinske
 
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
 

Similar to Containers and Kubernetes -Notes Leo (20)

Container Orchestration using kubernetes
Container Orchestration using kubernetesContainer Orchestration using kubernetes
Container Orchestration using kubernetes
 
DevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to KubernetesDevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to Kubernetes
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes for Java developers
Kubernetes for Java developersKubernetes for Java developers
Kubernetes for Java developers
 
Introducing Kubernetes
Introducing Kubernetes Introducing Kubernetes
Introducing Kubernetes
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
Getting started with google kubernetes engine
Getting started with google kubernetes engineGetting started with google kubernetes engine
Getting started with google kubernetes engine
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
 
Kubernetes-Meetup
Kubernetes-MeetupKubernetes-Meetup
Kubernetes-Meetup
 
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
 
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Develop and deploy Kubernetes  applications with Docker - IBM Index 2018Develop and deploy Kubernetes  applications with Docker - IBM Index 2018
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
 
Introduction to Containers & Diving a little deeper into the benefits of Con...
 Introduction to Containers & Diving a little deeper into the benefits of Con... Introduction to Containers & Diving a little deeper into the benefits of Con...
Introduction to Containers & Diving a little deeper into the benefits of Con...
 
Introduction to Virtual Kubelet
Introduction to Virtual KubeletIntroduction to Virtual Kubelet
Introduction to Virtual Kubelet
 
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
 

More from Léopold Gault

OAuth OpenID Connect
OAuth OpenID ConnectOAuth OpenID Connect
OAuth OpenID Connect
Léopold Gault
 
SAML
SAMLSAML
Notes leo kafka
Notes leo kafkaNotes leo kafka
Notes leo kafka
Léopold Gault
 
NoSQL - Leo's notes
NoSQL - Leo's notesNoSQL - Leo's notes
NoSQL - Leo's notes
Léopold Gault
 
Leo's Notes about Apache Kafka
Leo's Notes about Apache KafkaLeo's Notes about Apache Kafka
Leo's Notes about Apache Kafka
Léopold Gault
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 Days
Léopold Gault
 
Application Continuity with Oracle DB 12c
Application Continuity with Oracle DB 12c Application Continuity with Oracle DB 12c
Application Continuity with Oracle DB 12c
Léopold Gault
 

More from Léopold Gault (7)

OAuth OpenID Connect
OAuth OpenID ConnectOAuth OpenID Connect
OAuth OpenID Connect
 
SAML
SAMLSAML
SAML
 
Notes leo kafka
Notes leo kafkaNotes leo kafka
Notes leo kafka
 
NoSQL - Leo's notes
NoSQL - Leo's notesNoSQL - Leo's notes
NoSQL - Leo's notes
 
Leo's Notes about Apache Kafka
Leo's Notes about Apache KafkaLeo's Notes about Apache Kafka
Leo's Notes about Apache Kafka
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 Days
 
Application Continuity with Oracle DB 12c
Application Continuity with Oracle DB 12c Application Continuity with Oracle DB 12c
Application Continuity with Oracle DB 12c
 

Recently uploaded

GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 

Recently uploaded (20)

GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 

Containers and Kubernetes -Notes Leo

  • 1. Containers and Kubernetes Leo’s Notes Leopold Gault
  • 2.
  • 3. Program Agenda 1. Containers: 1. The need for containers 2. Technical overview of containers 2. Kubernetes: 1. The need for Kubernetes 2. Technical overview of Kubernetes
  • 4. Program Agenda 1. Containers: 1. The need for containers 2. Technical overview of containers 2. Kubernetes: 1. The need for Kubernetes 2. Technical overview of Kubernetes
  • 5. The need for containers 1. The need for micro-services 2. The need for infrastructure as code
  • 6. Monolithic vs SOA vs Microservice
  • 7. Monolithic applications VS Microservices Monolithic application Microservices (APIs)
  • 8. Monolithic applications VS Microservices Monolithic cake Microservices cake
  • 9. The need for containers 1. The need for micro-services 2. The need for infrastructure as code Subject covered orally
  • 10. Program Agenda 1. Containers: 1. The need for containers 2. Technical overview of containers 2. Kubernetes: 1. The need for Kubernetes 2. Technical overview of Kubernetes
  • 11. Containers: what they are A container is an image of a set of applications and configuration- data. Such image is: • Immutable • Portable • Can be saved in a “photo album”: an images-repository.
  • 12. Virtual Machines vs. Containers Virtual Machines ● Each virtual machine (VM) includes the app, the necessary binaries and libraries and an entire guest operating system Containers ● Containers include the app & all of its dependencies, but share the OS kernel with other containers. ● Run as an isolated process in the userspace of the host OS VMs Containers
  • 13. Let’s have a look at Wikipedia’s listing Different levels of virtualization source Version of 14th Sept 2017
  • 14. Different types of containers • Linux Containers (LXC) • OpenVZ • Warden Containers (used by Pivotal CloudFoundry) • RKT (developed by CoreOS) • Docker • Implementations of the Open Containers Initiative (OCI) • … OS-level virtualization solutions
  • 15. Dockerfile Container image docker build Repo Docker registry docker run Container runtime: Linux kernel + Docker engine Highlight about Docker
  • 16. Building container images My mongoDB : FROM ubuntu_base_image RUN apt-get update RUN apt-get install mongoDB EXPOSE 8080 ENTRY POINT /uns/binn/mongoDb DockerFile Ubuntu_base_image (from private or public registry) Docker deamon > docker build Container image Repo My Docker registry Leo’s container image
  • 17. Container image Repo Docker registry docker run -p 4000 :8080 friendlyhello Container runtime: Linux kernel + Docker engine :8080 :4000
  • 18. About building images on top of other images Files that are removed by subsequent layers in the system are actually still present in the images; they’re just inaccessible. E.g. In terms of building images, this also means that if server.js is changed, layer B and layer C will have to be rebuilt (so you have to order your layers from the least likely to change to most likely) Image Image Image Although “BigFile” is no longer accessible in the image ‘Layer C’, it is still present in Layer A, which Layer C is built on. With the right tools, BigFile can still be accessed by anyone having access to the image Layer C. In terms of network traffic, this also means that whenever you push or pull Layer C, BigFile is still transmitted through the network.
  • 19. Program Agenda 1. Containers: 1. The need for containers 2. Technical overview of containers 2. Kubernetes: 1. The need for Kubernetes 2. Technical overview of Kubernetes
  • 20. The need for Kubernetes 1. The need for declarative infrastructure as code 2. The need for cluster management of container-engines Subject covered orally
  • 21. The need for Kubernetes 1. The need for declarative infrastructure as code 2. The need for cluster management of container-engines
  • 22. Containers management platforms Manage distributed containers, and their lifecycle Containers Management Platform
  • 23. Containers management platforms Manage distributed containers, and their lifecycle Docker Swarm
  • 24. Program Agenda 1. Containers: 1. The need for containers 2. Technical overview of containers 2. Kubernetes: 1. The need for Kubernetes 2. Technical overview of Kubernetes
  • 25. Components of a K8s cluster
  • 26. Components of a cluster kube-apiserver etcd kube-scheduler kube-controller-manager Kubelet connected to Master node Worker node cloud-controller-manager It is the front-end for the Kubernetes control plane controls kube-proxy Container runtime (Docker, rkt, runc, etc.)
  • 27. Components of a cluster kube-apiserver etcd kube-scheduler kube-controller-manager Kubelet connected to Master node Worker node cloud-controller-manager Distributed key-value store. Provides a dynamic configuration registry. controls kube-proxy Container runtime (Docker, rkt, runc, etc.)
  • 28. Components of a cluster kube-apiserver etcd kube-scheduler kube-controller-manager Kubelet connected to Master node Worker node cloud-controller-manager Watches newly created pods that have no node assigned yet, and selects a node for them to run on. controls kube-proxy Container runtime (Docker, rkt, runc, etc.)
  • 29. Components of a cluster kube-apiserver etcd kube-scheduler kube-controller-manager Kubelet connected to Master node Worker node cloud-controller-manager controls kube-proxy Container runtime (Docker, rkt, runc, etc.) Component on the master that runs controllers. These controllers include: • Node Controller: detects when nodes go down, and responds. • Replication Controller: maintains the correct number of pods for every replication controller object (replicaset?) in the system. • Endpoints Controller: deploys the “Endpoints object” (i.e. services and pods) into the cluster. • Service Account & Token Controllers: Creates default accounts and API access tokens for new namespaces.
  • 30. Components of a cluster kube-apiserver etcd kube-scheduler kube-controller-manager Kubelet connected to Master node Worker node cloud-controller-manager controls kube-proxy Container runtime (Docker, rkt, runc, etc.) Runs controllers that interact with the underlying cloud providers. Those controllers are specific to the cloud-provider. Those controllers are: • Node Controller: when a node stops responding, it checks with the cloud provider to determine if this node has been deleted • Route Controller: sets up routes in the underlying cloud infrastructure • Service Controller: creates, updates and deletes cloud provider load balancers • Volume Controller: creates, attaches, and mounts volumes, and interacts with the cloud provider to orchestrate volumes
  • 31. Components of a cluster kube-apiserver etcd kube-scheduler kube-controller-manager Kubelet connected to controls Master node Worker node cloud-controller-manager Makes sure that containers are running in a pod. The kubelet takes a set of PodSpecs that are provided through various mechanisms and ensures that the containers described in those PodSpecs are running and healthy. kube-proxy Container runtime (Docker, rkt, runc, etc.)
  • 32. Components of a cluster kube-apiserver etcd kube-scheduler kube-controller-manager Kubelet connected to controls Master node Worker node cloud-controller-manager kube-proxy Enables the Kubernetes service abstraction by maintaining network rules on the host and performing connection forwarding. Container runtime (Docker, rkt, runc, etc.)
  • 34. Pods IP2 Shared storage Node 1 IP1 Shared storage (volume) Leo: You normally put in a pod just one container, or a handful of containers that are tightly coupled (e.g. a Tomcat container + a Git syncrhonizer; with both apps interacting thru a local filesystem). You achieve horizontal scaling by replicating pods; not by replicating containers within a pod. Created from an image
  • 35. Example of anti-pattern Pod Node 1 IP1
  • 37. Communication between containers within a same pod Node 1 IP1 Shared storage (volume) From: localhost:8080 To: localhost:3306 Kubernetes has an “IP-per-pod model”: containers within a same pod share the same IP address, and communicate with each other using distinct ports, on localhost. I know this is anti-pattern. It is just an example.
  • 38. Pods and network Private overlay network within the Kubernetes cluster Node 1 Node 2 Real network IP3IP1 IP2
  • 39. The need for services Private overlay network within the Kubernetes cluster Node 1 Node 2 Real network IP3IP1 IP2 Weblogic cluster Managed server1 Managed server2 App which is a client of the Weblogic cluster
  • 40. Services and network Private overlay network within the Kubernetes cluster Node 1 Node 2 Real network IP3 ServiceA IP4 IP1 IP2 Acts like a LB between Pods
  • 41. Service A level of abstraction providing an external and durable access to a set of pods. A service : • encompasses serval Pods, • has its own (private) IP (thus allowing consuming services to use the Service’s IP, instead of the Pod’s, which may change frequently), • load balances the IP packets it receives to its Pods.
  • 42. Services and network Private overlay network within the Kubernetes cluster Node 1 Node 2 Real network IP3 ServiceA IP4 IP1 IP2 Can optionally be made reachable from the real network Acts like a LB between Pods
  • 43. Services and network Private overlay network within the Kubernetes cluster Real network IP3 ServiceA IP4 IP1 IP2 Can optionally be made reachable from the real network Port of your choosing E.g. with the service-type “NodePort”: each hosting node will act as a NAT server specifically for this IP; i.e. it will associate one of its port to the IP4 Acts like a LB between Pods Port of your choosing
  • 44. Service A level of abstraction providing an external and durable access to a set of pods. A service : • encompasses serval Pods, • has its own (private) IP (thus allowing consuming services to use the Service’s IP, instead of the Pod’s, which may change frequently), • load balances the IP packets it receives to its Pods. • Provides 3 types of access: • ClusterIP: the service is only visible from inside the cluster
  • 45. Services and network Private overlay network within the Kubernetes cluster Node 1 Node 2 Real network IP3 ServiceA IP4 IP1 IP2 Acts like a LB between Pods
  • 46. Service A level of abstraction providing an external and durable access to a set of pods. A service : • encompasses serval Pods, • has its own (private) IP (thus allowing consuming services to use the Service’s IP, instead of the Pod’s, which may change frequently), • load balances the IP packets it receives to its Pods. • Provides 3 types of access: • ClusterIP: the service is only visible from inside the cluster • NodePort: each node in the cluster maps an external port to the service’s private IP
  • 47. Services and network Private overlay network within the Kubernetes cluster Real network IP3 ServiceA IP4 IP1 IP2 Can optionally be made reachable from the real network Port of your choosing E.g. with the service-type “NodePort”: each hosting node will act as a NAT server specifically for this IP; i.e. it will associate one of its port to the IP4 Acts like a LB between Pods Port of your choosing
  • 48. Service A level of abstraction providing an external and durable access to a set of pods. A service : • encompasses serval Pods, • has its own (private) IP (thus allowing consuming services to use the Service’s IP, instead of the Pod’s, which may change frequently), • load balances the IP packets it receives to its Pods. • Provides 3 types of access: • ClusterIP: the service is only visible from inside the cluster • NodePort: each node in the cluster maps an external port to the service’s private IP • LoadBalancer: a LB from the cloud provider will forward the traffic from the service the nodes within it. (like NodePort, but on top of this, an external LB is configured to balance the traffic between the nodes:servicePort?)
  • 49. Services and network Private overlay network within the Kubernetes cluster Real (private) network IP3 ServiceA IP4 IP1 IP2 Port of your choosing Acts like a LB between Pods Port of your choosing load balancer (cloud service)
  • 50. Services identify their pods (and deployments) thanks to labels
  • 51. Deployment features Additional: enforce replicasets, by • deploying the pods, • monitoring them, • Stop/restart them, • redeploying them on another node if needed. • Perform rolling updates • Undo an update if requested Deployments Deployments are a declarative way to ensure that the number of Pods running is equal to what the user declared to want. Deployments keep our Pods up and running, even when the nodes they run on fail. If Pods are declaratively updated (e.g. container image changed) or scaled, the Deployment will handle that.
  • 52. Deployment spec vs Pod spec Example of deployment Example of pod The same as a pod spec Specific to deployment spec
  • 53. Deployment spec vs Pod spec Example of deployment Example of pod The same as a pod spec Specific to deployment spec
  • 54. Deployment spec vs Pod spec Example of deployment Example of pod The same as a pod spec Specific to deployment spec Services identify their pods, and thus their deployments, thanks to labels
  • 56. E.g. of deployment spec apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels: app: nginx replicas: 2 # tells deployment to run 2 pods matching the template template: # create pods using pod definition in this template metadata: # unlike pod-nginx.yaml, the name is not included in the meta data as a unique name is # generated from the deployment name labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 deployment.yaml

Editor's Notes

  1. https://en.wikipedia.org/wiki/Template:Virtualization_software
  2. Kubernetes applies IP addresses at the Pod scope - containers within a Pod share their network namespaces - including their IP address. This means that containers within a Pod can all reach each other’s ports on localhost. This does imply that containers within a Pod must coordinate port usage, but this is no different than processes in a VM. This is called the “IP-per-pod” model. https://kubernetes.io/docs/concepts/cluster-administration/networking/