SlideShare una empresa de Scribd logo
1 de 17
5 Painless Demos to
Get You Started with
Kubernetes
Jakub Nowakowski
Automation | Test Lead @ Amartus
jnowakowski8
What’s On
1. A short story of containers
2. Containers orchestration
3. Why Kubernetes?
4. Cluster components
5. Pod >> Deployment >> Service
6. Networking
7. Cluster bootstrapping
8. Time for some action!
A Short Story of Containers
• Packages with application, dependencies, binaries
and configurations
• Consistent on all environments
• Lightweight and isolated
• Infrastructure-agnostic
• Way to handle microservices
Containers Orchestration
Photo by Axel Ahoi on Unsplash
Kubernetes
Kubernetes (or k8s) in Greek κυβερνήτης means helmsman. Hence the logo!
History:
• Created by Google (Borg) ~15 years ago
• Open sourced in 2014
• Donated to Cloud Native Computing Foundation (2015)
• Container-centric management environment.
• Automates deployment, scaling, and operations of application containers.
• Orchestrates computing, networking, and storage infrastructure.
• Infrastructure- and vendor-agnostic (physical/virtual machines, bare metal/cloud/hybrid).
Cluster Components
Master
Node
Pod >> Deployment >> Service
source: kubernetes.io
Master
Nodes
Networking
Pod-to-pod (need configuration)
Container-to-container (local)
External-to-pod (k8s services),
i.e.:
• ClusterIp
• NodePort
Requirements:
• no ports brokering
• no NAT
Solutions:
• routing
• overlay network (SDN) (Flannel, Calico,
Weave Net, ...)
Cluster Bootstrapping
minikube – the easiest way to start a local, single-node cluster in a VM
$ minikube start
kubeadm – configure k8s components with single command on each machine
node1:~$ kubadm init
node2:~$ kubeadm join 
-–token <TOKEN> 
<MASTER_IP>:6443 
--discovery-token-ca-cert-hash sha256:<HASH>
and many more...
Picking the Right Solution (kubernetes.io)
11 2-Mar-18
Photo by Mitchell Orr on Unsplash
Demo 0: Minikube
Quickly bootstrap a k8s cluster with Minikube.
Resources:
kubernetes.io: Install Minikube
Commands:
$ minikube start
$ minikube status
$ kubectl cluster-info
$ kubectl get nodes
$ minikube dashboard
$ minikube stop
Demo 1: Pod, Deployment, Service
Use kubectl CLI
Create a deployment and expose it outside the cluster as a NodePort service.
Perform operations with kubectl CLI.
Commands:
$ kubectl get pods,deployments,services
$ kubectl create deployment --image=<IMAGE> <NAME>
$ kubectl expose deployment <NAME> --type=NodePort --port=<PORT>
Demo 2: Scaling and updates
YAML manifests
Create a deployment and a service with an YAML manifest file.
Scale it and update an image of the container.
Commands:
$ kubectl apply -f <FILE>
$ kubectl scale deployment <NAME> --replicas=<NUMBER>
$ kubectl set image deployment/<NAME> <CONTAINER>=<IMAGE>
Demo 3: Multiple containers in a pod
Create a deployment with two containers in one pod.
Scale it and expose one of the containers.
Commands:
$ kubectl apply -f <FILE>
Demo 4: Multiple pods
Create three deployments with different scaling and connections between them.
Expose frontend to outside of the cluster.
Commands:
$ kubectl apply -f <FILE>
Confidential | Copyright@2018 Amartus
info@amartus.com @amartus_com company/amartus
www.amartus.com
Questions?

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes
 
OSDN: Serverless technologies with Kubernetes
OSDN: Serverless technologies with Kubernetes OSDN: Serverless technologies with Kubernetes
OSDN: Serverless technologies with Kubernetes
 
What is serveless?
What is serveless? What is serveless?
What is serveless?
 
KubeCon CloudNativeCon 2016 Seattle - a report
KubeCon CloudNativeCon 2016 Seattle - a reportKubeCon CloudNativeCon 2016 Seattle - a report
KubeCon CloudNativeCon 2016 Seattle - a report
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
OpenStack with OpenDaylight
OpenStack with OpenDaylightOpenStack with OpenDaylight
OpenStack with OpenDaylight
 
Tectonic Summit 2016: The Origins of Kubernetes
Tectonic Summit 2016: The Origins of KubernetesTectonic Summit 2016: The Origins of Kubernetes
Tectonic Summit 2016: The Origins of Kubernetes
 
Kubernetes kubecon-roundup
Kubernetes kubecon-roundupKubernetes kubecon-roundup
Kubernetes kubecon-roundup
 
Kubernetes Hands-On Guide
Kubernetes Hands-On GuideKubernetes Hands-On Guide
Kubernetes Hands-On Guide
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Building Clustered Applications with Kubernetes and Docker
Building Clustered Applications with Kubernetes and DockerBuilding Clustered Applications with Kubernetes and Docker
Building Clustered Applications with Kubernetes and Docker
 
Rex gke-clustree
Rex gke-clustreeRex gke-clustree
Rex gke-clustree
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Kubernetes 101 Workshop
Kubernetes 101 WorkshopKubernetes 101 Workshop
Kubernetes 101 Workshop
 
Kubernetes on CloudStack with coreOS
Kubernetes on CloudStack with coreOSKubernetes on CloudStack with coreOS
Kubernetes on CloudStack with coreOS
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Moving to Kubernetes - Tales from SoundCloud
Moving to Kubernetes - Tales from SoundCloudMoving to Kubernetes - Tales from SoundCloud
Moving to Kubernetes - Tales from SoundCloud
 
Building Big Architectures
Building Big ArchitecturesBuilding Big Architectures
Building Big Architectures
 

Similar a 5 Painless Demos to Get You Started with Kubernetes

DevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationDevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes Integration
Hank Preston
 

Similar a 5 Painless Demos to Get You Started with Kubernetes (20)

Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes Selenium Grid
Kubernetes Selenium GridKubernetes Selenium Grid
Kubernetes Selenium Grid
 
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
 
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
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
 
How to integrate Kubernetes in OpenStack: You need to know these project
How to integrate Kubernetes in OpenStack: You need to know these projectHow to integrate Kubernetes in OpenStack: You need to know these project
How to integrate Kubernetes in OpenStack: You need to know these project
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
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)
 
DevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes IntegrationDevNetCreate - ACI and Kubernetes Integration
DevNetCreate - ACI and Kubernetes Integration
 
Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of Containers
 
Dockerizing OpenStack for High Availability
Dockerizing OpenStack for High AvailabilityDockerizing OpenStack for High Availability
Dockerizing OpenStack for High Availability
 
Run K8s on Local Environment
Run K8s on Local EnvironmentRun K8s on Local Environment
Run K8s on Local Environment
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
 
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 workshop -_the_basics
Kubernetes workshop -_the_basicsKubernetes workshop -_the_basics
Kubernetes workshop -_the_basics
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
Moving a Monolith to Kubernetes
Moving a Monolith to KubernetesMoving a Monolith to Kubernetes
Moving a Monolith to Kubernetes
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

5 Painless Demos to Get You Started with Kubernetes

  • 1. 5 Painless Demos to Get You Started with Kubernetes Jakub Nowakowski Automation | Test Lead @ Amartus jnowakowski8
  • 2. What’s On 1. A short story of containers 2. Containers orchestration 3. Why Kubernetes? 4. Cluster components 5. Pod >> Deployment >> Service 6. Networking 7. Cluster bootstrapping 8. Time for some action!
  • 3. A Short Story of Containers • Packages with application, dependencies, binaries and configurations • Consistent on all environments • Lightweight and isolated • Infrastructure-agnostic • Way to handle microservices
  • 5. Photo by Axel Ahoi on Unsplash
  • 6. Kubernetes Kubernetes (or k8s) in Greek κυβερνήτης means helmsman. Hence the logo! History: • Created by Google (Borg) ~15 years ago • Open sourced in 2014 • Donated to Cloud Native Computing Foundation (2015) • Container-centric management environment. • Automates deployment, scaling, and operations of application containers. • Orchestrates computing, networking, and storage infrastructure. • Infrastructure- and vendor-agnostic (physical/virtual machines, bare metal/cloud/hybrid).
  • 8. Pod >> Deployment >> Service source: kubernetes.io Master Nodes
  • 9. Networking Pod-to-pod (need configuration) Container-to-container (local) External-to-pod (k8s services), i.e.: • ClusterIp • NodePort Requirements: • no ports brokering • no NAT Solutions: • routing • overlay network (SDN) (Flannel, Calico, Weave Net, ...)
  • 10. Cluster Bootstrapping minikube – the easiest way to start a local, single-node cluster in a VM $ minikube start kubeadm – configure k8s components with single command on each machine node1:~$ kubadm init node2:~$ kubeadm join -–token <TOKEN> <MASTER_IP>:6443 --discovery-token-ca-cert-hash sha256:<HASH> and many more... Picking the Right Solution (kubernetes.io)
  • 11. 11 2-Mar-18 Photo by Mitchell Orr on Unsplash
  • 12. Demo 0: Minikube Quickly bootstrap a k8s cluster with Minikube. Resources: kubernetes.io: Install Minikube Commands: $ minikube start $ minikube status $ kubectl cluster-info $ kubectl get nodes $ minikube dashboard $ minikube stop
  • 13. Demo 1: Pod, Deployment, Service Use kubectl CLI Create a deployment and expose it outside the cluster as a NodePort service. Perform operations with kubectl CLI. Commands: $ kubectl get pods,deployments,services $ kubectl create deployment --image=<IMAGE> <NAME> $ kubectl expose deployment <NAME> --type=NodePort --port=<PORT>
  • 14. Demo 2: Scaling and updates YAML manifests Create a deployment and a service with an YAML manifest file. Scale it and update an image of the container. Commands: $ kubectl apply -f <FILE> $ kubectl scale deployment <NAME> --replicas=<NUMBER> $ kubectl set image deployment/<NAME> <CONTAINER>=<IMAGE>
  • 15. Demo 3: Multiple containers in a pod Create a deployment with two containers in one pod. Scale it and expose one of the containers. Commands: $ kubectl apply -f <FILE>
  • 16. Demo 4: Multiple pods Create three deployments with different scaling and connections between them. Expose frontend to outside of the cluster. Commands: $ kubectl apply -f <FILE>
  • 17. Confidential | Copyright@2018 Amartus info@amartus.com @amartus_com company/amartus www.amartus.com Questions?

Notas del editor

  1. Container = A package that contains everything the software needs to run (application binaries, system libraries, dependencies, configurations). Allow applications to be deployed easily and consistently regardless of the target environment (developer laptop, testing environment or a production data center). Containers are lightweight (no additional OS needed). Processes running in separate containers are isolated from one another. Many containers can run on a single machine. Containers can be installed on any compute unit, regardless of hardware, OS, or software. They run on premise, in the cloud or in hybrid solutions. Containerized modules provide a great way to implement and run applications developed with microservices architecture (applications developed as a set of small components, each running its own processes and usually communicating via HTTP API calls).
  2. Containers orchestration is the automated process of: Deploying multiple containers and rescheduling them in case of failure. Integrating containers and exposing services to be accessible externally. Managing and configuring running containers, handling rolling updates. Scaling in and scaling out containers depending on traffic.
  3. Although there are different container orchestrators available, Kubernetes is by far the most popular and fastest-growing one. It’s a highly-extensible solution for fully-automated containerized applications clusters management. Let’s meet our hero.
  4. Kubernetes – helmsman in Greek. Created by Google about 15 years ago. Developed and used internally over the time. In 2014, open sourced and one year later donated to the community (which is pretty impressive: > 2000 contributors, >60 000 commits, one of most popular projects on github). Kubernetes provides a container-centric management environment to automate operations on applications delivered as containers. It orchestrates computing, networking, and storage infrastructure. It’s an infrastructure- and provider-agnostic solution, which can be run on physical or virtual machines, bare metal servers located in a company, in the cloud, or on hybrid solutions.
  5. A Cluster is a group of one or more virtual or physical machines that provide resources to run applications. There are two types of machines in the cluster: - Master (provides the control plane for the cluster) - makes global decisions about the cluster (for example, scheduling) and detects and responds to cluster events (e.g., starting a new application instance when another is down). - Node (Worker) - provides runtime environment for applications on designated machines. ------------------------------------------ Master components: - apiserver – exposes Kubernetes API to provide front-end for Kubernetes configuration - etcd – key value store for all cluster data - scheduler – assigns pods to nodes - controller manager – monitors the current state of the cluster and performs operations to meet the desired state Node components: - kubelet – agent running on each node; makes sure that containers are running - kube-proxy – maintains network rules on the host and performs connection forwarding - container runtime – software responsible for running containers (e.g., Docker or rkt)
  6. POD A Pod is a Kubernetes abstraction that represents a group of one or more application containers, and some shared resources for those containers. Those resources include: Shared storage, as Volumes Networking, as a unique cluster IP address Information about how to run each container, such as the container image version or specific ports to use DEPLOYMENT Deployment Controller is responsible for running and monitoring pods,. For instance, if a node holding the pod is going down or is deleted, the controller will boot a new instance to replace it. SERVICE If we have multiple pods running, how do we ensure that there is a single endpoint to access them? A service takes care of that. It provides a unified way to route traffic to a cluster and eventually to a list of pods.
  7. There are three challenges in network connectivity across the cluster: Container-to-container communication – containers within the same pod share IP address and localhost, so they can easily communicate with each other within the same pod. Pod-to-pod networking – that's the main challenge, as this connection is not configured out-of-the-box in Kubernetes, and requires some additional planning and configuration Pods should communicate without port forwarding or mapping, and should reach one another without NAT. One solution is to configure static routing in the network topology with appropriate paths to reach pods. Another solution is an Overlay Network, which can set up a virtual network over the physical one to handle communication that will tunnel the traffic between pods. Packets going from a pod will be encapsulated on the node and tunneled to the destination node. There is a number of plugins available to support this solutions. External-to-pod communciation is handled by Kubernetes Services (e.g., ClusterIp – exposing the service to cluster only, NodePort – exposing the service to external of the cluster).
  8. Minikube: The recommended method for creating a local, single-node Kubernetes cluster for development and testing. Setup is completely automated and doesn’t require a cloud provider account. Kubeadm: Expects the user to bring a machine to execute on; type doesn’t matter (laptop, VM, physical/cloud server or Raspberry Pi).
  9. Demos are shared on GitHub: https://github.com/nkuba/k8s-intro-demos
  10. Please visit: https://github.com/nkuba/k8s-intro-demos/tree/master/demo0
  11. Please visit: https://github.com/nkuba/k8s-intro-demos/tree/master/demo1
  12. Please visit: https://github.com/nkuba/k8s-intro-demos/tree/master/demo2
  13. Please visit: https://github.com/nkuba/k8s-intro-demos/tree/master/demo3
  14. Please visit: https://github.com/nkuba/k8s-intro-demos/tree/master/demo4
  15. Questions? Enquiries? Help needed? Get in touch with us at info@amartus.com Follow us at @amartus_com | www.linkedin.com/company/Amartus/ Are you interested in becoming a certified Kubernetes Admin? I’ve been there, check my Medium post for some tips: https://medium.com/@jnowakowski/k8s-admin-exam-tips-22961241ba7d