SlideShare a Scribd company logo
1 of 27
Learn Kubernetes in 90 minutes
Larry Cai <larry.caiyu@gmail.com>
Agenda
 Introduction
 Exercise 1: First web service in kubernetes
 Exercise 2: Revisit pod, deployment and service
 Exercise 3: Controller – Deployment (scale)
 Exercise 4: Deploy with YAML file
 Exercise 5: install Microservice: Guestbook
 Reference
Learn kubernetes in 90 minutes2 10/2/2017
Minikube environment setup is in appendix
Environment using k8s playground
 Three nodes in http://labs.play-with-k8s.com (master + 2 workers)
 Node 1 (master node): follow guideline step 1/2/3
If dashboard doesn’t work, use https://git.io/vdc52
instead of https://git.io/kube-dashboard
 Node 2/Node 3
kubeadm join –token … # check the console log in Node 1
 Node 1:
kubectl get nodes
 Click the port to open dashboard
Learn kubernetes in 90 minutes3 10/2/2017
Try to use Ctrl-Ins & Shift-Ins for copy/paste
Background – Container/Docker
 Container technology offers an alternative method
for virtualization in cloud, with more efficiency & fast
 New era for packaging and delivering software
 Docker is one execution engine for container
 docker pull nginx
 docker run --name web -d -p 8080:80 nginx
 docker exec -it web bash
 docker build -t larrycai/whoami .
Learn kubernetes in 90 minutes4 10/2/2017
See more in CodingWithMe Docker
https://www.slideshare.net/larrycai/learn-docker-in-90-
minutes
What is kubernetes ?
 Kubernetes is an open source container
orchestration platform that helps manage
distributed, containerized applications at massive
scale.
 Kubernetes (k8s) comes from google
 kubernetes is a product platform to run container (Docker
is one type of container execution engine)
 k8s to container likes openstack to virtual machine.
 Key features (list partly):
 Auto-scaling
 Self-healing infrastructure
 Application lifecycle management
Learn kubernetes in 90 minutes5 10/2/2017
K8s Architecture
 Master and Work Node (multi or single)
 Container is executed in Work Node as default
Learn kubernetes in 90 minutes6 10/2/2017
Source: https://thenewstack.io/kubernetes-an-overview/
Exer 1: running first web service
 Let’s start one web server in k8s (cloud)
 Nginx is webserver like apache
 Start the service from official docker image
https://hub.docker.com/_/nginx/
 kubectl run nginx --image=nginx --port=80
 kubectl expose deployment nginx --type=NodePort
 Check what happens
 Check dashboard
 Access the nginx web service (click new port)
 kubectl get pods
 kubectl get pods –o wide # check node
 kubectl get all
 kubectl describe nodes
 docker ps # in different node
 Kill the pod ! And check again
 kubectl delete pods nginx-<xxx>
Learn kubernetes in 90 minutes7 10/2/2017
Overall for running service
Learn kubernetes in 90 minutes8 10/2/2017
Image source https://kubernetes.io/images/hellonode/image_13.
What is Pod ?
 A pod is a group of one or more containers (such as
Docker containers), the shared storage for those
containers
 Minimal element in kubernetes, run in one Node
 Command
kubectl run pods
kubectl get pods
kubectl delete pods
kubectl describe pods <pod>
kubectl exec -it <pod> -- bash
Learn kubernetes in 90 minutes9 10/2/2017
What is Deployment ?
 The Deployment is responsible for creating and
updating instances of your application (using
controller)
 Once the application instances are created, a Kubernetes
Deployment Controller continuously monitors those
instances
 Default is one instance and keep active
 Review the command
 kubectl run nginx --image=nginx --port=80 --replicas=1
 Download docker image nginx (from hub.docker.com) as internal port is
80
 Run docker image inside pod named “nginx-xxx” with 1 instance
 Deployment with name “nginx”
 If pod is deleted, deployment control create new one
Learn kubernetes in 90 minutes10 10/2/2017
What is Service ?
 Service is an abstraction which defines a logical set
of Pods and a policy by which to access them
 sometimes called a micro-service
 Service could be selected by label (skipped here)
Learn kubernetes in 90 minutes11 10/2/2017
 ServiceTypes defines how to
expose a Service, The
default is ClusterIP (internal)
 NodeType : expose port in
Kubernetes Master
kubectl expose deployment xxx –
type=NodePort
 Load Balancer (need support
in k8s infra)Image source: http://wso2.com/whitepapers/a-reference-architecture-for-deploying-wso2-middleware-on-
kubernetes/
Exer 2: Revisit pod, deployment and service
 Enter into container inside pod
 kubectl exec -it nginx-xxx -- bash
 Start pod only without deployment
 kubectl run nginx --image=nginx --port=80 --restart=Never
 kubectl run -i --tty busybox --image=busybox -- sh
 Expose to another service
 kubectl expose --name nginx2 deploy nginx
 kubectl get service
 curl <cluster ip>
 kubectl expose --name nginx3 deploy nginx --type=NodePort
 Clean up the deployment and service
 kubectl delete service xxx
 kubectl delete deployment xxx # check pod removed or not
Learn kubernetes in 90 minutes12 10/2/2017
Deployment more
 Deployment describe the desired state in a
Deployment object, and the Deployment controller
will change the actual state to the desired state at a
controlled rate for you
 Scale to wanted size (replicas)
 $ kubectl scale --replicas=2 deployment/nginx
$ kubectl scale --replicas=10 deployment/nginx
deployment "nginx" scaled
$ kubectl rollout status deployment/nginx
Waiting for rollout to finish: 2 of 10 updated replicas are available...
….
Waiting for rollout to finish: 9 of 10 updated replicas are available...
deployment "nginx" successfully rolled out
$ kubectl get pods
 Patch, Upgrade, Rollback ..
 Autoscale : grow when needed
Learn kubernetes in 90 minutes13 10/2/2017
One example: Canary release
 Kubernetes support to define own deploy strategy.
 User takes care of the service and what it wants to
expose
 The k8s platform do the rest
Learn kubernetes in 90 minutes14 10/2/2017
Source http://blog.kubernetes.io/2017/04/multi-stage-canary-deployments-with-kubernetes-in-the-cloud-onprem
Exer 3 : Deployment with Scale
 Show hostname ( image: larrycai/whoami )
kubectl run whoami --image=larrycai/whoami --port=5000
kubectl expose deploy whoami --type=NodePort
 Check the webpage
 Delete
kubectl delete pods whoami-xxxx
 Check the webpage (reload)
 Scale
kubectl scale --replicas=5 deployment/whoami
kubectl rollout status deployment/whoami
kubectl get pods
 Check the webpage (reload)
Learn kubernetes in 90 minutes15 10/2/2017
YAML descriptors
 Kubectl command line to deal with objects with
limited set of properties
 Difficult to maintain and version control
 YAML file is used to manage the object
kubectl create -f node-pod.yaml
kubectl create –f http://example.com/nginx-pod.yaml
 Get full descriptions of the object in YAML
kubectl get pods nginx2 -o yaml
Learn kubernetes in 90 minutes16 10/2/2017
Exer 4: deploy from YAML file
 Create whoami deploy yaml file (use pod as
reference)
kubectl get deploy whoami -o yaml
 Download and create
https://github.com/larrycai/codingwithme-
k8s/blob/master/whoami.yaml
curl -L -o whoami.yaml https://git.io/v7yd8
kubectl delete service whoami
kubectl delete deploy whoami
kubectl create -f whoami.yaml
 Change the ReplicaSet to 5 and run it again
kubectl apply -f whoami.yaml
Learn kubernetes in 90 minutes17 10/2/2017
Microservices in Kubernetes
 Kubernetes is a great tool for microservices clustering
and orchestration.
 It is still a quite new and under active development
 Kubernetes provides lots of features to be used to deploy
microservices
 Declare in YAML to deploy them
 Kubernetes official tutorial Guestbook
https://kubernetes.io/docs/tutorials/stateless-application/guestbook/
Learn kubernetes in 90 minutes18 10/2/2017
Image source: https://netmark.jp/wp-content/uploads/2014/12/guestbook-kubernetes.pn
Exer 5: Install Guestbook
 Deploy all in one
kubectl create -f https://git.io/v7ytR # shorturl to guestbook-all-in-one.yaml
 Check dashboards
 Expose service to NodePort
kubectl expose svc frontend --name f2 --type=NodePort
Learn kubernetes in 90 minutes19 10/2/2017
Summary
 Kubernetes: a platform to run container (docker)
 Concept:
 A Node is a worker machine in Kubernetes
 A Pod is the basic building block of Kubernetes, which
has a group of containers
 Deployment controls the state of the pod (scale, replicate)
 Service is an abstraction which defines a logical set of
Pods and a policy by which to access them. (micro
service ..)
 Kubernetes grows very fast, follow it.
Learn kubernetes in 90 minutes20 10/2/2017
Reference
 K8s doc: https://kubernetes.io/docs/home/
 Code: https://github.com/larrycai/codingwithme-k8s
 Minikube: https://github.com/kubernetes/minikube
 Blog: multi stage deployment with kubernetes:
http://blog.kubernetes.io/2017/04/multi-stage-canary-deployments-
with-kubernetes-in-the-cloud-onprem.html
 Video: The Illustrated Children's Guide to Kubernetes
 Sandbox online: http://labs.play-with-k8s.com/
 Book: Kubernetes in Action (Manning)
Learn kubernetes in 90 minutes21 10/2/2017
ChangeLog
 2017/07/23: first version
 2017/08/11: use k8s playground
 2017/10/2: fix dashboard url
Learn kubernetes in 90 minutes22 10/2/2017
Appendix
Learn kubernetes in 90 minutes23 10/2/2017
Minikube
 Minikube is all-in-one local kubernetes environment
 Works on Linux/Mac/Unix using virtual machine
Learn kubernetes in 90 minutes24 10/2/2017
Minikube VM
Kubernetes
(master + work
node)
VirtualBox
Windows
Environment Preparation (Win)
 Using unix env in windows (if not, install Git Windows)
 Minikube + Kubectl
 Minikube is local installation of kubernetes using VM
 Kubectl is the client of kubernetes
 Configure PATH (%USERPROFILE% => /c/Users/<id>)
 Download
 curl -L -o minikube.exe
https://storage.googleapis.com/minikube/releases/latest/minikube-windows-
amd64.exe
 curl -LO https://storage.googleapis.com/kubernetes-
release/release/v1.7.0/bin/windows/amd64/kubectl.exe
 mv minikube.exe kubectl.exe /c/Users/$LOGNAME/bin #$PATH
 Installation
 minikube start --kubernetes-version=v1.7.0
 kubectl version
 minikube config set kubernetes-version v1.7.0
 minikube stop
Learn kubernetes in 90 minutes25 10/2/2017
 Forward the local port to the pods without involving
service
 One simple way to get access to container
 kubectl port-forward nginx 8080:80
Access Pod: Port forwarding
Learn kubernetes in 90 minutes26 10/2/2017
curl
Local machine
(kubectl/windows)
kubectl
port-forward
service
Port 8080
Kubernetes inside VM (Virtualbox)
Pod
nginx
Port 80
Exer 2: simple pod to access
 Create the pod nginx2 without deployment
 kubectl run nginx2 --image=nginx --port=80 --restart=Never
 kubectl describe pods nginx2
 Check docker container
 docker ps
 Access it by using port-forwarding
 kubectl port-forward nginx2 8080:80
 Use browser to http://localhost:8080
 curl http://localhost:8080
 Dashboard
 minikube dashboard # check pods/nodes
 Delete
 kubectl delete pods nginx2
Learn kubernetes in 90 minutes27 10/2/2017

More Related Content

What's hot

Introduction to Cloud Data Center and Network Issues
Introduction to Cloud Data Center and Network IssuesIntroduction to Cloud Data Center and Network Issues
Introduction to Cloud Data Center and Network IssuesJason TC HOU (侯宗成)
 
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...Edureka!
 
Introduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesIntroduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesGary Silverman
 
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...NAVER CLOUD PLATFORMㅣ네이버 클라우드 플랫폼
 
AWS Security 솔루션 자세히 살펴보기 :: 신용녀 :: AWS Finance Seminar
AWS Security 솔루션 자세히 살펴보기 :: 신용녀 :: AWS Finance SeminarAWS Security 솔루션 자세히 살펴보기 :: 신용녀 :: AWS Finance Seminar
AWS Security 솔루션 자세히 살펴보기 :: 신용녀 :: AWS Finance SeminarAmazon Web Services Korea
 
Network Security and Access Control within AWS
Network Security and Access Control within AWSNetwork Security and Access Control within AWS
Network Security and Access Control within AWSAmazon Web Services
 
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집Amazon Web Services Korea
 
Introduction to Amazon Web Services (AWS)
Introduction to Amazon Web Services (AWS)Introduction to Amazon Web Services (AWS)
Introduction to Amazon Web Services (AWS)Garvit Anand
 
「これ危ない設定じゃないでしょうか」とヒアリングするための仕組み @AWS Summit Tokyo 2018
「これ危ない設定じゃないでしょうか」とヒアリングするための仕組み @AWS Summit Tokyo 2018「これ危ない設定じゃないでしょうか」とヒアリングするための仕組み @AWS Summit Tokyo 2018
「これ危ない設定じゃないでしょうか」とヒアリングするための仕組み @AWS Summit Tokyo 2018cyberagent
 
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...Amazon Web Services
 
AWS Black Belt Online Seminar 2017 Amazon Relational Database Service (Amazon...
AWS Black Belt Online Seminar 2017 Amazon Relational Database Service (Amazon...AWS Black Belt Online Seminar 2017 Amazon Relational Database Service (Amazon...
AWS Black Belt Online Seminar 2017 Amazon Relational Database Service (Amazon...Amazon Web Services Japan
 
Advanced VPC Design and New Capabilities for Amazon VPC (NET303) - AWS re:Inv...
Advanced VPC Design and New Capabilities for Amazon VPC (NET303) - AWS re:Inv...Advanced VPC Design and New Capabilities for Amazon VPC (NET303) - AWS re:Inv...
Advanced VPC Design and New Capabilities for Amazon VPC (NET303) - AWS re:Inv...Amazon Web Services
 
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要Amazon Web Services Japan
 
Aws Architecture Fundamentals
Aws Architecture FundamentalsAws Architecture Fundamentals
Aws Architecture Fundamentals2nd Watch
 

What's hot (20)

Introduction to Cloud Data Center and Network Issues
Introduction to Cloud Data Center and Network IssuesIntroduction to Cloud Data Center and Network Issues
Introduction to Cloud Data Center and Network Issues
 
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
 
Introduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesIntroduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best Practices
 
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
AWS Security 솔루션 자세히 살펴보기 :: 신용녀 :: AWS Finance Seminar
AWS Security 솔루션 자세히 살펴보기 :: 신용녀 :: AWS Finance SeminarAWS Security 솔루션 자세히 살펴보기 :: 신용녀 :: AWS Finance Seminar
AWS Security 솔루션 자세히 살펴보기 :: 신용녀 :: AWS Finance Seminar
 
Network Security and Access Control within AWS
Network Security and Access Control within AWSNetwork Security and Access Control within AWS
Network Security and Access Control within AWS
 
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
 
Amazon simple queue service
Amazon simple queue serviceAmazon simple queue service
Amazon simple queue service
 
AWS Cloud Security Fundamentals
AWS Cloud Security FundamentalsAWS Cloud Security Fundamentals
AWS Cloud Security Fundamentals
 
Introduction to Amazon Web Services (AWS)
Introduction to Amazon Web Services (AWS)Introduction to Amazon Web Services (AWS)
Introduction to Amazon Web Services (AWS)
 
「これ危ない設定じゃないでしょうか」とヒアリングするための仕組み @AWS Summit Tokyo 2018
「これ危ない設定じゃないでしょうか」とヒアリングするための仕組み @AWS Summit Tokyo 2018「これ危ない設定じゃないでしょうか」とヒアリングするための仕組み @AWS Summit Tokyo 2018
「これ危ない設定じゃないでしょうか」とヒアリングするための仕組み @AWS Summit Tokyo 2018
 
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
AWS 101
AWS 101AWS 101
AWS 101
 
AWS Black Belt Online Seminar 2017 Amazon Relational Database Service (Amazon...
AWS Black Belt Online Seminar 2017 Amazon Relational Database Service (Amazon...AWS Black Belt Online Seminar 2017 Amazon Relational Database Service (Amazon...
AWS Black Belt Online Seminar 2017 Amazon Relational Database Service (Amazon...
 
Advanced VPC Design and New Capabilities for Amazon VPC (NET303) - AWS re:Inv...
Advanced VPC Design and New Capabilities for Amazon VPC (NET303) - AWS re:Inv...Advanced VPC Design and New Capabilities for Amazon VPC (NET303) - AWS re:Inv...
Advanced VPC Design and New Capabilities for Amazon VPC (NET303) - AWS re:Inv...
 
Aws ppt
Aws pptAws ppt
Aws ppt
 
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
 
Aws Architecture Fundamentals
Aws Architecture FundamentalsAws Architecture Fundamentals
Aws Architecture Fundamentals
 

Similar to Learn kubernetes in 90 minutes

Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKel Cecil
 
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 LISA17Ryan Jarvinen
 
5 Painless Demos to Get You Started with Kubernetes
5 Painless Demos to Get You Started with Kubernetes5 Painless Demos to Get You Started with Kubernetes
5 Painless Demos to Get You Started with KubernetesAmartus
 
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
 
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
 
Run K8s on Local Environment
Run K8s on Local EnvironmentRun K8s on Local Environment
Run K8s on Local EnvironmentGanesh Pol
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionEric Gustafson
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibilityDocker, Inc.
 
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
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installationAhmed Mekawy
 
Container Deployment and Management with kubernetes
Container Deployment and Management with kubernetesContainer Deployment and Management with kubernetes
Container Deployment and Management with kubernetessiuyin
 
Deploy the blockchain network using kubernetes ap is on google cloud
Deploy the blockchain network using kubernetes ap is on google cloudDeploy the blockchain network using kubernetes ap is on google cloud
Deploy the blockchain network using kubernetes ap is on google cloudAjeet Singh
 
Kubernetes cheetsheet.pdf
Kubernetes cheetsheet.pdfKubernetes cheetsheet.pdf
Kubernetes cheetsheet.pdfEswar378637
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingPiotr Perzyna
 
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
 
Mastering Kubernetes - Basics and Advanced Concepts using Example Project
Mastering Kubernetes - Basics and Advanced Concepts using Example ProjectMastering Kubernetes - Basics and Advanced Concepts using Example Project
Mastering Kubernetes - Basics and Advanced Concepts using Example Projectwajrcs
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionStefan Schimanski
 
Social Connections 14 - Kubernetes Basics for Connections Admins
Social Connections 14 - Kubernetes Basics for Connections AdminsSocial Connections 14 - Kubernetes Basics for Connections Admins
Social Connections 14 - Kubernetes Basics for Connections Adminspanagenda
 
Kubernetes Basics for Connections Admins
Kubernetes Basics for Connections AdminsKubernetes Basics for Connections Admins
Kubernetes Basics for Connections AdminsLetsConnect
 

Similar to Learn kubernetes in 90 minutes (20)

Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of Containers
 
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
 
5 Painless Demos to Get You Started with Kubernetes
5 Painless Demos to Get You Started with Kubernetes5 Painless Demos to Get You Started with Kubernetes
5 Painless Demos to Get You Started with Kubernetes
 
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...
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
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
 
Run K8s on Local Environment
Run K8s on Local EnvironmentRun K8s on Local Environment
Run K8s on Local Environment
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
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)
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
 
Container Deployment and Management with kubernetes
Container Deployment and Management with kubernetesContainer Deployment and Management with kubernetes
Container Deployment and Management with kubernetes
 
Deploy the blockchain network using kubernetes ap is on google cloud
Deploy the blockchain network using kubernetes ap is on google cloudDeploy the blockchain network using kubernetes ap is on google cloud
Deploy the blockchain network using kubernetes ap is on google cloud
 
Kubernetes cheetsheet.pdf
Kubernetes cheetsheet.pdfKubernetes cheetsheet.pdf
Kubernetes cheetsheet.pdf
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
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
 
Mastering Kubernetes - Basics and Advanced Concepts using Example Project
Mastering Kubernetes - Basics and Advanced Concepts using Example ProjectMastering Kubernetes - Basics and Advanced Concepts using Example Project
Mastering Kubernetes - Basics and Advanced Concepts using Example Project
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
Social Connections 14 - Kubernetes Basics for Connections Admins
Social Connections 14 - Kubernetes Basics for Connections AdminsSocial Connections 14 - Kubernetes Basics for Connections Admins
Social Connections 14 - Kubernetes Basics for Connections Admins
 
Kubernetes Basics for Connections Admins
Kubernetes Basics for Connections AdminsKubernetes Basics for Connections Admins
Kubernetes Basics for Connections Admins
 

More from Larry Cai

Learn jobDSL for Jenkins
Learn jobDSL for JenkinsLearn jobDSL for Jenkins
Learn jobDSL for JenkinsLarry Cai
 
Learn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90minsLearn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90minsLarry Cai
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90minsLarry Cai
 
Learn ELK in docker
Learn ELK in dockerLearn ELK in docker
Learn ELK in dockerLarry Cai
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer TalkLarry Cai
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90minsLarry Cai
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using dockerLarry Cai
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90minsLarry Cai
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
 
Learn Dashing Widget in 90 minutes
Learn Dashing Widget in 90 minutesLearn Dashing Widget in 90 minutes
Learn Dashing Widget in 90 minutesLarry Cai
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with PythonLarry Cai
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90minsLarry Cai
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Lead changes in software development
Lead changes in software developmentLead changes in software development
Lead changes in software developmentLarry Cai
 
Python in 90mins
Python in 90minsPython in 90mins
Python in 90minsLarry Cai
 
Practical way to experience of Specification by Example
Practical way to experience of Specification by ExamplePractical way to experience of Specification by Example
Practical way to experience of Specification by ExampleLarry Cai
 
Experience from specification_by_examples
Experience from specification_by_examplesExperience from specification_by_examples
Experience from specification_by_examplesLarry Cai
 
Write book in markdown
Write book in markdownWrite book in markdown
Write book in markdownLarry Cai
 
Continuous Integration Introduction
Continuous Integration IntroductionContinuous Integration Introduction
Continuous Integration IntroductionLarry Cai
 
Agile & ALM tools
Agile & ALM toolsAgile & ALM tools
Agile & ALM toolsLarry Cai
 

More from Larry Cai (20)

Learn jobDSL for Jenkins
Learn jobDSL for JenkinsLearn jobDSL for Jenkins
Learn jobDSL for Jenkins
 
Learn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90minsLearn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90mins
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Learn ELK in docker
Learn ELK in dockerLearn ELK in docker
Learn ELK in docker
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer Talk
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90mins
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Learn Dashing Widget in 90 minutes
Learn Dashing Widget in 90 minutesLearn Dashing Widget in 90 minutes
Learn Dashing Widget in 90 minutes
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90mins
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Lead changes in software development
Lead changes in software developmentLead changes in software development
Lead changes in software development
 
Python in 90mins
Python in 90minsPython in 90mins
Python in 90mins
 
Practical way to experience of Specification by Example
Practical way to experience of Specification by ExamplePractical way to experience of Specification by Example
Practical way to experience of Specification by Example
 
Experience from specification_by_examples
Experience from specification_by_examplesExperience from specification_by_examples
Experience from specification_by_examples
 
Write book in markdown
Write book in markdownWrite book in markdown
Write book in markdown
 
Continuous Integration Introduction
Continuous Integration IntroductionContinuous Integration Introduction
Continuous Integration Introduction
 
Agile & ALM tools
Agile & ALM toolsAgile & ALM tools
Agile & ALM tools
 

Recently uploaded

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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.pdfsudhanshuwaghmare1
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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 SavingEdi Saputra
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

Learn kubernetes in 90 minutes

  • 1. Learn Kubernetes in 90 minutes Larry Cai <larry.caiyu@gmail.com>
  • 2. Agenda  Introduction  Exercise 1: First web service in kubernetes  Exercise 2: Revisit pod, deployment and service  Exercise 3: Controller – Deployment (scale)  Exercise 4: Deploy with YAML file  Exercise 5: install Microservice: Guestbook  Reference Learn kubernetes in 90 minutes2 10/2/2017 Minikube environment setup is in appendix
  • 3. Environment using k8s playground  Three nodes in http://labs.play-with-k8s.com (master + 2 workers)  Node 1 (master node): follow guideline step 1/2/3 If dashboard doesn’t work, use https://git.io/vdc52 instead of https://git.io/kube-dashboard  Node 2/Node 3 kubeadm join –token … # check the console log in Node 1  Node 1: kubectl get nodes  Click the port to open dashboard Learn kubernetes in 90 minutes3 10/2/2017 Try to use Ctrl-Ins & Shift-Ins for copy/paste
  • 4. Background – Container/Docker  Container technology offers an alternative method for virtualization in cloud, with more efficiency & fast  New era for packaging and delivering software  Docker is one execution engine for container  docker pull nginx  docker run --name web -d -p 8080:80 nginx  docker exec -it web bash  docker build -t larrycai/whoami . Learn kubernetes in 90 minutes4 10/2/2017 See more in CodingWithMe Docker https://www.slideshare.net/larrycai/learn-docker-in-90- minutes
  • 5. What is kubernetes ?  Kubernetes is an open source container orchestration platform that helps manage distributed, containerized applications at massive scale.  Kubernetes (k8s) comes from google  kubernetes is a product platform to run container (Docker is one type of container execution engine)  k8s to container likes openstack to virtual machine.  Key features (list partly):  Auto-scaling  Self-healing infrastructure  Application lifecycle management Learn kubernetes in 90 minutes5 10/2/2017
  • 6. K8s Architecture  Master and Work Node (multi or single)  Container is executed in Work Node as default Learn kubernetes in 90 minutes6 10/2/2017 Source: https://thenewstack.io/kubernetes-an-overview/
  • 7. Exer 1: running first web service  Let’s start one web server in k8s (cloud)  Nginx is webserver like apache  Start the service from official docker image https://hub.docker.com/_/nginx/  kubectl run nginx --image=nginx --port=80  kubectl expose deployment nginx --type=NodePort  Check what happens  Check dashboard  Access the nginx web service (click new port)  kubectl get pods  kubectl get pods –o wide # check node  kubectl get all  kubectl describe nodes  docker ps # in different node  Kill the pod ! And check again  kubectl delete pods nginx-<xxx> Learn kubernetes in 90 minutes7 10/2/2017
  • 8. Overall for running service Learn kubernetes in 90 minutes8 10/2/2017 Image source https://kubernetes.io/images/hellonode/image_13.
  • 9. What is Pod ?  A pod is a group of one or more containers (such as Docker containers), the shared storage for those containers  Minimal element in kubernetes, run in one Node  Command kubectl run pods kubectl get pods kubectl delete pods kubectl describe pods <pod> kubectl exec -it <pod> -- bash Learn kubernetes in 90 minutes9 10/2/2017
  • 10. What is Deployment ?  The Deployment is responsible for creating and updating instances of your application (using controller)  Once the application instances are created, a Kubernetes Deployment Controller continuously monitors those instances  Default is one instance and keep active  Review the command  kubectl run nginx --image=nginx --port=80 --replicas=1  Download docker image nginx (from hub.docker.com) as internal port is 80  Run docker image inside pod named “nginx-xxx” with 1 instance  Deployment with name “nginx”  If pod is deleted, deployment control create new one Learn kubernetes in 90 minutes10 10/2/2017
  • 11. What is Service ?  Service is an abstraction which defines a logical set of Pods and a policy by which to access them  sometimes called a micro-service  Service could be selected by label (skipped here) Learn kubernetes in 90 minutes11 10/2/2017  ServiceTypes defines how to expose a Service, The default is ClusterIP (internal)  NodeType : expose port in Kubernetes Master kubectl expose deployment xxx – type=NodePort  Load Balancer (need support in k8s infra)Image source: http://wso2.com/whitepapers/a-reference-architecture-for-deploying-wso2-middleware-on- kubernetes/
  • 12. Exer 2: Revisit pod, deployment and service  Enter into container inside pod  kubectl exec -it nginx-xxx -- bash  Start pod only without deployment  kubectl run nginx --image=nginx --port=80 --restart=Never  kubectl run -i --tty busybox --image=busybox -- sh  Expose to another service  kubectl expose --name nginx2 deploy nginx  kubectl get service  curl <cluster ip>  kubectl expose --name nginx3 deploy nginx --type=NodePort  Clean up the deployment and service  kubectl delete service xxx  kubectl delete deployment xxx # check pod removed or not Learn kubernetes in 90 minutes12 10/2/2017
  • 13. Deployment more  Deployment describe the desired state in a Deployment object, and the Deployment controller will change the actual state to the desired state at a controlled rate for you  Scale to wanted size (replicas)  $ kubectl scale --replicas=2 deployment/nginx $ kubectl scale --replicas=10 deployment/nginx deployment "nginx" scaled $ kubectl rollout status deployment/nginx Waiting for rollout to finish: 2 of 10 updated replicas are available... …. Waiting for rollout to finish: 9 of 10 updated replicas are available... deployment "nginx" successfully rolled out $ kubectl get pods  Patch, Upgrade, Rollback ..  Autoscale : grow when needed Learn kubernetes in 90 minutes13 10/2/2017
  • 14. One example: Canary release  Kubernetes support to define own deploy strategy.  User takes care of the service and what it wants to expose  The k8s platform do the rest Learn kubernetes in 90 minutes14 10/2/2017 Source http://blog.kubernetes.io/2017/04/multi-stage-canary-deployments-with-kubernetes-in-the-cloud-onprem
  • 15. Exer 3 : Deployment with Scale  Show hostname ( image: larrycai/whoami ) kubectl run whoami --image=larrycai/whoami --port=5000 kubectl expose deploy whoami --type=NodePort  Check the webpage  Delete kubectl delete pods whoami-xxxx  Check the webpage (reload)  Scale kubectl scale --replicas=5 deployment/whoami kubectl rollout status deployment/whoami kubectl get pods  Check the webpage (reload) Learn kubernetes in 90 minutes15 10/2/2017
  • 16. YAML descriptors  Kubectl command line to deal with objects with limited set of properties  Difficult to maintain and version control  YAML file is used to manage the object kubectl create -f node-pod.yaml kubectl create –f http://example.com/nginx-pod.yaml  Get full descriptions of the object in YAML kubectl get pods nginx2 -o yaml Learn kubernetes in 90 minutes16 10/2/2017
  • 17. Exer 4: deploy from YAML file  Create whoami deploy yaml file (use pod as reference) kubectl get deploy whoami -o yaml  Download and create https://github.com/larrycai/codingwithme- k8s/blob/master/whoami.yaml curl -L -o whoami.yaml https://git.io/v7yd8 kubectl delete service whoami kubectl delete deploy whoami kubectl create -f whoami.yaml  Change the ReplicaSet to 5 and run it again kubectl apply -f whoami.yaml Learn kubernetes in 90 minutes17 10/2/2017
  • 18. Microservices in Kubernetes  Kubernetes is a great tool for microservices clustering and orchestration.  It is still a quite new and under active development  Kubernetes provides lots of features to be used to deploy microservices  Declare in YAML to deploy them  Kubernetes official tutorial Guestbook https://kubernetes.io/docs/tutorials/stateless-application/guestbook/ Learn kubernetes in 90 minutes18 10/2/2017 Image source: https://netmark.jp/wp-content/uploads/2014/12/guestbook-kubernetes.pn
  • 19. Exer 5: Install Guestbook  Deploy all in one kubectl create -f https://git.io/v7ytR # shorturl to guestbook-all-in-one.yaml  Check dashboards  Expose service to NodePort kubectl expose svc frontend --name f2 --type=NodePort Learn kubernetes in 90 minutes19 10/2/2017
  • 20. Summary  Kubernetes: a platform to run container (docker)  Concept:  A Node is a worker machine in Kubernetes  A Pod is the basic building block of Kubernetes, which has a group of containers  Deployment controls the state of the pod (scale, replicate)  Service is an abstraction which defines a logical set of Pods and a policy by which to access them. (micro service ..)  Kubernetes grows very fast, follow it. Learn kubernetes in 90 minutes20 10/2/2017
  • 21. Reference  K8s doc: https://kubernetes.io/docs/home/  Code: https://github.com/larrycai/codingwithme-k8s  Minikube: https://github.com/kubernetes/minikube  Blog: multi stage deployment with kubernetes: http://blog.kubernetes.io/2017/04/multi-stage-canary-deployments- with-kubernetes-in-the-cloud-onprem.html  Video: The Illustrated Children's Guide to Kubernetes  Sandbox online: http://labs.play-with-k8s.com/  Book: Kubernetes in Action (Manning) Learn kubernetes in 90 minutes21 10/2/2017
  • 22. ChangeLog  2017/07/23: first version  2017/08/11: use k8s playground  2017/10/2: fix dashboard url Learn kubernetes in 90 minutes22 10/2/2017
  • 23. Appendix Learn kubernetes in 90 minutes23 10/2/2017
  • 24. Minikube  Minikube is all-in-one local kubernetes environment  Works on Linux/Mac/Unix using virtual machine Learn kubernetes in 90 minutes24 10/2/2017 Minikube VM Kubernetes (master + work node) VirtualBox Windows
  • 25. Environment Preparation (Win)  Using unix env in windows (if not, install Git Windows)  Minikube + Kubectl  Minikube is local installation of kubernetes using VM  Kubectl is the client of kubernetes  Configure PATH (%USERPROFILE% => /c/Users/<id>)  Download  curl -L -o minikube.exe https://storage.googleapis.com/minikube/releases/latest/minikube-windows- amd64.exe  curl -LO https://storage.googleapis.com/kubernetes- release/release/v1.7.0/bin/windows/amd64/kubectl.exe  mv minikube.exe kubectl.exe /c/Users/$LOGNAME/bin #$PATH  Installation  minikube start --kubernetes-version=v1.7.0  kubectl version  minikube config set kubernetes-version v1.7.0  minikube stop Learn kubernetes in 90 minutes25 10/2/2017
  • 26.  Forward the local port to the pods without involving service  One simple way to get access to container  kubectl port-forward nginx 8080:80 Access Pod: Port forwarding Learn kubernetes in 90 minutes26 10/2/2017 curl Local machine (kubectl/windows) kubectl port-forward service Port 8080 Kubernetes inside VM (Virtualbox) Pod nginx Port 80
  • 27. Exer 2: simple pod to access  Create the pod nginx2 without deployment  kubectl run nginx2 --image=nginx --port=80 --restart=Never  kubectl describe pods nginx2  Check docker container  docker ps  Access it by using port-forwarding  kubectl port-forward nginx2 8080:80  Use browser to http://localhost:8080  curl http://localhost:8080  Dashboard  minikube dashboard # check pods/nodes  Delete  kubectl delete pods nginx2 Learn kubernetes in 90 minutes27 10/2/2017