SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Kubernetes
Introduction
Advanced Technology Group (ATG)
for Open Source & Cloud
August 2016
What is
Kubernetes?
2
Κυβερνήτης — Greek:
A nautical term meaning “helmsman” or “pilot”
“K8s”
Kubernetes
“Open Source Container Cluster Manager”
• Google — Architect and creator.
• Borg — Google’s internal cluster management software.
 Kubernetes – complete rewrite, (in Go).
• Google partnered with Linux Foundation to form:
 Cloud Native Computing Foundation (CNCF)
 offered Kubernetes as a seed technology
3
Kubernetes History
2013 2014 2015 2016
Apr 2015
Tectonic formed
(commercial support)
Apr 2015
The Borg Paper
is published
Sep 2014
Kubernetes
announced in
Wired magazine
Jun 2014
Kubernetes
1st GitHub
commit
Mar 2013
Docker initial
release
Aug 2014
CoreOS introduces
Flannel networking
Oct 2013
CoreOS initial
release
4
2008 …2006
2006
Google starts work on
“Process Containers”
(renamed “cgroups”)
Jan 2008
cgroups merged
into Linux (2.6.24)
2007
July 2015
CNCF Formed,
K8s v1.0 released,
donated to CNCF
Borg development inside Google
Kubernetes Tech Specs
Features
• μService Architecture
• Automatic Workload Placement (efficient)
• Auto Remediating (self healing)
• Horizontal Scaling
• Load Balanced
• Declarative Deployment
• Service Discovery included
• A/B & Canary Deployments (testing)
Surrounding Ecosystem
 Docker – the container “engine” on each host.
 etcd (from CoreOS) – distributed K/V store.
 CoreOS – the platform.
 Flannel – overlay networking.
 Hosted Service: Google Container Platform
 GKE is the abbreviation.
5
6
Network
Client
μService Programming Model — Cloud Native
proxy
μS
…
μS
μS
proxy
μS
…
μS
μS
proxy
μS
…
μS
μS
proxy
μS
…
μS
μS
proxy
μS
…
μS
μS
proxy
μS
…
μS
μS
(HTTP)Route/Proxy
Optional
(nginx)
Pod
(container)
Service
“Load Balancer”
Kubernetes – Programming Model
7
• Filesystem – that the program uses.
• Persistent – how state is saved beyond run-time.
• Persistent Volumes are attached and live outside of the
K8s cluster.
Volumes & Persistent Volumes
Pod
• One (or more) containers “grouped”
• Network (IP address): shared
• Volumes: shared
Service
• Common API (behavior) replicated across the cluster.
• Well Known Endpoint – a consistent IP address,
regardless of changes in specific Pods underneath.
Service
proxy
Host (“node” in K8s)
Pod – different μS
Pod
Container(s)
proxy
Host (“node” in K8s)
Pod
Container(s)
Volume,
external
to K8s
Abstract
(Common IP)
Kubernetes – Framework Architecture
8
Client
Control
Plane
Workload
*https://github.com/kubernetes/kubernetes/blob/release-1.3/docs/design/architecture.md
Kubernetes – Framework Architecture
9
• K8s is extensible
• Storage Plugin(s)
- NFS / iSCSI
- AWS-EC2 / Google GCE
- Ceph (RBD/CephFS) / Gluster
- Cinder (OpenStack)
• Other Extension Points
- Logging
- Access & Auth
- Scheduler
Control Plane Worker Node(s) Client
Extension Points
kubelet:
local, control plane agent.
Pod management using
docker-engine.
kube-proxy:
internal service routing
(i.e. TCP/UDP stream
forwarding)
docker-engine:
container execution
kube-apiserver:
Client’s API access point.
Routes requests to appropriate,
internal components.
kube-controller-manager:
Embeds the core control loops.
• Replication controller
• Endpoints controller (proxies)
• Namespace controller
kube-scheduler:
Workload (Pod) placement.
Sophisticated, configurable,
globally aware.
etcd (from CoreOS):
Distributed, watchable storage
The k8s system state
kubectl:
CLI into K8s
HTTP — RESTful protocol.
Kubernetes – Deployment Model
A Declarative Model
10
Manifest File(s)
Labels
PodSpec clause – within most descriptors
Replication Controller descriptor
• Optional only in trivial cases.
• (trivial = CLI only possible)
• YAML (or JSON) format.
• Key/Value “tags” – placed on any deployable object.
• Selectable – by actions and other declarations.
• Configuration Flexibility
• Labeled
• allows versioning
• other constraint application
• Container(s)
• very Dockerfile / docker-compose like.
• Image location, (including image version)
• Volume requirements
• Ports exposed
• “template/spec” clause declares PodSpec configuration.
• “replica” clause declares sizing of the service.
• Rolling-updates & canary deploys are a supported
pattern.
Descriptor Types (partial list)
• Replication Controller
• Deployment
• Pod
• Job
• Service
Running a Kubernetes Cluster
11
“There’s more than one way to do it”
– Larry Wall
Kubernetes in Public Cloud
12
Hosted Solution — Google Cloud Platform
Google Container Engine (GKE)
• Kubernetes Getting Started Guide “101”
• Hello World Walkthrough
https://cloud.google.com/container-engine/
http://kubernetes.io/docs/hellonode/
Turn-key Solutions
Amazon Web Services (AWS) EC2 http://kubernetes.io/docs/getting-started-guides/aws/
Azure http://kubernetes.io/docs/getting-started-guides/azure/
Free Trial —
60 days
$300 credit
Kubernetes Run Locally
13
On a Laptop / Desktop
Minikube
• K8s recommended method for single node deploy
http://kubernetes.io/docs/getting-started-guides/minikube/
Vagrant — superseded by Minikube, still usable. http://kubernetes.io/docs/getting-started-guides/vagrant/
kube-up.sh — another previous “#1” method by k8s http://containertutorials.com/get_started_kubernetes/index.html
Easy Kubernetes Cluster for macOS
• Recently discovered and recommended by our team (ATG).
https://github.com/TheNewNormal/kube-cluster-osx
Multi-host / Lab
CoreOS w/ Fleet • https://github.com/CaptTofu/kubernetes-cluster-fleet
• https://github.com/coreos/coreos-vagrant
• https://github.com/mhamrah/kubernetes-coreos-units
A Kubernetes Application
14
Kubernetes Application
– minimalist application –
15
1. Construct • Create a standard Docker application, a μService.
• Package it as a Docker Image.
2. Deploy • Deploy the Docker Image to a Docker Repository.
3. Run • kubectl run … --image=<Image-Repository-Path>
K8s App — Construct
16
app.py*
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return '-- Hello Flask Dockerized --n'
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
Dockerfile*
FROM ubuntu:latest
RUN apt-get update -y
RUN apt-get install -y python-pip python-dev build-essential
COPY . /apt
WORKDIR /apt
RUN pip install -r requirements.txt
ENTRYPOINT ["python"]
CMD ["app.py"]
*https://github.com/egustafson/ex-py-docker-flask
Build
Run
Verify (in a separate console)
# docker build –t ex-py-docker-flask .
...
...<many lines of output>
...
Successfully built 0fb21b16f3dd
#
# docker run –p 5000:5000 ex-py-docker-flask
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger pin code: 236-035-556
# curl http://localhost:5000
-- Hello Flask Dockerized –-
#
run outside localhost
(default port: 5000)
K8s App — Deploy
17
Hosted K8s – Google Container Engine
Local “laptop” – Minikube... (from the construct stage … mostly) ...
# docker build –t gcr.io/<my-proj-id>/ex-py-flask:v1 .
...
# gcloud docker push gcr.io/<my-proj-id>/ex-py-flask:v1
# minikube start
Starting local Kubernetes cluster...
Kubernetes is available at https://192.168.99.100:8443.
Kubectl is now configured to use the cluster.
# eval $(minikube docker-env)
# docker build –t library/ex-py-docker-flask .
Caveat: the method used above is a bit of a “hack”. Using the
‘docker-env’ combined with ‘docker build’ works because
Minikube only deploys into a single host. As a consequence the
Docker image will be available in the local Docker repository.
If Minikube ran across two or more hosts then the node Kubernetes
choses to run the Pod (container) on may not match where it was
built.
*http://kubernetes.io/docs/hellonode/
GCR
Convention
(alternate)
K8s App — Run
18
Hosted K8s – Google Container Engine Local “laptop” – Minikube
# kubectl run flask-node 
-–image=gcr.io/<my-proj-id>/ex-py-flask:v1 
--port=5000
Deployment “flask-node” created
# kubectl get pods
NAME READY STATUS RESTARTS AGE
flask-node-714049816-ztzrb 1/1 Running 0 6m
# kubectl expose deployment flask-node -–type=“LoadBalancer”
# kubectl get services flask-node
NAME CLUSTER_IP EXTERNAL_IP PORT(S) AGE
hello-node 10.3.246.12 23.251.159.72 5000/TCP 2m
Run
Verify
Run
Verify
# curl http://23.251.159.72:5000
-- Hello Flask Dockerized –
#
1.
2.
3.
4.
# kubectl run flask-node 
-–image=library/ex-py-docker-flask 
--port=5000
Deployment “flask-node” created
# kubectl get pods
NAME READY STATUS RESTARTS AGE
flask-node-714049816-ztzrb 1/1 Running 0 6m
# kubectl expose deployment flask-node -–type=“NodePort”
1.
2.
3.
# minikube service flask-node –-url
http://192.168.99.100:31992
# curl $(minikube service flask-node –-url)
-- Hello Flask Dockerized –
#
Getting Involved
19
Community http://kubernetes.io/community/
GitHub http://github.com/kubernetes
Project Page & Documents http://kubernetes.io
Slack (chat) (sign-up: http://slack.k8s.io/) https://kubernetes.slack.com
Special Interest Groups (SIGs)
(+20 topics)
Community Page  SIGs
(https://github.com/kubernetes/community/blob/master/README.md#special-interest-groups-sig)
Demo
https://github.com/egustafson/ex-gke-webdrop
20
https://github.com/egustafson/webdrop-py
Thank you
Advanced Technology Group for Open Source and Cloud
Eric Gustafson gustafson@hpe.com
Patrick Galbraith patg@hpe.com
Clare Springer clarissa.springer@hpe.com
21
Backup Slides
(Kubernetes Introduction)
22
Advanced Technology Group
for Open Source & Cloud
HPE's Advanced Technology Group for Open
Source & Cloud embraces a vision that is two
steps ahead of today's solutions.
We use this vision to drive product adoption
and incubate technologies to advance HPE.
Through open source initiatives we foster
collaboration across HPE and beyond.
23
Patrick Galbraith
patg@hpe.com
http://patg.net/
Interests: Kubernetes,
Ansible, MySQL projects
New Hampshire, USA
Eric Gustafson
gustafson@hpe.com
http://egustafson.github.io/
Interests: Monitoring,
Networking, Embedded/IoT
Colorado, USA
Brian Aker, Fellow
Yazz Atlas, Principle Engineer
Hillary Cirimele, Executive Assistant
Matt Farina, Principle Engineer
Patrick Galbraith, Principle Engineer
Eric Gustafson, Principle Engineer
Clare Springer, Program Manager
References – Kubernetes Introduction
• “Large-scale cluster management at Google with Borg”
• https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43438.pdf
• “Omega: flexible, scalable schedulers for large compute clusters”
• https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41684.pdf
• “Borg, Omega, and Kubernetes”
• https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44843.pdf
• “Jupiter Rising: A Decade of Clos Topologies and Centralized Control in Google’s Datacenter Network”
• http://conferences.sigcomm.org/sigcomm/2015/pdf/papers/p183.pdf
24

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
An overview of the Kubernetes architecture
An overview of the Kubernetes architectureAn overview of the Kubernetes architecture
An overview of the Kubernetes architecture
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenIntroduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview
 
A brief study on Kubernetes and its components
A brief study on Kubernetes and its componentsA brief study on Kubernetes and its components
A brief study on Kubernetes and its components
 
Kubernetes 101 for Beginners
Kubernetes 101 for BeginnersKubernetes 101 for Beginners
Kubernetes 101 for Beginners
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for Kubernetes
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 

Andere mochten auch

An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
Neo4j
 
Red Hat OpenShift V3 Overview and Deep Dive
Red Hat OpenShift V3 Overview and Deep DiveRed Hat OpenShift V3 Overview and Deep Dive
Red Hat OpenShift V3 Overview and Deep Dive
Greg Hoelzer
 

Andere mochten auch (20)

Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes MeetupKubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
 
Mesos and Kubernetes ecosystem overview
Mesos and Kubernetes ecosystem overviewMesos and Kubernetes ecosystem overview
Mesos and Kubernetes ecosystem overview
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Docker Madison, Introduction to Kubernetes
Docker Madison, Introduction to KubernetesDocker Madison, Introduction to Kubernetes
Docker Madison, Introduction to Kubernetes
 
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
 
Introduction to Kubernetes - Docker Global Mentor Week 2016
Introduction to Kubernetes - Docker Global Mentor Week 2016Introduction to Kubernetes - Docker Global Mentor Week 2016
Introduction to Kubernetes - Docker Global Mentor Week 2016
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Kubernetes Networking - Giragadurai Vallirajan
Kubernetes Networking - Giragadurai VallirajanKubernetes Networking - Giragadurai Vallirajan
Kubernetes Networking - Giragadurai Vallirajan
 
Kubernetes automation in production
Kubernetes automation in productionKubernetes automation in production
Kubernetes automation in production
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
 
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
OpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetesOpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetes
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Red Hat OpenShift V3 Overview and Deep Dive
Red Hat OpenShift V3 Overview and Deep DiveRed Hat OpenShift V3 Overview and Deep Dive
Red Hat OpenShift V3 Overview and Deep Dive
 

Ähnlich wie Kubernetes Introduction

Ähnlich wie Kubernetes Introduction (20)

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)
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
 
Kubernetes from the ground up
Kubernetes from the ground upKubernetes from the ground up
Kubernetes from the ground up
 
Docker and kubernetes_introduction
Docker and kubernetes_introductionDocker and kubernetes_introduction
Docker and kubernetes_introduction
 
ProxySQL on Kubernetes
ProxySQL on KubernetesProxySQL on Kubernetes
ProxySQL on Kubernetes
 
Kubernetes for Java Developers
Kubernetes for Java DevelopersKubernetes for Java Developers
Kubernetes for Java Developers
 
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
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple
 
Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
Azure kubernetes service (aks) part 3
Azure kubernetes service (aks)   part 3Azure kubernetes service (aks)   part 3
Azure kubernetes service (aks) part 3
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
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 !
 
From dev to prod: Kubernetes on AWS (short ver.)
From dev to prod: Kubernetes on AWS (short ver.)From dev to prod: Kubernetes on AWS (short ver.)
From dev to prod: Kubernetes on AWS (short ver.)
 
Whose Job Is It Anyway? Kubernetes, CRI, & Container Runtimes
Whose Job Is It Anyway? Kubernetes, CRI, & Container RuntimesWhose Job Is It Anyway? Kubernetes, CRI, & Container Runtimes
Whose Job Is It Anyway? Kubernetes, CRI, & Container Runtimes
 
Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of Containers
 
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and KubelessBuilding Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
 
The App Developer's Kubernetes Toolbox
The App Developer's Kubernetes ToolboxThe App Developer's Kubernetes Toolbox
The App Developer's Kubernetes Toolbox
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

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, ...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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...
 
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
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Kubernetes Introduction

  • 1. Kubernetes Introduction Advanced Technology Group (ATG) for Open Source & Cloud August 2016
  • 2. What is Kubernetes? 2 Κυβερνήτης — Greek: A nautical term meaning “helmsman” or “pilot” “K8s”
  • 3. Kubernetes “Open Source Container Cluster Manager” • Google — Architect and creator. • Borg — Google’s internal cluster management software.  Kubernetes – complete rewrite, (in Go). • Google partnered with Linux Foundation to form:  Cloud Native Computing Foundation (CNCF)  offered Kubernetes as a seed technology 3
  • 4. Kubernetes History 2013 2014 2015 2016 Apr 2015 Tectonic formed (commercial support) Apr 2015 The Borg Paper is published Sep 2014 Kubernetes announced in Wired magazine Jun 2014 Kubernetes 1st GitHub commit Mar 2013 Docker initial release Aug 2014 CoreOS introduces Flannel networking Oct 2013 CoreOS initial release 4 2008 …2006 2006 Google starts work on “Process Containers” (renamed “cgroups”) Jan 2008 cgroups merged into Linux (2.6.24) 2007 July 2015 CNCF Formed, K8s v1.0 released, donated to CNCF Borg development inside Google
  • 5. Kubernetes Tech Specs Features • μService Architecture • Automatic Workload Placement (efficient) • Auto Remediating (self healing) • Horizontal Scaling • Load Balanced • Declarative Deployment • Service Discovery included • A/B & Canary Deployments (testing) Surrounding Ecosystem  Docker – the container “engine” on each host.  etcd (from CoreOS) – distributed K/V store.  CoreOS – the platform.  Flannel – overlay networking.  Hosted Service: Google Container Platform  GKE is the abbreviation. 5
  • 6. 6 Network Client μService Programming Model — Cloud Native proxy μS … μS μS proxy μS … μS μS proxy μS … μS μS proxy μS … μS μS proxy μS … μS μS proxy μS … μS μS (HTTP)Route/Proxy Optional (nginx) Pod (container) Service “Load Balancer”
  • 7. Kubernetes – Programming Model 7 • Filesystem – that the program uses. • Persistent – how state is saved beyond run-time. • Persistent Volumes are attached and live outside of the K8s cluster. Volumes & Persistent Volumes Pod • One (or more) containers “grouped” • Network (IP address): shared • Volumes: shared Service • Common API (behavior) replicated across the cluster. • Well Known Endpoint – a consistent IP address, regardless of changes in specific Pods underneath. Service proxy Host (“node” in K8s) Pod – different μS Pod Container(s) proxy Host (“node” in K8s) Pod Container(s) Volume, external to K8s Abstract (Common IP)
  • 8. Kubernetes – Framework Architecture 8 Client Control Plane Workload *https://github.com/kubernetes/kubernetes/blob/release-1.3/docs/design/architecture.md
  • 9. Kubernetes – Framework Architecture 9 • K8s is extensible • Storage Plugin(s) - NFS / iSCSI - AWS-EC2 / Google GCE - Ceph (RBD/CephFS) / Gluster - Cinder (OpenStack) • Other Extension Points - Logging - Access & Auth - Scheduler Control Plane Worker Node(s) Client Extension Points kubelet: local, control plane agent. Pod management using docker-engine. kube-proxy: internal service routing (i.e. TCP/UDP stream forwarding) docker-engine: container execution kube-apiserver: Client’s API access point. Routes requests to appropriate, internal components. kube-controller-manager: Embeds the core control loops. • Replication controller • Endpoints controller (proxies) • Namespace controller kube-scheduler: Workload (Pod) placement. Sophisticated, configurable, globally aware. etcd (from CoreOS): Distributed, watchable storage The k8s system state kubectl: CLI into K8s HTTP — RESTful protocol.
  • 10. Kubernetes – Deployment Model A Declarative Model 10 Manifest File(s) Labels PodSpec clause – within most descriptors Replication Controller descriptor • Optional only in trivial cases. • (trivial = CLI only possible) • YAML (or JSON) format. • Key/Value “tags” – placed on any deployable object. • Selectable – by actions and other declarations. • Configuration Flexibility • Labeled • allows versioning • other constraint application • Container(s) • very Dockerfile / docker-compose like. • Image location, (including image version) • Volume requirements • Ports exposed • “template/spec” clause declares PodSpec configuration. • “replica” clause declares sizing of the service. • Rolling-updates & canary deploys are a supported pattern. Descriptor Types (partial list) • Replication Controller • Deployment • Pod • Job • Service
  • 11. Running a Kubernetes Cluster 11 “There’s more than one way to do it” – Larry Wall
  • 12. Kubernetes in Public Cloud 12 Hosted Solution — Google Cloud Platform Google Container Engine (GKE) • Kubernetes Getting Started Guide “101” • Hello World Walkthrough https://cloud.google.com/container-engine/ http://kubernetes.io/docs/hellonode/ Turn-key Solutions Amazon Web Services (AWS) EC2 http://kubernetes.io/docs/getting-started-guides/aws/ Azure http://kubernetes.io/docs/getting-started-guides/azure/ Free Trial — 60 days $300 credit
  • 13. Kubernetes Run Locally 13 On a Laptop / Desktop Minikube • K8s recommended method for single node deploy http://kubernetes.io/docs/getting-started-guides/minikube/ Vagrant — superseded by Minikube, still usable. http://kubernetes.io/docs/getting-started-guides/vagrant/ kube-up.sh — another previous “#1” method by k8s http://containertutorials.com/get_started_kubernetes/index.html Easy Kubernetes Cluster for macOS • Recently discovered and recommended by our team (ATG). https://github.com/TheNewNormal/kube-cluster-osx Multi-host / Lab CoreOS w/ Fleet • https://github.com/CaptTofu/kubernetes-cluster-fleet • https://github.com/coreos/coreos-vagrant • https://github.com/mhamrah/kubernetes-coreos-units
  • 15. Kubernetes Application – minimalist application – 15 1. Construct • Create a standard Docker application, a μService. • Package it as a Docker Image. 2. Deploy • Deploy the Docker Image to a Docker Repository. 3. Run • kubectl run … --image=<Image-Repository-Path>
  • 16. K8s App — Construct 16 app.py* from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return '-- Hello Flask Dockerized --n' if __name__ == '__main__': app.run(debug=True, host='0.0.0.0') Dockerfile* FROM ubuntu:latest RUN apt-get update -y RUN apt-get install -y python-pip python-dev build-essential COPY . /apt WORKDIR /apt RUN pip install -r requirements.txt ENTRYPOINT ["python"] CMD ["app.py"] *https://github.com/egustafson/ex-py-docker-flask Build Run Verify (in a separate console) # docker build –t ex-py-docker-flask . ... ...<many lines of output> ... Successfully built 0fb21b16f3dd # # docker run –p 5000:5000 ex-py-docker-flask * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) * Restarting with stat * Debugger is active! * Debugger pin code: 236-035-556 # curl http://localhost:5000 -- Hello Flask Dockerized –- # run outside localhost (default port: 5000)
  • 17. K8s App — Deploy 17 Hosted K8s – Google Container Engine Local “laptop” – Minikube... (from the construct stage … mostly) ... # docker build –t gcr.io/<my-proj-id>/ex-py-flask:v1 . ... # gcloud docker push gcr.io/<my-proj-id>/ex-py-flask:v1 # minikube start Starting local Kubernetes cluster... Kubernetes is available at https://192.168.99.100:8443. Kubectl is now configured to use the cluster. # eval $(minikube docker-env) # docker build –t library/ex-py-docker-flask . Caveat: the method used above is a bit of a “hack”. Using the ‘docker-env’ combined with ‘docker build’ works because Minikube only deploys into a single host. As a consequence the Docker image will be available in the local Docker repository. If Minikube ran across two or more hosts then the node Kubernetes choses to run the Pod (container) on may not match where it was built. *http://kubernetes.io/docs/hellonode/ GCR Convention (alternate)
  • 18. K8s App — Run 18 Hosted K8s – Google Container Engine Local “laptop” – Minikube # kubectl run flask-node -–image=gcr.io/<my-proj-id>/ex-py-flask:v1 --port=5000 Deployment “flask-node” created # kubectl get pods NAME READY STATUS RESTARTS AGE flask-node-714049816-ztzrb 1/1 Running 0 6m # kubectl expose deployment flask-node -–type=“LoadBalancer” # kubectl get services flask-node NAME CLUSTER_IP EXTERNAL_IP PORT(S) AGE hello-node 10.3.246.12 23.251.159.72 5000/TCP 2m Run Verify Run Verify # curl http://23.251.159.72:5000 -- Hello Flask Dockerized – # 1. 2. 3. 4. # kubectl run flask-node -–image=library/ex-py-docker-flask --port=5000 Deployment “flask-node” created # kubectl get pods NAME READY STATUS RESTARTS AGE flask-node-714049816-ztzrb 1/1 Running 0 6m # kubectl expose deployment flask-node -–type=“NodePort” 1. 2. 3. # minikube service flask-node –-url http://192.168.99.100:31992 # curl $(minikube service flask-node –-url) -- Hello Flask Dockerized – #
  • 19. Getting Involved 19 Community http://kubernetes.io/community/ GitHub http://github.com/kubernetes Project Page & Documents http://kubernetes.io Slack (chat) (sign-up: http://slack.k8s.io/) https://kubernetes.slack.com Special Interest Groups (SIGs) (+20 topics) Community Page  SIGs (https://github.com/kubernetes/community/blob/master/README.md#special-interest-groups-sig)
  • 21. Thank you Advanced Technology Group for Open Source and Cloud Eric Gustafson gustafson@hpe.com Patrick Galbraith patg@hpe.com Clare Springer clarissa.springer@hpe.com 21
  • 23. Advanced Technology Group for Open Source & Cloud HPE's Advanced Technology Group for Open Source & Cloud embraces a vision that is two steps ahead of today's solutions. We use this vision to drive product adoption and incubate technologies to advance HPE. Through open source initiatives we foster collaboration across HPE and beyond. 23 Patrick Galbraith patg@hpe.com http://patg.net/ Interests: Kubernetes, Ansible, MySQL projects New Hampshire, USA Eric Gustafson gustafson@hpe.com http://egustafson.github.io/ Interests: Monitoring, Networking, Embedded/IoT Colorado, USA Brian Aker, Fellow Yazz Atlas, Principle Engineer Hillary Cirimele, Executive Assistant Matt Farina, Principle Engineer Patrick Galbraith, Principle Engineer Eric Gustafson, Principle Engineer Clare Springer, Program Manager
  • 24. References – Kubernetes Introduction • “Large-scale cluster management at Google with Borg” • https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43438.pdf • “Omega: flexible, scalable schedulers for large compute clusters” • https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41684.pdf • “Borg, Omega, and Kubernetes” • https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44843.pdf • “Jupiter Rising: A Decade of Clos Topologies and Centralized Control in Google’s Datacenter Network” • http://conferences.sigcomm.org/sigcomm/2015/pdf/papers/p183.pdf 24

Hinweis der Redaktion

  1. This is a sample Picture Right with Caption slide ideal for including a picture with a brief descriptive statement. To Replace the Picture on this Sample Slide (this applies to all slides in this template that contain replaceable pictures) Select the sample picture and press Delete. Click the icon inside the shape to open the Insert Picture dialog box. Navigate to the location where the picture is stored, select desired picture and click on the Insert button to fit the image proportionally within the shape. Note: Do not right-click the image to change the picture inside the picture placeholder. This will change the frame size of the picture placeholder. Instead, follow the steps outlined above. Tip: use the Crop tool to reposition a picture within a placeholder. From the Picture Tools Format tab on the ribbon, click the Crop button. Click and drag the picture within the placeholder to reposition. To scale the picture within the placeholder (while Crop is active), grab a round corner handle and drag to resize. Hold Shift key to constrain picture aspect ratio when resizing.