SlideShare a Scribd company logo
Kubernetes 101
and Fun
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 1
About me
Mario-Leander Reimer
Chief Technologist, QAware GmbH
mario-leander.reimer@qaware.de
twitter://@LeanderReimer
http://github.com/lreimer
http://speakerdeck.com/lreimer
http://www.qaware.de
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 2
Code and article series are here ...
4 https://github.com/qaware/cloud-native-zwitscher/
4 http://www.qaware.de/fileadmin/userupload/QAware-Cloud-Native-
Artikelserie-JavaMagazin-1.pdf
4 http://www.qaware.de/fileadmin/userupload/QAware-Cloud-Native-
Artikelserie-JavaMagazin-2.pdf
4 http://www.qaware.de/fileadmin/userupload/QAware-Cloud-Native-
Artikelserie-JavaMagazin-3.pdf
4 http://www.qaware.de/fileadmin/userupload/QAware-Cloud-Native-
Artikelserie-JavaMagazin-4.pdf
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 3
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 4
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 5
Design principles for Cloud Native Applications
4 Design for Performance: responsive; concurrency; efficiency.
4 Design for Automation: automate dev tasks & ops tasks.
4 Design for Resiliency: fault-tolerant; self-healing.
4 Design for Elasticity: dynamically scale; be reactive.
4 Design for Delivery: short roundtrips; automated delivery.
4 Design for Diagnosability: cluster-wide logs, traces, metrics.
4 The Twelve-Factor App Principles (https://12factor.net)
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 6
Cloud Native Stack required!
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 7
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 8
Cloud Native Stack using Kubernetes.
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 9
Kubernetes 101
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 10
Local or Cloud setup of Kubernetes
echo "- Use Vagrant for local K8s setup"
export KUBERNETES_PROVIDER=vagrant
export NUM_NODES=1
echo "- The default provider is GCE"
export KUBERNETES_PROVIDER=gce
export KUBE_GCE_ZONE=europe-west1-d
export NUM_NODES=4
echo "- Another possible provider is AWS"
export KUBERNETES_PROVIDER=aws
export KUBE_AWS_ZONE=eu-central-1a
export NODE_SIZE=t2.small
curl -sS https://get.k8s.io | bash
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 11
Overview of Kubernetes Architecture
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 12
Main Kubernetes concepts
4 Services are an abstraction for a
logical set of Pods.
4 Pods are the smallest deployable units
of computing.
4 Deployments provide declarative
updates for Pods and RCs.
4 Replica Sets ensure specified number
of Pods are running.
4 Labels are key/value pairs attached to
objects used for identification.
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 13
Deployment definition as YAML
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hello-world
spec:
replicas: 1
template:
metadata:
labels:
tier: web
spec:
containers:
- name: hello-world
image: "nginx"
ports:
- containerPort: 80
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 14
Service definition as YAML
apiVersion: v1
kind: Service
metadata:
name: hello-world
labels:
tier: web
spec:
# use NodePort here to be able to access the port on each node
# use LoadBalancer for external load-balanced IP if supported
type: NodePort
ports:
- port: 80
selector:
tier: web
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 15
Hello World with Kubernetes
$ kubectl cluster-info
$ kubectl get nodes
$ kubectl run hello-world --image=nginx --replicas=1 --port=80
$ kubectl expose deployment hello-world
$ kubectl get deployments,services,pods
$ kubectl describe pod [NAME]
$ kubectl delete deployment hello-world
$ kubectl create -f nginx.yml
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 16
Demo time.
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 17
The Cloud Native Zwitscher
Showcase
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 18
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 19
The source code.
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 20
Dockerize it!
4 Know your base image!!!
4 The Alpine image is too thin for
K8s + Spring.
4 You need Bash, DNS and Java.
4 Use a Server JRE.
4 Better build your own image.
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 21
Example Dockerfile for Zwitscher Service
FROM qaware-oss-docker-registry.bintray.io/base/alpine-k8s-ibmjava8:8.0-3.10
MAINTAINER QAware GmbH <qaware-oss@qaware.de>
RUN mkdir -p /opt/zwitscher-service
COPY build/libs/zwitscher-service-1.1.0.jar /opt/zwitscher-service/zwitscher-service.jar
COPY src/main/docker/zwitscher-service.* /opt/zwitscher-service/
RUN chmod 755 /opt/zwitscher-service/zwitscher-service.*
EXPOSE 8080
CMD /opt/zwitscher-service/zwitscher-service.sh
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 22
Build, test, tag and push Docker images.
...
$ docker built -t zwitscher-service:1.1.0 .
$ docker-compose up
...
$ docker tag zwitscher-service:1.1.0 
qaware-oss-docker-registry.bintray.io/zwitscher/zwitscher-service
...
$ docker push qaware-oss-docker-registry.bintray.io/zwitscher/zwitscher-service
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 23
Kubernetize: single or multi-container pods?
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 24
Possible variation using K8s infrastructure.
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 25
Define a deployment per container.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: zwitscher-service
spec:
replicas: 1
template:
metadata:
labels:
zwitscher: service
spec:
containers:
- name: zwitscher-service
image: "qaware-oss-docker-registry.bintray.io/zwitscher/zwitscher-service:1.1.0"
ports:
- containerPort: 8080
env:
- name: EUREKA_HOST
value: zwitscher-eureka
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 26
Define a service per deployment.
apiVersion: v1
kind: Service
metadata:
name: zwitscher-service
labels:
zwitscher: service
spec:
# use NodePort here to be able to access the port on each node
# use LoadBalancer for external load-balanced IP if supported
type: NodePort
ports:
- port: 8080
selector:
zwitscher: service
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 27
Be careful using resource constraints.
resources:
# required resources for a Pod to be started
requests:
memory: "128Mi"
cpu: "250m"
# the Pod will be restarted if limits are exceeded
limits:
memory: "192Mi"
cpu: "500m"
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 28
Use liveness and readiness probes with Actuator.
livenessProbe:
httpGet:
path: /admin/health
port: 8080
initialDelaySeconds: 90
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /admin/info
port: 8080
timeoutSeconds: 30
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 29
Use Retry mechanism for fail-fast behavior.
# bootstrap.yml
spring:
application:
name: zwitscher-service
cloud:
config:
enabled: true
failFast: true
retry:
initialInterval: 1500
maxInterval: 5000
maxAttempts: 5
multiplier: 1.5
discovery:
enabled: true
serviceId: ZWITSCHER-CONFIG
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 30
Deployment time!
$ kubectl create -f zwitscher-eureka/k8s-zwitscher-eureka.yml
$ kubectl create -f zwitscher-config/k8s-zwitscher-config.yml
$ kubectl create -f zwitscher-service/k8s-zwitscher-service.yml
$ kubectl create -f zwitscher-board/k8s-zwitscher-board.yml
$ kubectl create -f zwitscher-edge/k8s-zwitscher-edge.yml
$ kubectl create -f zwitscher-monitor/k8s-zwitscher-monitor.yml
$ kubectl get deployments,pods,services
$ kubectl delete -f k8s-zwitscher.yml
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 31
Let's have some fun!
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 32
The Kubepad in action
4 A MIDI controller
4 Display deployments and pods
4 Scale deployments
4 Written in fancy Kotlin
4 Also works for DC/OS
4 https://github.com/qaware/
kubepad
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 33
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 34
Q & A
| ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 35

More Related Content

What's hot (20)

PDF
Free GitOps Workshop + Intro to Kubernetes & GitOps
Weaveworks
 
PDF
Introduction to Red Hat OpenShift 4
HngNguyn748044
 
PDF
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
PDF
Kubernetes Basics
Eueung Mulyana
 
PPTX
Intro to Helm for Kubernetes
Carlos E. Salazar
 
PPTX
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Vietnam Open Infrastructure User Group
 
PDF
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
PPTX
Kubernetes
Henry He
 
PPTX
DevOps with Kubernetes
EastBanc Tachnologies
 
PDF
Getting Started with Kubernetes
VMware Tanzu
 
PPTX
Kubernetes 101 for Beginners
Oktay Esgul
 
PDF
Kubernetes
erialc_w
 
PPTX
GitOps w/argocd
Jean-Philippe Bélanger
 
PDF
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
Ji-Woong Choi
 
PDF
KubeCon EU 2016: Kubernetes Storage 101
KubeAcademy
 
PDF
GitOps with ArgoCD
CloudOps2005
 
PDF
Kubernetes dealing with storage and persistence
Janakiram MSV
 
PPTX
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
PPTX
Introduction to Helm
Harshal Shah
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Weaveworks
 
Introduction to Red Hat OpenShift 4
HngNguyn748044
 
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
Kubernetes Basics
Eueung Mulyana
 
Intro to Helm for Kubernetes
Carlos E. Salazar
 
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Vietnam Open Infrastructure User Group
 
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Kubernetes
Henry He
 
DevOps with Kubernetes
EastBanc Tachnologies
 
Getting Started with Kubernetes
VMware Tanzu
 
Kubernetes 101 for Beginners
Oktay Esgul
 
Kubernetes
erialc_w
 
GitOps w/argocd
Jean-Philippe Bélanger
 
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
Ji-Woong Choi
 
KubeCon EU 2016: Kubernetes Storage 101
KubeAcademy
 
GitOps with ArgoCD
CloudOps2005
 
Kubernetes dealing with storage and persistence
Janakiram MSV
 
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
Introduction to Helm
Harshal Shah
 

Viewers also liked (18)

PDF
Kubernetes 101
Jacopo Nardiello
 
PDF
A Hitchhiker's Guide to the Cloud Native Stack
QAware GmbH
 
PPTX
DockerCon 2016 - Structured Container Delivery
Oscar Renalias
 
PDF
Google Machine Learning APIs - puppies or muffins?
Bret McGowen - NYC Google Developer Advocate
 
PDF
Kubernetes 101 for Developers
Ross Kukulinski
 
PDF
Everything-as-code - a polyglot journey.
QAware GmbH
 
PDF
Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017
Mario-Leander Reimer
 
PDF
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
brendandburns
 
PPTX
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
CoreOS
 
PDF
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
Brian Grant
 
PPTX
10 Key Steps for Moving from Legacy Infrastructure to the Cloud
NGINX, Inc.
 
PPTX
Container & kubernetes
Ted Jung
 
PPTX
Introduction to Kubernetes
rajdeep
 
PDF
Understanding Kubernetes
Tu Pham
 
PDF
Kubernetes Networking
CJ Cullen
 
PDF
From Code to Kubernetes
Daniel Oliveira Filho
 
PDF
Kubernetes go paddle meetup
Sujai Prakasam
 
PDF
KubeCon 2017: Kubernetes from Dev to Prod
Subhas Dandapani
 
Kubernetes 101
Jacopo Nardiello
 
A Hitchhiker's Guide to the Cloud Native Stack
QAware GmbH
 
DockerCon 2016 - Structured Container Delivery
Oscar Renalias
 
Google Machine Learning APIs - puppies or muffins?
Bret McGowen - NYC Google Developer Advocate
 
Kubernetes 101 for Developers
Ross Kukulinski
 
Everything-as-code - a polyglot journey.
QAware GmbH
 
Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017
Mario-Leander Reimer
 
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
brendandburns
 
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
CoreOS
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
Brian Grant
 
10 Key Steps for Moving from Legacy Infrastructure to the Cloud
NGINX, Inc.
 
Container & kubernetes
Ted Jung
 
Introduction to Kubernetes
rajdeep
 
Understanding Kubernetes
Tu Pham
 
Kubernetes Networking
CJ Cullen
 
From Code to Kubernetes
Daniel Oliveira Filho
 
Kubernetes go paddle meetup
Sujai Prakasam
 
KubeCon 2017: Kubernetes from Dev to Prod
Subhas Dandapani
 
Ad

Similar to Kubernetes 101 and Fun (20)

PDF
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
Mario-Leander Reimer
 
PDF
A hitchhiker‘s guide to the cloud native stack
QAware GmbH
 
PDF
Kubernetes for Java developers
Robert Barr
 
PDF
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - C...
Henning Jacobs
 
PDF
12.07.2017 Docker Meetup - KUBERNETES ON AWS @ ZALANDO TECH
Zalando adtech lab
 
PDF
Xpdays: Kubernetes CI-CD Frameworks Case Study
Denys Vasyliev
 
PDF
Immediate download Kubernetes Best Practices 1st Edition Brendan Burns ebooks...
seinersofhia
 
PDF
Kubernetes for the PHP developer
Paul Czarkowski
 
PDF
Evolving for Kubernetes
Chris McEniry
 
PDF
Developing Java based microservices ready for the world of containers
Claus Ibsen
 
PDF
Get you Java application ready for Kubernetes !
Anthony Dahanne
 
PDF
A DevOps guide to Kubernetes
Paul Czarkowski
 
PDF
Containerising bootiful microservices javaeeconf
Ivan Vasyliev
 
PDF
Elastic Kubernetes Services (EKS)
sriram_rajan
 
PDF
Why do we even have Kubernetes?
Sean Walberg
 
PDF
Kubecon seattle 2018 workshop slides
Weaveworks
 
PDF
WWCode Dallas - Kubernetes: Learning from Zero to Production
Rosemary Wang
 
PDF
LISA2017 Kubernetes: Hit the Ground Running
Chris McEniry
 
PDF
From CoreOS to Kubernetes and Concourse CI
Denis Izmaylov
 
PDF
Kubernetes on AWS @ Zalando Tech
Michael Dürgner
 
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
Mario-Leander Reimer
 
A hitchhiker‘s guide to the cloud native stack
QAware GmbH
 
Kubernetes for Java developers
Robert Barr
 
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - C...
Henning Jacobs
 
12.07.2017 Docker Meetup - KUBERNETES ON AWS @ ZALANDO TECH
Zalando adtech lab
 
Xpdays: Kubernetes CI-CD Frameworks Case Study
Denys Vasyliev
 
Immediate download Kubernetes Best Practices 1st Edition Brendan Burns ebooks...
seinersofhia
 
Kubernetes for the PHP developer
Paul Czarkowski
 
Evolving for Kubernetes
Chris McEniry
 
Developing Java based microservices ready for the world of containers
Claus Ibsen
 
Get you Java application ready for Kubernetes !
Anthony Dahanne
 
A DevOps guide to Kubernetes
Paul Czarkowski
 
Containerising bootiful microservices javaeeconf
Ivan Vasyliev
 
Elastic Kubernetes Services (EKS)
sriram_rajan
 
Why do we even have Kubernetes?
Sean Walberg
 
Kubecon seattle 2018 workshop slides
Weaveworks
 
WWCode Dallas - Kubernetes: Learning from Zero to Production
Rosemary Wang
 
LISA2017 Kubernetes: Hit the Ground Running
Chris McEniry
 
From CoreOS to Kubernetes and Concourse CI
Denis Izmaylov
 
Kubernetes on AWS @ Zalando Tech
Michael Dürgner
 
Ad

More from Mario-Leander Reimer (20)

PDF
Steinzeit war gestern! Vielfältige Wege der Cloud-nativen Evolution.
Mario-Leander Reimer
 
PDF
A Hitchhiker's Guide to Cloud Native Java EE
Mario-Leander Reimer
 
PDF
Steinzeit war gestern! Die vielfältigen Wege der Cloud-nativen Evolution
Mario-Leander Reimer
 
PDF
Everything-as-code: DevOps und Continuous Delivery aus Sicht des Entwicklers....
Mario-Leander Reimer
 
PPTX
Das kleine Einmaleins der sicheren Architektur @heise_devSec
Mario-Leander Reimer
 
PDF
Polyglot Adventures for the Modern Java Developer #javaone2017
Mario-Leander Reimer
 
PDF
Elegantes In-Memory Computing mit Apache Ignite und Kubernetes. @data2day
Mario-Leander Reimer
 
PDF
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Mario-Leander Reimer
 
PDF
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
Mario-Leander Reimer
 
PDF
Everything-as-code. A polyglot adventure. #DevoxxPL
Mario-Leander Reimer
 
PDF
Per Anhalter durch den Cloud Native Stack. #SEACONHH
Mario-Leander Reimer
 
PDF
Everything-as-code. Ein polyglottes Abenteuer. #jax2017
Mario-Leander Reimer
 
PDF
Everything-as-code. Eine vielsprachige Reise. #javaland
Mario-Leander Reimer
 
PDF
Per Anhalter durch den Cloud Native Stack (Extended Edition) #oop2017
Mario-Leander Reimer
 
PDF
Der Cloud Native Stack in a Nutshell. #CloudExpoEurope
Mario-Leander Reimer
 
PDF
A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf
Mario-Leander Reimer
 
PDF
Secure Architecture and Programming 101
Mario-Leander Reimer
 
PDF
Automotive Information Research driven by Apache Solr
Mario-Leander Reimer
 
PDF
Automotive Information Research driven by Apache Solr
Mario-Leander Reimer
 
PDF
Everything-as-code. A polyglot journey.
Mario-Leander Reimer
 
Steinzeit war gestern! Vielfältige Wege der Cloud-nativen Evolution.
Mario-Leander Reimer
 
A Hitchhiker's Guide to Cloud Native Java EE
Mario-Leander Reimer
 
Steinzeit war gestern! Die vielfältigen Wege der Cloud-nativen Evolution
Mario-Leander Reimer
 
Everything-as-code: DevOps und Continuous Delivery aus Sicht des Entwicklers....
Mario-Leander Reimer
 
Das kleine Einmaleins der sicheren Architektur @heise_devSec
Mario-Leander Reimer
 
Polyglot Adventures for the Modern Java Developer #javaone2017
Mario-Leander Reimer
 
Elegantes In-Memory Computing mit Apache Ignite und Kubernetes. @data2day
Mario-Leander Reimer
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Mario-Leander Reimer
 
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
Mario-Leander Reimer
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Mario-Leander Reimer
 
Per Anhalter durch den Cloud Native Stack. #SEACONHH
Mario-Leander Reimer
 
Everything-as-code. Ein polyglottes Abenteuer. #jax2017
Mario-Leander Reimer
 
Everything-as-code. Eine vielsprachige Reise. #javaland
Mario-Leander Reimer
 
Per Anhalter durch den Cloud Native Stack (Extended Edition) #oop2017
Mario-Leander Reimer
 
Der Cloud Native Stack in a Nutshell. #CloudExpoEurope
Mario-Leander Reimer
 
A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf
Mario-Leander Reimer
 
Secure Architecture and Programming 101
Mario-Leander Reimer
 
Automotive Information Research driven by Apache Solr
Mario-Leander Reimer
 
Automotive Information Research driven by Apache Solr
Mario-Leander Reimer
 
Everything-as-code. A polyglot journey.
Mario-Leander Reimer
 

Recently uploaded (20)

PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
July Patch Tuesday
Ivanti
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
July Patch Tuesday
Ivanti
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Kubernetes 101 and Fun

  • 1. Kubernetes 101 and Fun | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 1
  • 2. About me Mario-Leander Reimer Chief Technologist, QAware GmbH [email protected] twitter://@LeanderReimer http://github.com/lreimer http://speakerdeck.com/lreimer http://www.qaware.de | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 2
  • 3. Code and article series are here ... 4 https://github.com/qaware/cloud-native-zwitscher/ 4 http://www.qaware.de/fileadmin/userupload/QAware-Cloud-Native- Artikelserie-JavaMagazin-1.pdf 4 http://www.qaware.de/fileadmin/userupload/QAware-Cloud-Native- Artikelserie-JavaMagazin-2.pdf 4 http://www.qaware.de/fileadmin/userupload/QAware-Cloud-Native- Artikelserie-JavaMagazin-3.pdf 4 http://www.qaware.de/fileadmin/userupload/QAware-Cloud-Native- Artikelserie-JavaMagazin-4.pdf | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 3
  • 4. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 4
  • 5. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 5
  • 6. Design principles for Cloud Native Applications 4 Design for Performance: responsive; concurrency; efficiency. 4 Design for Automation: automate dev tasks & ops tasks. 4 Design for Resiliency: fault-tolerant; self-healing. 4 Design for Elasticity: dynamically scale; be reactive. 4 Design for Delivery: short roundtrips; automated delivery. 4 Design for Diagnosability: cluster-wide logs, traces, metrics. 4 The Twelve-Factor App Principles (https://12factor.net) | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 6
  • 7. Cloud Native Stack required! | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 7
  • 8. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 8
  • 9. Cloud Native Stack using Kubernetes. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 9
  • 10. Kubernetes 101 | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 10
  • 11. Local or Cloud setup of Kubernetes echo "- Use Vagrant for local K8s setup" export KUBERNETES_PROVIDER=vagrant export NUM_NODES=1 echo "- The default provider is GCE" export KUBERNETES_PROVIDER=gce export KUBE_GCE_ZONE=europe-west1-d export NUM_NODES=4 echo "- Another possible provider is AWS" export KUBERNETES_PROVIDER=aws export KUBE_AWS_ZONE=eu-central-1a export NODE_SIZE=t2.small curl -sS https://get.k8s.io | bash | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 11
  • 12. Overview of Kubernetes Architecture | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 12
  • 13. Main Kubernetes concepts 4 Services are an abstraction for a logical set of Pods. 4 Pods are the smallest deployable units of computing. 4 Deployments provide declarative updates for Pods and RCs. 4 Replica Sets ensure specified number of Pods are running. 4 Labels are key/value pairs attached to objects used for identification. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 13
  • 14. Deployment definition as YAML apiVersion: extensions/v1beta1 kind: Deployment metadata: name: hello-world spec: replicas: 1 template: metadata: labels: tier: web spec: containers: - name: hello-world image: "nginx" ports: - containerPort: 80 | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 14
  • 15. Service definition as YAML apiVersion: v1 kind: Service metadata: name: hello-world labels: tier: web spec: # use NodePort here to be able to access the port on each node # use LoadBalancer for external load-balanced IP if supported type: NodePort ports: - port: 80 selector: tier: web | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 15
  • 16. Hello World with Kubernetes $ kubectl cluster-info $ kubectl get nodes $ kubectl run hello-world --image=nginx --replicas=1 --port=80 $ kubectl expose deployment hello-world $ kubectl get deployments,services,pods $ kubectl describe pod [NAME] $ kubectl delete deployment hello-world $ kubectl create -f nginx.yml | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 16
  • 17. Demo time. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 17
  • 18. The Cloud Native Zwitscher Showcase | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 18
  • 19. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 19
  • 20. The source code. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 20
  • 21. Dockerize it! 4 Know your base image!!! 4 The Alpine image is too thin for K8s + Spring. 4 You need Bash, DNS and Java. 4 Use a Server JRE. 4 Better build your own image. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 21
  • 22. Example Dockerfile for Zwitscher Service FROM qaware-oss-docker-registry.bintray.io/base/alpine-k8s-ibmjava8:8.0-3.10 MAINTAINER QAware GmbH <[email protected]> RUN mkdir -p /opt/zwitscher-service COPY build/libs/zwitscher-service-1.1.0.jar /opt/zwitscher-service/zwitscher-service.jar COPY src/main/docker/zwitscher-service.* /opt/zwitscher-service/ RUN chmod 755 /opt/zwitscher-service/zwitscher-service.* EXPOSE 8080 CMD /opt/zwitscher-service/zwitscher-service.sh | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 22
  • 23. Build, test, tag and push Docker images. ... $ docker built -t zwitscher-service:1.1.0 . $ docker-compose up ... $ docker tag zwitscher-service:1.1.0 qaware-oss-docker-registry.bintray.io/zwitscher/zwitscher-service ... $ docker push qaware-oss-docker-registry.bintray.io/zwitscher/zwitscher-service | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 23
  • 24. Kubernetize: single or multi-container pods? | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 24
  • 25. Possible variation using K8s infrastructure. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 25
  • 26. Define a deployment per container. apiVersion: extensions/v1beta1 kind: Deployment metadata: name: zwitscher-service spec: replicas: 1 template: metadata: labels: zwitscher: service spec: containers: - name: zwitscher-service image: "qaware-oss-docker-registry.bintray.io/zwitscher/zwitscher-service:1.1.0" ports: - containerPort: 8080 env: - name: EUREKA_HOST value: zwitscher-eureka | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 26
  • 27. Define a service per deployment. apiVersion: v1 kind: Service metadata: name: zwitscher-service labels: zwitscher: service spec: # use NodePort here to be able to access the port on each node # use LoadBalancer for external load-balanced IP if supported type: NodePort ports: - port: 8080 selector: zwitscher: service | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 27
  • 28. Be careful using resource constraints. resources: # required resources for a Pod to be started requests: memory: "128Mi" cpu: "250m" # the Pod will be restarted if limits are exceeded limits: memory: "192Mi" cpu: "500m" | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 28
  • 29. Use liveness and readiness probes with Actuator. livenessProbe: httpGet: path: /admin/health port: 8080 initialDelaySeconds: 90 timeoutSeconds: 30 readinessProbe: httpGet: path: /admin/info port: 8080 timeoutSeconds: 30 | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 29
  • 30. Use Retry mechanism for fail-fast behavior. # bootstrap.yml spring: application: name: zwitscher-service cloud: config: enabled: true failFast: true retry: initialInterval: 1500 maxInterval: 5000 maxAttempts: 5 multiplier: 1.5 discovery: enabled: true serviceId: ZWITSCHER-CONFIG | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 30
  • 31. Deployment time! $ kubectl create -f zwitscher-eureka/k8s-zwitscher-eureka.yml $ kubectl create -f zwitscher-config/k8s-zwitscher-config.yml $ kubectl create -f zwitscher-service/k8s-zwitscher-service.yml $ kubectl create -f zwitscher-board/k8s-zwitscher-board.yml $ kubectl create -f zwitscher-edge/k8s-zwitscher-edge.yml $ kubectl create -f zwitscher-monitor/k8s-zwitscher-monitor.yml $ kubectl get deployments,pods,services $ kubectl delete -f k8s-zwitscher.yml | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 31
  • 32. Let's have some fun! | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 32
  • 33. The Kubepad in action 4 A MIDI controller 4 Display deployments and pods 4 Scale deployments 4 Written in fancy Kotlin 4 Also works for DC/OS 4 https://github.com/qaware/ kubepad | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 33
  • 34. | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 34
  • 35. Q & A | ContainerCon Europe 2016 | created with ☁ and ☕ by @LeanderReimer 35