SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
 Open Source
Data:7/12/2018
non-commercial use
Kubernetes
1
Jason(李孟澤)
Experience
Speaker-CNTUG
Graduate Student
Fields
Android
GoLang
Kubernetes
OpenStack
Who am I
2
Aganda
We will talk about
3
How to install Kubernetes
Ansible
Kubespray
Kubeadm
What is Kubernetes
Architecture
API Server
Controller Manager
Scheduler
How to run an App in Kubernetes
Write yams file
Expose your service
Kubernetes
& Ansible
Building a Kubernetes production ready environment
is quite complicated, so we use automated
subordinate tools to help us implement it.
What is Anisble
Ansible is an IT automation tool. It can configure systems,
deploy software, and orchestrate more advanced IT tasks such
as continuous deployments or zero downtime rolling updates.
4
Kubespray
Kubernetes-incubator
Kubespray is a composition of Ansible playbooks, inventory, provisioning
tools, and domain knowledge for generic OS/Kubernetes clusters
configuration management tasks. Kubespray provides:
a highly available cluster
composable attributes
support for most popular Linux distributions (CoreOS, Debian Jessie,
Ubuntu 16.04, CentOS/RHEL 7, Fedora/CentOS Atomic)
continuous integration tests
5
Kubeadm
Kubernetes-official
kubeadm’s simplicity means it can serve a wide range of use cases:
New users can start with kubeadm to try Kubernetes out for the
first time.
Users familiar with Kubernetes can spin up clusters with kubeadm
and test their applications.
Larger projects can include kubeadm as a building block in a more
complex system that can also include other installer tools.
6
Install guide
Kubeadm
Before you begin
7
One or more machines running one of:
	 Ubuntu 16.04+
	 Debian 9
	 CentOS 7
Or other…
2 GB or more of RAM per machine
2 CPUs or more
Swap disabled. You MUST disable.
Full network connectivity between all machines
Ref:
https://kubernetes.io/docs/tasks/
tools/install-kubeadm/
Install guide
Kubeadm
STEP #1
8
Installing Docker
sudo apt-get update
sudo apt-get install -y docker.io
or install Docker CE 17.03
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl
software-properties-common
sudo curl -fsSL https://download.docker.com/linux/ubuntu/
gpg | apt-key add -
sudo add-apt-repository "deb https://download.docker.com/
linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
sudo apt-get update && apt-get install -y docker-ce=$(apt-cache
madison docker-ce | grep 17.03 | head -1 | awk '{print $3}')
Is Guide is only for Ubuntu or Debian
Install guide
Kubeadm
STEP #2
9
Installing kubeadm , kubelet and kubectl
sudo apt-get update && sudo apt-get install -y
apt-transport-https curl
sudo curl -s https://
packages.cloud.google.com/apt/doc/apt-
key.gpg | sudo apt-key add -
sudo cat <<EOF >/etc/apt/sources.list.d/
kubernetes.list deb http://apt.kubernetes.io/
kubernetes-xenial main EOF
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
Is Guide is only for Ubuntu or Debian
Install guide
Kubeadm
STEP #3
10
Disable swap
sudo swapoff -a
sudo sysctl -w vm.swappiness=0
sudo sed '/swap.img/d' -i /etc/fstab
Set the following system parameters
cat <<EOF | tee /etc/sysctl.d/k8s.conf
net.ipv4.ip_forward = 1

net.bridge.bridge-nf-call-ip6tables =1

net.bridge.bridge-nf-call-iptables = 1

EOF
sudo sysctl -p /etc/sysctl.d/k8s.conf
Is Guide is only for Ubuntu or Debian
Install guide
Kubeadm
STEP #4
11
Confirm Docker information
CGROUP_DRIVER=$(sudo docker info | grep
"Cgroup Driver" | awk '{print $3}')
sudo sed -i "s|KUBELET_KUBECONFIG_ARGS=|
KUBELET_KUBECONFIG_ARGS=--cgroup-
driver=$CGROUP_DRIVER |g" /etc/systemd/
system/kubelet.service.d/10-kubeadm.conf
Restart the Docker Daemon
sudo systemctl daemon-reload
sudo systemctl enable docker &&sudo systemctl start
docker
sudo systemctl status docker
Is Guide is only for Ubuntu or Debian
Install guide
Kubeadm
STEP #5
12
Restart the kubelet Daemon
sudo systemctl daemon-reload
sudo systemctl enable kubelet &&sudo systemctl start kublet
sudo systemctl status kublet
Using kubeadm to Create a Cluster
sudo kubeadm init --pod-network-cidr=192.168.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/
config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get node
Is Guide is only for Ubuntu or Debian
Install guide
Kubeadm
STEP #6
13
Using kubeadm join to the existing Cluster
(on other node)
kubeadm join --token <token> <master-ip>:<master-port>
--discovery-token-ca-cert-hash sha256:<hash>
Check Node is joined
(on the master node)
kubectl apply -f https://docs.projectcalico.org/v3.1/
getting-started/kubernetes/installation/hosted/rbac-
kdd.yaml
kubectl apply -f https://docs.projectcalico.org/v3.1/
getting-started/kubernetes/installation/hosted/kubernetes-
datastore/calico-networking/1.7/calico.yaml
kubectl get node
Is Guide is only for Ubuntu or Debian
Kubernetes
&
Architecture
A node is a worker machine in Kubernetes, previously
known as a minion. A node may be a VM or physical
machine, depending on the cluster.
14
What is

CNCF 
▪ The Cloud Native Computing Foundation
builds sustainable ecosystems and fosters
a community around a constellation of high-
quality projects that orchestrate containers
as part of a microservices architecture.
CNCF
CNCF serves as the vendor-neutral home for many of the fastest-growing projects on
GitHub
15
What is

Kubernetes 
▪ Kubernetes is an open-source system for
automating deployment, scaling, and
management of containerized applications.
Kubernetes
Planet Scale Run Anywhere Never Outgrow
17
Kubernetes
&
Architecture
A node is a worker machine in Kubernetes, previously
known as a minion. A node may be a VM or physical
machine, depending on the cluster.
19
Kubernetes
&
Master node
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).
20
Kubernetes
&
Worker node
Node components run on every node, maintaining
running pods and providing the Kubernetes runtime
environment.
21
Kubernetes
&
Worker node
Addons are pods and services that implement cluster
features. The pods may be managed by Deployments,
ReplicationControllers, and so on. Namespaced addon
objects are created in the kube-system namespace.
22
Kubernetes
CNI
 A Cloud Native Computing Foundation project, consists
of a specification and libraries for writing plugins to
configure network interfaces in Linux containers
Flannel
Calico
Weave
Kuryr
Canal
Cilium
Contiv
CNI (Container Network Interface)
23
Kubernetes
CRI
Consists of a protobuf API, specifications/requirements,
and libraries for container runtimes to integrate with
kubelet on a node. 
Docker
rkt
frakti
cri-containerd
CRI (Container Runtime Interface)
24
Kubernetes
CSI
Enable storage vendors (SP) to develop a plugin once
and have it work across a number of container
orchestration (CO) systems.
ceph
Glusterfs
CSI (Container Storage Interface)
25
Kubernetes
Computing
A Kubernetes pod runs on a given node,
it means a single pod cannot be
stretched across multiple nodes.
26
Kubernetes
Networking
From network point of view a routable IP
address is assign to a given pod.
Containers within a pod share an IP
address and port space, and can find
each other via localhost.
27
Kubernetes
Storage
The storage claimed by a pod is shared
with all the containers within that pod.
Once a persistent volume is claimed by
a pod, it cannot be claimed/attached by
another pod. Volumes enable data to
survive container restarts and to be
shared among the applications within the
pod.
28
Kubernetes
Scheduling
By default the kube-
scheduler service ensures that pods are
only placed on nodes that have sufficient
free resources. Also, it tries to balance
out the resource utilisation of nodes.
29
Kubernetes
Pod
Pods are the smallest deployable units
of computing that can be created and
managed in Kubernetes.
30
Kubernetes
Deployment
Deployment controller changes the
actual state to the desired state at a
controlled rate. 
31
Kubernetes
WokerShop
Q&A
TIME
Kubernetes

Contenu connexe

Tendances

Rancher and Kubernetes Best Practices
Rancher and  Kubernetes Best PracticesRancher and  Kubernetes Best Practices
Rancher and Kubernetes Best PracticesAvinash Patil
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes VMware Tanzu
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionPeng Xiao
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to KubernetesImesh Gunaratne
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Edureka!
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes ArchitectureKnoldus Inc.
 
Kubernetes
KubernetesKubernetes
Kuberneteserialc_w
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetesDongwon Kim
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenIntroduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenTrang Nguyen
 
Azure Container Apps
Azure Container AppsAzure Container Apps
Azure Container AppsKen Sykora
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfKnoldus Inc.
 
Autoscaling Kubernetes
Autoscaling KubernetesAutoscaling Kubernetes
Autoscaling Kubernetescraigbox
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideBytemark
 

Tendances (20)

Why Kubernetes on Azure
Why Kubernetes on AzureWhy Kubernetes on Azure
Why Kubernetes on Azure
 
Kubernetes security
Kubernetes securityKubernetes security
Kubernetes security
 
Rancher and Kubernetes Best Practices
Rancher and  Kubernetes Best PracticesRancher and  Kubernetes Best Practices
Rancher and Kubernetes Best Practices
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
What Is Helm
 What Is Helm What Is Helm
What Is Helm
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenIntroduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
 
Azure Container Apps
Azure Container AppsAzure Container Apps
Azure Container Apps
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdf
 
Autoscaling Kubernetes
Autoscaling KubernetesAutoscaling Kubernetes
Autoscaling Kubernetes
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory Guide
 

Similaire à Kubernetes

Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibilityDocker, Inc.
 
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...ssuser92b4be
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)HungWei Chiu
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Wojciech Barczyński
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developerPaul Czarkowski
 
Deploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmDeploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmJessica Deen
 
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클Oracle Korea
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetesWilliam Stewart
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSLaura Frank Tacho
 
Building a Kubernetes App with Amazon EKS
Building a Kubernetes App with Amazon EKSBuilding a Kubernetes App with Amazon EKS
Building a Kubernetes App with Amazon EKSDevOps.com
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installationAhmed Mekawy
 
Aws container webinar day 1
Aws container webinar day 1Aws container webinar day 1
Aws container webinar day 1HoseokSeo7
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLarry Cai
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to KubernetesPaul Czarkowski
 
DevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationDevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationHank Preston
 
OSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacyOSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacySteve Wong
 
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Codemotion
 
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeAcademy
 
Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKel Cecil
 

Similaire à Kubernetes (20)

Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
Deploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmDeploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and Helm
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKS
 
Building a Kubernetes App with Amazon EKS
Building a Kubernetes App with Amazon EKSBuilding a Kubernetes App with Amazon EKS
Building a Kubernetes App with Amazon EKS
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
 
Aws container webinar day 1
Aws container webinar day 1Aws container webinar day 1
Aws container webinar day 1
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
 
DevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationDevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes Integration
 
OSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacyOSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacy
 
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
 
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
 
Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of Containers
 

Dernier

Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEselvakumar948
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 

Dernier (20)

Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 

Kubernetes

  • 3. Aganda We will talk about 3 How to install Kubernetes Ansible Kubespray Kubeadm What is Kubernetes Architecture API Server Controller Manager Scheduler How to run an App in Kubernetes Write yams file Expose your service
  • 4. Kubernetes & Ansible Building a Kubernetes production ready environment is quite complicated, so we use automated subordinate tools to help us implement it. What is Anisble Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. 4
  • 5. Kubespray Kubernetes-incubator Kubespray is a composition of Ansible playbooks, inventory, provisioning tools, and domain knowledge for generic OS/Kubernetes clusters configuration management tasks. Kubespray provides: a highly available cluster composable attributes support for most popular Linux distributions (CoreOS, Debian Jessie, Ubuntu 16.04, CentOS/RHEL 7, Fedora/CentOS Atomic) continuous integration tests 5
  • 6. Kubeadm Kubernetes-official kubeadm’s simplicity means it can serve a wide range of use cases: New users can start with kubeadm to try Kubernetes out for the first time. Users familiar with Kubernetes can spin up clusters with kubeadm and test their applications. Larger projects can include kubeadm as a building block in a more complex system that can also include other installer tools. 6
  • 7. Install guide Kubeadm Before you begin 7 One or more machines running one of: Ubuntu 16.04+ Debian 9 CentOS 7 Or other… 2 GB or more of RAM per machine 2 CPUs or more Swap disabled. You MUST disable. Full network connectivity between all machines Ref: https://kubernetes.io/docs/tasks/ tools/install-kubeadm/
  • 8. Install guide Kubeadm STEP #1 8 Installing Docker sudo apt-get update sudo apt-get install -y docker.io or install Docker CE 17.03 sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common sudo curl -fsSL https://download.docker.com/linux/ubuntu/ gpg | apt-key add - sudo add-apt-repository "deb https://download.docker.com/ linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable" sudo apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}') Is Guide is only for Ubuntu or Debian
  • 9. Install guide Kubeadm STEP #2 9 Installing kubeadm , kubelet and kubectl sudo apt-get update && sudo apt-get install -y apt-transport-https curl sudo curl -s https:// packages.cloud.google.com/apt/doc/apt- key.gpg | sudo apt-key add - sudo cat <<EOF >/etc/apt/sources.list.d/ kubernetes.list deb http://apt.kubernetes.io/ kubernetes-xenial main EOF sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl Is Guide is only for Ubuntu or Debian
  • 10. Install guide Kubeadm STEP #3 10 Disable swap sudo swapoff -a sudo sysctl -w vm.swappiness=0 sudo sed '/swap.img/d' -i /etc/fstab Set the following system parameters cat <<EOF | tee /etc/sysctl.d/k8s.conf net.ipv4.ip_forward = 1
 net.bridge.bridge-nf-call-ip6tables =1
 net.bridge.bridge-nf-call-iptables = 1
 EOF sudo sysctl -p /etc/sysctl.d/k8s.conf Is Guide is only for Ubuntu or Debian
  • 11. Install guide Kubeadm STEP #4 11 Confirm Docker information CGROUP_DRIVER=$(sudo docker info | grep "Cgroup Driver" | awk '{print $3}') sudo sed -i "s|KUBELET_KUBECONFIG_ARGS=| KUBELET_KUBECONFIG_ARGS=--cgroup- driver=$CGROUP_DRIVER |g" /etc/systemd/ system/kubelet.service.d/10-kubeadm.conf Restart the Docker Daemon sudo systemctl daemon-reload sudo systemctl enable docker &&sudo systemctl start docker sudo systemctl status docker Is Guide is only for Ubuntu or Debian
  • 12. Install guide Kubeadm STEP #5 12 Restart the kubelet Daemon sudo systemctl daemon-reload sudo systemctl enable kubelet &&sudo systemctl start kublet sudo systemctl status kublet Using kubeadm to Create a Cluster sudo kubeadm init --pod-network-cidr=192.168.0.0/16 mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/ config sudo chown $(id -u):$(id -g) $HOME/.kube/config kubectl get node Is Guide is only for Ubuntu or Debian
  • 13. Install guide Kubeadm STEP #6 13 Using kubeadm join to the existing Cluster (on other node) kubeadm join --token <token> <master-ip>:<master-port> --discovery-token-ca-cert-hash sha256:<hash> Check Node is joined (on the master node) kubectl apply -f https://docs.projectcalico.org/v3.1/ getting-started/kubernetes/installation/hosted/rbac- kdd.yaml kubectl apply -f https://docs.projectcalico.org/v3.1/ getting-started/kubernetes/installation/hosted/kubernetes- datastore/calico-networking/1.7/calico.yaml kubectl get node Is Guide is only for Ubuntu or Debian
  • 14. Kubernetes & Architecture A node is a worker machine in Kubernetes, previously known as a minion. A node may be a VM or physical machine, depending on the cluster. 14
  • 15. What is
 CNCF  ▪ The Cloud Native Computing Foundation builds sustainable ecosystems and fosters a community around a constellation of high- quality projects that orchestrate containers as part of a microservices architecture. CNCF CNCF serves as the vendor-neutral home for many of the fastest-growing projects on GitHub 15
  • 16.
  • 17. What is
 Kubernetes  ▪ Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. Kubernetes Planet Scale Run Anywhere Never Outgrow 17
  • 18.
  • 19. Kubernetes & Architecture A node is a worker machine in Kubernetes, previously known as a minion. A node may be a VM or physical machine, depending on the cluster. 19
  • 20. Kubernetes & Master node 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). 20
  • 21. Kubernetes & Worker node Node components run on every node, maintaining running pods and providing the Kubernetes runtime environment. 21
  • 22. Kubernetes & Worker node Addons are pods and services that implement cluster features. The pods may be managed by Deployments, ReplicationControllers, and so on. Namespaced addon objects are created in the kube-system namespace. 22
  • 23. Kubernetes CNI  A Cloud Native Computing Foundation project, consists of a specification and libraries for writing plugins to configure network interfaces in Linux containers Flannel Calico Weave Kuryr Canal Cilium Contiv CNI (Container Network Interface) 23
  • 24. Kubernetes CRI Consists of a protobuf API, specifications/requirements, and libraries for container runtimes to integrate with kubelet on a node.  Docker rkt frakti cri-containerd CRI (Container Runtime Interface) 24
  • 25. Kubernetes CSI Enable storage vendors (SP) to develop a plugin once and have it work across a number of container orchestration (CO) systems. ceph Glusterfs CSI (Container Storage Interface) 25
  • 26. Kubernetes Computing A Kubernetes pod runs on a given node, it means a single pod cannot be stretched across multiple nodes. 26
  • 27. Kubernetes Networking From network point of view a routable IP address is assign to a given pod. Containers within a pod share an IP address and port space, and can find each other via localhost. 27
  • 28. Kubernetes Storage The storage claimed by a pod is shared with all the containers within that pod. Once a persistent volume is claimed by a pod, it cannot be claimed/attached by another pod. Volumes enable data to survive container restarts and to be shared among the applications within the pod. 28
  • 29. Kubernetes Scheduling By default the kube- scheduler service ensures that pods are only placed on nodes that have sufficient free resources. Also, it tries to balance out the resource utilisation of nodes. 29
  • 30. Kubernetes Pod Pods are the smallest deployable units of computing that can be created and managed in Kubernetes. 30
  • 31. Kubernetes Deployment Deployment controller changes the actual state to the desired state at a controlled rate.  31