SlideShare uma empresa Scribd logo
1 de 54
AKS: Kubernetes e Azure
alla massima potenza
Alessandro Melchiori // @amelchiori
Monolith vs
microservice(s)
Monolith
The Good
● Fewer moving parts enables easy
deployment
Monolith
The “Good”
● Fewer moving parts enables easy
deployment
The “Bad”
● Longer Release cycles
● Update to one functionality requires
redeployment of the entire codebase
The biggest questions ever asked (some of)
● Is the universe deterministic?
The biggest questions ever asked (some of)
● Is the universe deterministic?
● What happens after you die?
The biggest questions ever asked (some of)
● Is the universe deterministic?
● What happens after you die?
● What is life?
The biggest questions ever asked (some of)
● Is the universe deterministic?
● What happens after you die?
● What is life?
● What is a microservice?
Microservice architecture
The “Good”
● An application is sum of its
components
● Better fault isolation
● Components can be spread across
multiple servers
The “Bad”
● Many components, many moving
parts
● Difficult to manage inter-
communication
● Manual management can be
difficult
Microservice architecture
The “Good”
● An application is sum of its
components
● Better fault isolation
● Components can be spread across
multiple servers
The “Bad”
● Many components, many moving
parts
● Difficult to manage inter-
communication
● Manual management can be
difficult
Welcome
Kubernetes
Kubernetes
Greek for “Helmsman” < the person who steers a ship
Kubernetes
Greek for “Helmsman” < the person who steers a ship
K8s
Greek for “Helmsman” < the person who steers a ship
● Born in Google
● Donated to CNCF in 2014
● Open source (Apache 2.0)
● v1.0 July 2015
● Written in Go/Golang
● Code is on GitHub (where otherwise?)
K8s: some infos
K8s: big picture view
● The Master is responsible for
managing the cluster
K8s: big picture view
● The Master is responsible for
managing the cluster
● A node is a VM or a physical
computer that serves as a worker
machine in a Kubernetes cluster.
Master(s)
The K8s control plane
K8s: master components
K8s: master components
kube-apiserver
Component on the master that exposes the
Kubernetes API. It is the front-end for the
Kubernetes control plane.
It is designed to scale horizontally
K8s: master components
etcd
Consistent and highly-available key value
store used as Kubernetes’ backing store for
all cluster data.
K8s: master components
kube-scheduler
Component on the master that watches
newly created pods that have no node
assigned, and selects a node for them to
run on.
K8s: master components
kube-controller-manager
Component on the master that runs
controllers:
● Node controller
● Replication controller
● Endpoints controller
● Service Account & Token controller
Node(s)
The K8s workers
K8s: node components
K8s: master components
kubelet
An agent that runs on each node in the
cluster. It makes sure that containers are
running in a pod.
K8s: master components
kube-proxy
It is like the network brain of the node. It is
a network proxy which reflects Kubernetes
networking services on each node.
K8s: master components
Container runtime
It’s the software that is responsible for
running containers. Kubernetes supports
several runtimes: Docker, rkt, runc and any
OCI runtime-spec implementation.
K8s objects
K8s objects overview
Kubernetes contains a number of abstractions that represent the state of your
system: deployed containerized applications and workloads, their associated
network and disk resources, and other information about what your cluster is
doing.
These abstractions are represented by objects in the Kubernetes API
K8s objects
Basic Kubernetes objects:
● Pod
● Service
● Volume
● Namespace
K8s objects
Basic Kubernetes objects:
● Pod
● Service
● Volume
● Namespace
Higher-level abstraction (controllers):
● ReplicaSet
● Deployment
● StatefulSet
● DaemonSet
● Job
Declarative model
&
Desired state
Management techniques
The kubectl command-line tool supports several different ways to create and
manage Kubernetes objects:
● Imperative commands
● Imperative object configuration
● Declarative object configuration
Imperative commands
The simplest way to get started or to run a one-off task in a cluster.
kubectl run nginx --image nginx
Imperative commands
Pro:
● Commands are simple, easy to
learn and easy to remember.
● Commands require only a single
step to make changes to the
cluster
Cons:
● Commands do not integrate with
change review processes.
● Commands do not provide an
audit trail associated with
changes.
Imperative object configuration
In imperative object configuration, the kubectl command specifies the
operation (create, replace, etc.), optional flags and at least one file name.
The file specified must contain a full definition of the object in YAML or JSON
format.
kubectl create -f nginx.yaml
Imperative object configuration
Pro:
● Object configuration can be stored
in a source control system such as
Git (vs. imperative commands)
● It’s simpler and easier to
understand (vs. declarative object
configuration)
Cons:
● Object configuration requires
basic understanding of the object
schema (vs. imparative commands)
● It works best on files, not
directories (vs. declarative object
configuration)
● Updates to live objects must be
reflected in configuration files, or
they will be lost during the next
replacement (vs. declarative object
configuration)
Declarative object configuration
Using declarative object configuration, a user operates on object configuration
files stored locally, however the user does not define the operations to be
taken on the files.
Create, update, and delete operations are automatically detected per-object by
kubectl.
kubectl apply -f configs/
Declarative object configuration
Pro:
● Changes made directly to live
objects are retained, even if they
are not merged back into the
configuration files
● It has better support for operating
on directories and automatically
detecting operation types per-
object
Cons:
● Declarative object configuration is
harder to debug
Pods, Services and
Deployment
Pod overview
● Is the basic building block of Kubernetes
● Represents a running process on the
cluster
● Consists of either a single container or a
small number of containers that are
tightly coupled and that share resources
Pod phases
Pods are mortal
The phase of a Pod is a simple, high-level
summary of where the Pod is in its lifecycle:
● Pending
● Running
● Succeeded
● Failed
● Unknown
Service overview
P frontend
10.0.0.12
P frontend
10.0.0.83
P frontend
10.0.0.25
P frontend
10.0.0.39
P backend
10.0.0.41
P backend
10.0.0.44
Service overview
P frontend
10.0.0.12
P frontend
10.0.0.83
P frontend
10.0.0.25
P frontend
10.0.0.39
P backend
10.0.0.41
P backend
10.0.0.44
Service overview
P frontend
10.0.0.12
P frontend
10.0.0.83
P frontend
10.0.0.25
P frontend
10.0.0.39
P backend
10.0.0.41
P backend
10.0.0.81
Service overview
P frontend
10.0.0.12
P frontend
10.0.0.83
P frontend
10.0.0.25
P frontend
10.0.0.39
P backend
10.0.0.41
P backend
10.0.0.44
P DNS:
be.myservice
10.0.0.27
Service overview
● Service is an abstraction which defines a logical
set of Pods and a policy by which to access
them
Service overview
● Service is an abstraction which defines a logical
set of Pods and a policy by which to access
them
● The set of Pods targeted by a Service is
(usually) determined by a Label Selector
Deployment overview
● It provides declarative updates for Pods
and ReplicaSets.
● You describe a desired state in a
Deployment object, and the Deployment
controller changes the actual state to
the desired state at a controlled rate.
K8s + Azure = AKS
Self-hosting K8s cluster
Manually install master
and worker nodes
Need to consider master HA,
adding additional worker
nodes, patching, updates, ...
Azure Kubernetes Service
● Simplifies deployment, management and
operations of K8s
● Makes it quick and easy to deploy and manage
containerized applications without container
orchestration expertise
● Eliminates the burden of ongoing operations and
maintenance by provisioning, upgrading and
scaling resources on demand

Mais conteúdo relacionado

Mais procurados

Kubernetes @ meetic
Kubernetes @ meeticKubernetes @ meetic
Kubernetes @ meetic
Sébastien Le Gall
 

Mais procurados (20)

Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Truemotion Adventures in Containerization
Truemotion Adventures in ContainerizationTruemotion Adventures in Containerization
Truemotion Adventures in Containerization
 
Deploying your first application with Kubernetes
Deploying your first application with KubernetesDeploying your first application with Kubernetes
Deploying your first application with Kubernetes
 
Service Discovery In Kubernetes
Service Discovery In KubernetesService Discovery In Kubernetes
Service Discovery In Kubernetes
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Kubernetes and OpenStack at Scale
Kubernetes and OpenStack at ScaleKubernetes and OpenStack at Scale
Kubernetes and OpenStack at Scale
 
Container orchestration and microservices world
Container orchestration and microservices worldContainer orchestration and microservices world
Container orchestration and microservices world
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
Demystifying the Nuts & Bolts of Kubernetes Architecture
Demystifying the Nuts & Bolts of Kubernetes ArchitectureDemystifying the Nuts & Bolts of Kubernetes Architecture
Demystifying the Nuts & Bolts of Kubernetes Architecture
 
OSDC 2018 | Self Hosted bare Metal Kubernetes for SMEs by Thomas Hoppe
OSDC 2018 | Self Hosted bare Metal Kubernetes for SMEs by Thomas HoppeOSDC 2018 | Self Hosted bare Metal Kubernetes for SMEs by Thomas Hoppe
OSDC 2018 | Self Hosted bare Metal Kubernetes for SMEs by Thomas Hoppe
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
 
Brief Introduction To Kubernetes
Brief Introduction To KubernetesBrief Introduction To Kubernetes
Brief Introduction To Kubernetes
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
Kubernetes @ meetic
Kubernetes @ meeticKubernetes @ meetic
Kubernetes @ meetic
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetesArchitectural caching patterns for kubernetes
Architectural caching patterns for kubernetes
 
Kubernetes Security Updates from Kubecon 2018 Seattle
Kubernetes Security Updates from Kubecon 2018 SeattleKubernetes Security Updates from Kubecon 2018 Seattle
Kubernetes Security Updates from Kubecon 2018 Seattle
 
Leveraging the Power of containerd Events - Evan Hazlett
Leveraging the Power of containerd Events - Evan HazlettLeveraging the Power of containerd Events - Evan Hazlett
Leveraging the Power of containerd Events - Evan Hazlett
 
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStackBitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
 
Extending Kubernetes
Extending KubernetesExtending Kubernetes
Extending Kubernetes
 
Kubernetes fundamentals
Kubernetes fundamentalsKubernetes fundamentals
Kubernetes fundamentals
 

Semelhante a Aks: k8s e azure

Semelhante a Aks: k8s e azure (20)

AKS: k8s e azure
AKS: k8s e azureAKS: k8s e azure
AKS: k8s e azure
 
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOpsDevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
 
A quick tour around Azure Dev Spaces
A quick tour around Azure Dev SpacesA quick tour around Azure Dev Spaces
A quick tour around Azure Dev Spaces
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Intro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps WorkshopIntro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps Workshop
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOps
 
08 - kubernetes.pptx
08 - kubernetes.pptx08 - kubernetes.pptx
08 - kubernetes.pptx
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
 
Kubernetes presentation
Kubernetes presentationKubernetes presentation
Kubernetes presentation
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
 
Virtual Flink Forward 2020: Integrate Flink with Kubernetes natively - Yang Wang
Virtual Flink Forward 2020: Integrate Flink with Kubernetes natively - Yang WangVirtual Flink Forward 2020: Integrate Flink with Kubernetes natively - Yang Wang
Virtual Flink Forward 2020: Integrate Flink with Kubernetes natively - Yang Wang
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
 
PuppetConf 2017: From Rollercoasters to Meerkats: 3 Generations of Production...
PuppetConf 2017: From Rollercoasters to Meerkats: 3 Generations of Production...PuppetConf 2017: From Rollercoasters to Meerkats: 3 Generations of Production...
PuppetConf 2017: From Rollercoasters to Meerkats: 3 Generations of Production...
 
Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021
 
From Rollercoasters to Meerkats: 3 Generations of Production Kubernetes Clusters
From Rollercoasters to Meerkats: 3 Generations of Production Kubernetes ClustersFrom Rollercoasters to Meerkats: 3 Generations of Production Kubernetes Clusters
From Rollercoasters to Meerkats: 3 Generations of Production Kubernetes Clusters
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview
 

Mais de Alessandro Melchiori

Mais de Alessandro Melchiori (20)

Scale your (aks) cluster, luke!
Scale your (aks) cluster, luke!Scale your (aks) cluster, luke!
Scale your (aks) cluster, luke!
 
A quick introduction to AKS
A quick introduction to AKSA quick introduction to AKS
A quick introduction to AKS
 
Developing reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSDeveloping reliable applications with .net core and AKS
Developing reliable applications with .net core and AKS
 
VS Code tools for docker
VS Code tools for dockerVS Code tools for docker
VS Code tools for docker
 
Developing reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSDeveloping reliable applications with .net core and AKS
Developing reliable applications with .net core and AKS
 
How to search...better! (azure search)
How to search...better! (azure search)How to search...better! (azure search)
How to search...better! (azure search)
 
How to search...better!
How to search...better!How to search...better!
How to search...better!
 
Azure functions: from a function to a whole application in 60 minutes
Azure functions: from a function to a whole application in 60 minutesAzure functions: from a function to a whole application in 60 minutes
Azure functions: from a function to a whole application in 60 minutes
 
Monitoring docker: from zero to Azure
Monitoring docker: from zero to AzureMonitoring docker: from zero to Azure
Monitoring docker: from zero to Azure
 
Cooking Akka.net and Azure Service Fabric together
Cooking Akka.net and Azure Service Fabric togetherCooking Akka.net and Azure Service Fabric together
Cooking Akka.net and Azure Service Fabric together
 
Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overview
 
ACR + ACS + VSTS: a complete ALM pipeline with docker and azure
ACR + ACS + VSTS: a complete ALM pipeline with docker and azureACR + ACS + VSTS: a complete ALM pipeline with docker and azure
ACR + ACS + VSTS: a complete ALM pipeline with docker and azure
 
Docker & Azure
Docker & AzureDocker & Azure
Docker & Azure
 
Docker and Azure
Docker and AzureDocker and Azure
Docker and Azure
 
Come ti "pusho" il web con WebSockets: da 0 a SignalR
Come ti "pusho" il web con WebSockets: da 0 a SignalR Come ti "pusho" il web con WebSockets: da 0 a SignalR
Come ti "pusho" il web con WebSockets: da 0 a SignalR
 
Docker &amp; azure
Docker &amp; azureDocker &amp; azure
Docker &amp; azure
 
Azure service fabric: a gentle introduction
Azure service fabric: a gentle introductionAzure service fabric: a gentle introduction
Azure service fabric: a gentle introduction
 
From CRUD to messages: a true story
From CRUD to messages: a true storyFrom CRUD to messages: a true story
From CRUD to messages: a true story
 
Functional Reactive Programming
Functional Reactive ProgrammingFunctional Reactive Programming
Functional Reactive Programming
 
Functional DDD
Functional DDDFunctional DDD
Functional DDD
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Aks: k8s e azure

  • 1. AKS: Kubernetes e Azure alla massima potenza Alessandro Melchiori // @amelchiori
  • 3. Monolith The Good ● Fewer moving parts enables easy deployment
  • 4. Monolith The “Good” ● Fewer moving parts enables easy deployment The “Bad” ● Longer Release cycles ● Update to one functionality requires redeployment of the entire codebase
  • 5. The biggest questions ever asked (some of) ● Is the universe deterministic?
  • 6. The biggest questions ever asked (some of) ● Is the universe deterministic? ● What happens after you die?
  • 7. The biggest questions ever asked (some of) ● Is the universe deterministic? ● What happens after you die? ● What is life?
  • 8. The biggest questions ever asked (some of) ● Is the universe deterministic? ● What happens after you die? ● What is life? ● What is a microservice?
  • 9.
  • 10. Microservice architecture The “Good” ● An application is sum of its components ● Better fault isolation ● Components can be spread across multiple servers The “Bad” ● Many components, many moving parts ● Difficult to manage inter- communication ● Manual management can be difficult
  • 11. Microservice architecture The “Good” ● An application is sum of its components ● Better fault isolation ● Components can be spread across multiple servers The “Bad” ● Many components, many moving parts ● Difficult to manage inter- communication ● Manual management can be difficult
  • 13. Kubernetes Greek for “Helmsman” < the person who steers a ship
  • 14. Kubernetes Greek for “Helmsman” < the person who steers a ship
  • 15. K8s Greek for “Helmsman” < the person who steers a ship
  • 16. ● Born in Google ● Donated to CNCF in 2014 ● Open source (Apache 2.0) ● v1.0 July 2015 ● Written in Go/Golang ● Code is on GitHub (where otherwise?) K8s: some infos
  • 17. K8s: big picture view ● The Master is responsible for managing the cluster
  • 18. K8s: big picture view ● The Master is responsible for managing the cluster ● A node is a VM or a physical computer that serves as a worker machine in a Kubernetes cluster.
  • 21. K8s: master components kube-apiserver Component on the master that exposes the Kubernetes API. It is the front-end for the Kubernetes control plane. It is designed to scale horizontally
  • 22. K8s: master components etcd Consistent and highly-available key value store used as Kubernetes’ backing store for all cluster data.
  • 23. K8s: master components kube-scheduler Component on the master that watches newly created pods that have no node assigned, and selects a node for them to run on.
  • 24. K8s: master components kube-controller-manager Component on the master that runs controllers: ● Node controller ● Replication controller ● Endpoints controller ● Service Account & Token controller
  • 27. K8s: master components kubelet An agent that runs on each node in the cluster. It makes sure that containers are running in a pod.
  • 28. K8s: master components kube-proxy It is like the network brain of the node. It is a network proxy which reflects Kubernetes networking services on each node.
  • 29. K8s: master components Container runtime It’s the software that is responsible for running containers. Kubernetes supports several runtimes: Docker, rkt, runc and any OCI runtime-spec implementation.
  • 31. K8s objects overview Kubernetes contains a number of abstractions that represent the state of your system: deployed containerized applications and workloads, their associated network and disk resources, and other information about what your cluster is doing. These abstractions are represented by objects in the Kubernetes API
  • 32. K8s objects Basic Kubernetes objects: ● Pod ● Service ● Volume ● Namespace
  • 33. K8s objects Basic Kubernetes objects: ● Pod ● Service ● Volume ● Namespace Higher-level abstraction (controllers): ● ReplicaSet ● Deployment ● StatefulSet ● DaemonSet ● Job
  • 35. Management techniques The kubectl command-line tool supports several different ways to create and manage Kubernetes objects: ● Imperative commands ● Imperative object configuration ● Declarative object configuration
  • 36. Imperative commands The simplest way to get started or to run a one-off task in a cluster. kubectl run nginx --image nginx
  • 37. Imperative commands Pro: ● Commands are simple, easy to learn and easy to remember. ● Commands require only a single step to make changes to the cluster Cons: ● Commands do not integrate with change review processes. ● Commands do not provide an audit trail associated with changes.
  • 38. Imperative object configuration In imperative object configuration, the kubectl command specifies the operation (create, replace, etc.), optional flags and at least one file name. The file specified must contain a full definition of the object in YAML or JSON format. kubectl create -f nginx.yaml
  • 39. Imperative object configuration Pro: ● Object configuration can be stored in a source control system such as Git (vs. imperative commands) ● It’s simpler and easier to understand (vs. declarative object configuration) Cons: ● Object configuration requires basic understanding of the object schema (vs. imparative commands) ● It works best on files, not directories (vs. declarative object configuration) ● Updates to live objects must be reflected in configuration files, or they will be lost during the next replacement (vs. declarative object configuration)
  • 40. Declarative object configuration Using declarative object configuration, a user operates on object configuration files stored locally, however the user does not define the operations to be taken on the files. Create, update, and delete operations are automatically detected per-object by kubectl. kubectl apply -f configs/
  • 41. Declarative object configuration Pro: ● Changes made directly to live objects are retained, even if they are not merged back into the configuration files ● It has better support for operating on directories and automatically detecting operation types per- object Cons: ● Declarative object configuration is harder to debug
  • 43. Pod overview ● Is the basic building block of Kubernetes ● Represents a running process on the cluster ● Consists of either a single container or a small number of containers that are tightly coupled and that share resources
  • 44. Pod phases Pods are mortal The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle: ● Pending ● Running ● Succeeded ● Failed ● Unknown
  • 45. Service overview P frontend 10.0.0.12 P frontend 10.0.0.83 P frontend 10.0.0.25 P frontend 10.0.0.39 P backend 10.0.0.41 P backend 10.0.0.44
  • 46. Service overview P frontend 10.0.0.12 P frontend 10.0.0.83 P frontend 10.0.0.25 P frontend 10.0.0.39 P backend 10.0.0.41 P backend 10.0.0.44
  • 47. Service overview P frontend 10.0.0.12 P frontend 10.0.0.83 P frontend 10.0.0.25 P frontend 10.0.0.39 P backend 10.0.0.41 P backend 10.0.0.81
  • 48. Service overview P frontend 10.0.0.12 P frontend 10.0.0.83 P frontend 10.0.0.25 P frontend 10.0.0.39 P backend 10.0.0.41 P backend 10.0.0.44 P DNS: be.myservice 10.0.0.27
  • 49. Service overview ● Service is an abstraction which defines a logical set of Pods and a policy by which to access them
  • 50. Service overview ● Service is an abstraction which defines a logical set of Pods and a policy by which to access them ● The set of Pods targeted by a Service is (usually) determined by a Label Selector
  • 51. Deployment overview ● It provides declarative updates for Pods and ReplicaSets. ● You describe a desired state in a Deployment object, and the Deployment controller changes the actual state to the desired state at a controlled rate.
  • 52. K8s + Azure = AKS
  • 53. Self-hosting K8s cluster Manually install master and worker nodes Need to consider master HA, adding additional worker nodes, patching, updates, ...
  • 54. Azure Kubernetes Service ● Simplifies deployment, management and operations of K8s ● Makes it quick and easy to deploy and manage containerized applications without container orchestration expertise ● Eliminates the burden of ongoing operations and maintenance by provisioning, upgrading and scaling resources on demand

Notas do Editor

  1. Master components provide the cluster’s control plane. Master components make global decisions about the cluster (for example, scheduling), and detecting and responding to cluster events (starting up a new pod when a replication controller’s ‘replicas’ field is unsatisfied). Master components can be run on any machine in the cluster. However, for simplicity, set up scripts typically start all master components on the same machine, and do not run user containers on this machine.
  2. It is the brain to the master and is front-end to the master or control plane. Kube-apiserver implements the RESTful API and consumes json via a manifest file. Manifest files declare the state of the app like a record of intent and are validated and deployed on the cluster. It exposes an endpoint (by default on port 443) so that kubectl (command line utility) can issue commands/queries and run on the master.
  3. It provides persistent storage and is stateful. It uses etcd. It is distributed, consistent and watchable. etcd – etcd is open source distributed key-value store that serves as the backbone of distributed systems by providing a canonical hub for cluster coordination and state management. Kubernetes uses etcd as the “source of truth” for the cluster. It takes care of storing and replicating data used by Kubernetes across the entire cluster. It is written in Go language and uses Raft protocol, which helps etcd in recovering from hardware failure and network partitions.
  4. This is the process that watches API-server for new pods and assigns workloads to specific nodes in the cluster. It is responsible for tracking resource utilization on each host to make sure that workloads are not scheduled in excess of the available resources.
  5. Kubernetes controller manager is a daemon that implants the core control loops shipped with Kubernetes. It is the controller of controllers. It watches the shared state of the cluster through the API server and makes changes attempting to move the current state towards the desired state. Examples of controllers that ship with Kubernetes today are the replication controller, endpoints controller, namespace controller, and service accounts controller. At the point when a change is seen, the controller reads the new information and implements the procedure that fulfills the desired state. This can involve scaling an application up or down, adjusting endpoints, and so forth. A Replication controller provides a pod template for creating any number of pod copies. It provides logic for scaling pod up or down. It can also be used for rolling deployments. Node Controller: Responsible for noticing and responding when nodes go down. Replication Controller: Responsible for maintaining the correct number of pods for every replication controller object in the system. Endpoints Controller: Populates the Endpoints object (that is, joins Services & Pods). Service Account & Token Controllers: Create default accounts and API access tokens for new namespaces
  6. Node components run on every node, maintaining running pods and providing the Kubernetes runtime environment.
  7. 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. The kubelet doesn’t manage containers which were not created by Kubernetes the main Kubernetes agent on the node registers node with the cluster watches API server for work assignment instantiate pods for carrying out the work reports back to master exposes endpoint on port-10255. It lets you inspect the specs of a Kubelet.