SlideShare a Scribd company logo
 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
Kubernetes
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
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
Ad

More Related Content

What's hot (20)

Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Raffaele Di Fazio
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Martin Danielsson
 
Kubernetes
KubernetesKubernetes
Kubernetes
erialc_w
 
Kubernetes 101 for Beginners
Kubernetes 101 for BeginnersKubernetes 101 for Beginners
Kubernetes 101 for Beginners
Oktay Esgul
 
Kubernetes - introduction
Kubernetes - introductionKubernetes - introduction
Kubernetes - introduction
Sparkbit
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
Imesh Gunaratne
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
Bob Killen
 
Kubernetes
KubernetesKubernetes
Kubernetes
Henry He
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
Crevise Technologies
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
Deep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingDeep dive into Kubernetes Networking
Deep dive into Kubernetes Networking
Sreenivas Makam
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
Paris Apostolopoulos
 
01. Kubernetes-PPT.pptx
01. Kubernetes-PPT.pptx01. Kubernetes-PPT.pptx
01. Kubernetes-PPT.pptx
TamalBanerjee16
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
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
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
Sathish VJ
 
Red Hat OpenShift on Bare Metal and Containerized Storage
Red Hat OpenShift on Bare Metal and Containerized StorageRed Hat OpenShift on Bare Metal and Containerized Storage
Red Hat OpenShift on Bare Metal and Containerized Storage
Greg Hoelzer
 
Kubernetes
KubernetesKubernetes
Kubernetes
erialc_w
 
Kubernetes 101 for Beginners
Kubernetes 101 for BeginnersKubernetes 101 for Beginners
Kubernetes 101 for Beginners
Oktay Esgul
 
Kubernetes - introduction
Kubernetes - introductionKubernetes - introduction
Kubernetes - introduction
Sparkbit
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
Imesh Gunaratne
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
Bob Killen
 
Kubernetes
KubernetesKubernetes
Kubernetes
Henry He
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
Deep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingDeep dive into Kubernetes Networking
Deep dive into Kubernetes Networking
Sreenivas Makam
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
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
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
Sathish VJ
 
Red Hat OpenShift on Bare Metal and Containerized Storage
Red Hat OpenShift on Bare Metal and Containerized StorageRed Hat OpenShift on Bare Metal and Containerized Storage
Red Hat OpenShift on Bare Metal and Containerized Storage
Greg Hoelzer
 

Similar to Kubernetes (20)

Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
Docker, 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 developer
Paul 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 Helm
Jessica Deen
 
Kubernetes
KubernetesKubernetes
Kubernetes
Linjith Kunnon
 
[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 kubernetes
William Stewart
 
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
DevOps.com
 
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
Laura Frank Tacho
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
Ahmed Mekawy
 
Aws container webinar day 1
Aws container webinar day 1Aws container webinar day 1
Aws container webinar day 1
HoseokSeo7
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
Larry Cai
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
Paul Czarkowski
 
DevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationDevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes Integration
Hank 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 legacy
Steve 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 pipeline
KubeAcademy
 
Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of Containers
Kel Cecil
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
Docker, 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 developer
Paul 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 Helm
Jessica 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 kubernetes
William Stewart
 
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
DevOps.com
 
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
Laura Frank Tacho
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
Ahmed Mekawy
 
Aws container webinar day 1
Aws container webinar day 1Aws container webinar day 1
Aws container webinar day 1
HoseokSeo7
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
Larry Cai
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
Paul Czarkowski
 
DevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationDevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes Integration
Hank 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 legacy
Steve 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 pipeline
KubeAcademy
 
Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of Containers
Kel Cecil
 
Ad

Recently uploaded (20)

Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Ad

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
  • 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
  • 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