SlideShare a Scribd company logo
1 of 22
Download to read offline
One of the most unpolished
Kubernetes introduction
presentations ever given on a
Thursday afternoon from
Freiburg, Germany, ever
Martin Danielsson -- 2017-01-05
Haufe-Lexware GmbH & Co. KG, CTO Office
Twitter: @donmartin76, GitHub: DonMartin76
You might have figured,
this is the Kubernetes logo
Thank you for your attention!
Just kidding.
What is Kubernetes?
“Kubernetes is an open-source platform for automating deployment,
scaling, and operations of application containers across clusters of
hosts, providing container-centric infrastructure.”
http://kubernetes.io/docs/whatisk8s/
Holy smokes!Which means?
What does Kubernetes do?
• Provide a runtime environment for Docker containers
• Scale and load balance docker containers
• Abstract away the infrastructure containers run on
• Monitor/health check containers
• Declarative definition for running containers
• Update containers (also rolling updates)
• Storage mounting (allow abstracting infrastructure)
• Service discovery and exposure
• Labelling and selection of any kind of object (we‘ll get to this)
What does Kubernetes fucking not do?
• Provide any additional services than just Docker
• Compile or build your source code (needs images)
• Provide real orchestration, relies on containers working
independently
• Mandate or provide any kind of special configuration language
• You’re free to do whatever you want
• But: You have to find out a way yourself
Kubernetes =
General Purpose
Platform-as-a-Service (PaaS)
~
Recap - Docker?
Docker Host (e.g. Ubuntu 16.04 LTS)
Container
nginx
Container
node.js App
Container
PostgreSQL
• Docker containers share Kernel with Host
• Many containers can efficiently run on one Host
• Powerful developer tooling
• Dockerfiles are used to build images
• A Docker Registry can store Docker images
• Haufe’s registry.haufe.io
• Official hub.docker.com
• Docker Engine used by Kubernetes under the
hood
• Kubernetes is alternative to Docker Swarm
• Older, more mature
• Used e.g. by GCE (Google Container Engine)
Kubernetes and Docker
• Kubernetes adds functionality to Docker
• Manages a set of Docker Hosts, forming a Cluster
• Takes care of Container scheduling
• Supervises Docker containers
• Kubernetes is replacement/alternative for Docker Swarm
Node
workload
workload
workload
Node
workload
workload
workload
Kubernetes
Master(s)
apiserver
controllers
Node
workload
workload
workload
All blue boxes are Docker Hosts (VMs)
Kubernetes Components are also running as stateless containers!
etcd
(cluster) scheduler
Deployment Architecture
Node 1
Kubernetes Runtime
Pod X
Container
A
Container
B
Pod Y
Container
C
Node 2
Pod Y
Container
C
Pod Z
Container
D
Node 3
Pod Z
Container
D
Pod X
Container
A
Container
B
Deployment
Replica Set
Pod Spec
Abstractions (1) - “Boxes in boxes”
Container
Spec
Container
Spec
Docker image
Environment variables
Storage Claims
Node selector
Service labels
How many Pods should run?
How are updates handled?
Rolling/recreation
Abstractions (2) - Services
Pod
Pod
Pod
Pod
PodService B,
select “B”,
http://ser
vice-b
A
A
A
B
B
Service A,
select “A”
e.g.,
http://ser
vice-a
Abstractions (3) - Other things
• Jobs (one-off containers)
• DaemonSets (one container per node)
• StatefulSet (handles lifetime of pods differently)
Exposing Services (1) - NodePort
Node 1 Node 2 Node 3
Service A
31234 (non-privileged) 31234 31234
Can be used to put an external Load Balancer in front of a service
Exposing Services (2) - LoadBalancer
Node 1 Node 2 Node 3
Service A
• Depends on Cloud Provider (Azure, AWS,…) how this is done
• Will provision a Load Balancer on the cloud provider’s infrastructure
• (e.g. Elastic LB, Azure LB,…)
LB
Exposing Services (3) - Ingress
Kubernetes Cluster
Service A
Service B
Service C
Pod
Pod
Pod
Pod Pod
Pod
Pod
Pod
Pod
…
LB
Ingress
Definition
Ingress
Controller
(SNI, TLS)
• E.g., “route Host x.y.z to Service A”, “Use TLS Certificate abc for host x.y.z”
• Abstract definition of rules
• Implemented by Ingress Controller
• Flexible; leverages “LoadBalancer” on cloud provider
• Can provide SNI (Server Name Indication) and TLS termination
Working with kubectl
$ kubectl apply -f deployment.yml
Created deployment “nginx”
$
Kubernetes
Master(s)
apiserver
scheduler
~/.kube/config
Authentication/
Authorization
• kubectl is a convenient way to talk
to the Kubernetes API
• Uses ~/.kube/config for AuthN/Z
Example kubectl YAML file
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: idesk-mobile-2851
spec:
replicas: 2
# keep the latest three deployments on k8s
revisionHistoryLimit: 3
template:
metadata:
labels:
service: idesk-mobile-2851
feature: "false”
spec:
containers:
- env:
- name: API_GATEWAY_HOST
value: https://api.idesk-apim.haufe-ep.de
- name: CLIENT_ID
value: "ad283bd8273bdbe9a72bdef”
image: "aurora/aurora.mobile.client:v2851”
name: idesk-mobile
ports:
- containerPort: 80
protocol: TCP
restartPolicy: Always
imagePullSecrets:
- name: aurora-registry-haufe-io
$ kubectl apply -f idesk-mobile.yml
Created deployment “idesk-mobile-2851”
$ kubectl get po
NAME READY STATUS RESTARTS AGE
idesk-mobile 1/2 Running 0 10s
$
Container(s)
Pod
Replica Set
Deployment
Example Service YML
apiVersion: v1
kind: Service
metadata:
labels:
service: idesk-mobile-2851
feature: ”true”
name: idesk-mobile-2851
spec:
type: NodePort
ports:
- name: “https”
port: 443
protocol: TCP
targetPort: 443
nodePort: 31851
selector:
service: idesk-mobile-2851
status:
loadBalancer: {}
Reachable over any Agent IP:
https://aurora-k8s.haufe-ep.de:31851
Demo
• Add an nginx Deployment
• Add a service
• Expose service via an Ingress definition
• Kubernetes Dashboard
• Deleting with a selector filter
Example Ingress YML
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx-demo
spec:
rules:
- host: nginx-demo.donmartin76.com
http:
paths:
- path:
backend:
serviceName: nginx-demo
servicePort: 80

More Related Content

What's hot

WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...Brian Grant
 
Continuous delivery of microservices with kubernetes - Quintor 27-2-2017
Continuous delivery of microservices with kubernetes - Quintor 27-2-2017Continuous delivery of microservices with kubernetes - Quintor 27-2-2017
Continuous delivery of microservices with kubernetes - Quintor 27-2-2017Arjen Wassink
 
Kubernetes and Hybrid Deployments
Kubernetes and Hybrid DeploymentsKubernetes and Hybrid Deployments
Kubernetes and Hybrid DeploymentsSandeep Parikh
 
Managing Docker Containers In A Cluster - Introducing Kubernetes
Managing Docker Containers In A Cluster - Introducing KubernetesManaging Docker Containers In A Cluster - Introducing Kubernetes
Managing Docker Containers In A Cluster - Introducing KubernetesMarc Sluiter
 
Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24Sam Zheng
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with KubernetesCarlos Sanchez
 
Containerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to KubernetesContainerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to KubernetesAshley Roach
 
GlueCon kubernetes & container engine
GlueCon kubernetes & container engineGlueCon kubernetes & container engine
GlueCon kubernetes & container enginebrendandburns
 
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 DockerSteve Watt
 
Kubernetes 101 Workshop
Kubernetes 101 WorkshopKubernetes 101 Workshop
Kubernetes 101 WorkshopVishal Biyani
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionStefan Schimanski
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Edureka!
 
Meteor South Bay Meetup - Kubernetes & Google Container Engine
Meteor South Bay Meetup - Kubernetes & Google Container EngineMeteor South Bay Meetup - Kubernetes & Google Container Engine
Meteor South Bay Meetup - Kubernetes & Google Container EngineKit Merker
 
Stateful set in kubernetes implementation & usecases
Stateful set in kubernetes implementation & usecases Stateful set in kubernetes implementation & usecases
Stateful set in kubernetes implementation & usecases Krishna-Kumar
 
Kubernetes - Starting with 1.2
Kubernetes  - Starting with 1.2Kubernetes  - Starting with 1.2
Kubernetes - Starting with 1.2William Stewart
 
Introducing LinuxKit
Introducing LinuxKitIntroducing LinuxKit
Introducing LinuxKitDocker, Inc.
 

What's hot (20)

Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
 
Continuous delivery of microservices with kubernetes - Quintor 27-2-2017
Continuous delivery of microservices with kubernetes - Quintor 27-2-2017Continuous delivery of microservices with kubernetes - Quintor 27-2-2017
Continuous delivery of microservices with kubernetes - Quintor 27-2-2017
 
Kubernetes on aws
Kubernetes on awsKubernetes on aws
Kubernetes on aws
 
Kubernetes and Hybrid Deployments
Kubernetes and Hybrid DeploymentsKubernetes and Hybrid Deployments
Kubernetes and Hybrid Deployments
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Managing Docker Containers In A Cluster - Introducing Kubernetes
Managing Docker Containers In A Cluster - Introducing KubernetesManaging Docker Containers In A Cluster - Introducing Kubernetes
Managing Docker Containers In A Cluster - Introducing Kubernetes
 
Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
Containerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to KubernetesContainerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to Kubernetes
 
GlueCon kubernetes & container engine
GlueCon kubernetes & container engineGlueCon kubernetes & container engine
GlueCon kubernetes & container engine
 
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
 
Kubernetes 101 Workshop
Kubernetes 101 WorkshopKubernetes 101 Workshop
Kubernetes 101 Workshop
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
Meteor South Bay Meetup - Kubernetes & Google Container Engine
Meteor South Bay Meetup - Kubernetes & Google Container EngineMeteor South Bay Meetup - Kubernetes & Google Container Engine
Meteor South Bay Meetup - Kubernetes & Google Container Engine
 
Stateful set in kubernetes implementation & usecases
Stateful set in kubernetes implementation & usecases Stateful set in kubernetes implementation & usecases
Stateful set in kubernetes implementation & usecases
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Kubernetes - Starting with 1.2
Kubernetes  - Starting with 1.2Kubernetes  - Starting with 1.2
Kubernetes - Starting with 1.2
 
Introducing LinuxKit
Introducing LinuxKitIntroducing LinuxKit
Introducing LinuxKit
 

Similar to Kubernetes Intro @HaufeDev

Docker, Atomic Host and Kubernetes.
Docker, Atomic Host and Kubernetes.Docker, Atomic Host and Kubernetes.
Docker, Atomic Host and Kubernetes.Jooho Lee
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Inhye Park
 
Containers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellContainers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellEugene Fedorenko
 
Portable CI/CD Environment as Code with Kubernetes, Kublr and Jenkins
Portable CI/CD Environment as Code with Kubernetes, Kublr and JenkinsPortable CI/CD Environment as Code with Kubernetes, Kublr and Jenkins
Portable CI/CD Environment as Code with Kubernetes, Kublr and JenkinsKublr
 
DevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm WebinarDevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm WebinarCodefresh
 
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, VMwareVMUG IT
 
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 !Anthony Dahanne
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetesDongwon Kim
 
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-finalMichel Schildmeijer
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019Kumton Suttiraksiri
 
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 RaleighBrad Topol
 
Setting up CI/CD Pipeline with Kubernetes and Kublr step by-step
Setting up CI/CD Pipeline with Kubernetes and Kublr step by-stepSetting up CI/CD Pipeline with Kubernetes and Kublr step by-step
Setting up CI/CD Pipeline with Kubernetes and Kublr step by-stepKublr
 
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-stepSetting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-stepOleg Chunikhin
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetescsegayan
 

Similar to Kubernetes Intro @HaufeDev (20)

DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Docker, Atomic Host and Kubernetes.
Docker, Atomic Host and Kubernetes.Docker, Atomic Host and Kubernetes.
Docker, Atomic Host and Kubernetes.
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
 
Adf with docker
Adf with dockerAdf with docker
Adf with docker
 
Containers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellContainers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshell
 
Portable CI/CD Environment as Code with Kubernetes, Kublr and Jenkins
Portable CI/CD Environment as Code with Kubernetes, Kublr and JenkinsPortable CI/CD Environment as Code with Kubernetes, Kublr and Jenkins
Portable CI/CD Environment as Code with Kubernetes, Kublr and Jenkins
 
DevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm WebinarDevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm Webinar
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
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 !
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
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
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
 
Moby KubeCon 2017
Moby KubeCon 2017Moby KubeCon 2017
Moby KubeCon 2017
 
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
 
Setting up CI/CD Pipeline with Kubernetes and Kublr step by-step
Setting up CI/CD Pipeline with Kubernetes and Kublr step by-stepSetting up CI/CD Pipeline with Kubernetes and Kublr step by-step
Setting up CI/CD Pipeline with Kubernetes and Kublr step by-step
 
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-stepSetting up CI/CD pipeline with Kubernetes and Kublr step-by-step
Setting up CI/CD pipeline with Kubernetes and Kublr step-by-step
 
Openshift Workshop
Openshift Workshop Openshift Workshop
Openshift Workshop
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
 
Containers kuberenetes
Containers kuberenetesContainers kuberenetes
Containers kuberenetes
 

More from Haufe-Lexware GmbH & Co KG

X-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackX-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackHaufe-Lexware GmbH & Co KG
 
Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Haufe-Lexware GmbH & Co KG
 
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe-Lexware GmbH & Co KG
 
Cloud Journey: Lifting a Major Product to Kubernetes
Cloud Journey: Lifting a Major Product to KubernetesCloud Journey: Lifting a Major Product to Kubernetes
Cloud Journey: Lifting a Major Product to KubernetesHaufe-Lexware GmbH & Co KG
 
ONA ( organizational network analysis ) to enable individuals to impact their...
ONA ( organizational network analysis ) to enable individuals to impact their...ONA ( organizational network analysis ) to enable individuals to impact their...
ONA ( organizational network analysis ) to enable individuals to impact their...Haufe-Lexware GmbH & Co KG
 
ONA ( organizational network analysis ) enabling individuals to impact their ...
ONA ( organizational network analysis ) enabling individuals to impact their ...ONA ( organizational network analysis ) enabling individuals to impact their ...
ONA ( organizational network analysis ) enabling individuals to impact their ...Haufe-Lexware GmbH & Co KG
 
Using word vectors to enable better search in our legal products
Using word vectors to enable better search in our legal productsUsing word vectors to enable better search in our legal products
Using word vectors to enable better search in our legal productsHaufe-Lexware GmbH & Co KG
 
Identifying customer potentials through unsupervised learning
Identifying customer potentials through unsupervised learningIdentifying customer potentials through unsupervised learning
Identifying customer potentials through unsupervised learningHaufe-Lexware GmbH & Co KG
 
Managing short lived Kubernetes (Production) deployments
Managing short lived Kubernetes (Production) deploymentsManaging short lived Kubernetes (Production) deployments
Managing short lived Kubernetes (Production) deploymentsHaufe-Lexware GmbH & Co KG
 
DevOps Journey of Foundational Services at Haufe
DevOps Journey of Foundational Services at HaufeDevOps Journey of Foundational Services at Haufe
DevOps Journey of Foundational Services at HaufeHaufe-Lexware GmbH & Co KG
 
Microservice Transformation of the Haufe Publishing System
Microservice Transformation of the Haufe Publishing SystemMicroservice Transformation of the Haufe Publishing System
Microservice Transformation of the Haufe Publishing SystemHaufe-Lexware GmbH & Co KG
 

More from Haufe-Lexware GmbH & Co KG (20)

Tech stackhaufegroup
Tech stackhaufegroupTech stackhaufegroup
Tech stackhaufegroup
 
X-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackX-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN Stack
 
Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019
 
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
 
Cloud Journey: Lifting a Major Product to Kubernetes
Cloud Journey: Lifting a Major Product to KubernetesCloud Journey: Lifting a Major Product to Kubernetes
Cloud Journey: Lifting a Major Product to Kubernetes
 
ONA ( organizational network analysis ) to enable individuals to impact their...
ONA ( organizational network analysis ) to enable individuals to impact their...ONA ( organizational network analysis ) to enable individuals to impact their...
ONA ( organizational network analysis ) to enable individuals to impact their...
 
ONA ( organizational network analysis ) enabling individuals to impact their ...
ONA ( organizational network analysis ) enabling individuals to impact their ...ONA ( organizational network analysis ) enabling individuals to impact their ...
ONA ( organizational network analysis ) enabling individuals to impact their ...
 
Using word vectors to enable better search in our legal products
Using word vectors to enable better search in our legal productsUsing word vectors to enable better search in our legal products
Using word vectors to enable better search in our legal products
 
Identifying customer potentials through unsupervised learning
Identifying customer potentials through unsupervised learningIdentifying customer potentials through unsupervised learning
Identifying customer potentials through unsupervised learning
 
Field report: Rapid application development
Field report: Rapid application developmentField report: Rapid application development
Field report: Rapid application development
 
Behavior-Driven Development with JGiven
Behavior-Driven Development with JGivenBehavior-Driven Development with JGiven
Behavior-Driven Development with JGiven
 
Externalized Spring Boot App Configuration
Externalized  Spring Boot App ConfigurationExternalized  Spring Boot App Configuration
Externalized Spring Boot App Configuration
 
Managing short lived Kubernetes (Production) deployments
Managing short lived Kubernetes (Production) deploymentsManaging short lived Kubernetes (Production) deployments
Managing short lived Kubernetes (Production) deployments
 
Docker in Production at the Aurora Team
Docker in Production at the Aurora TeamDocker in Production at the Aurora Team
Docker in Production at the Aurora Team
 
DevOps Journey of Foundational Services at Haufe
DevOps Journey of Foundational Services at HaufeDevOps Journey of Foundational Services at Haufe
DevOps Journey of Foundational Services at Haufe
 
New Serverless World - Cloud Native Apps
New Serverless World - Cloud Native AppsNew Serverless World - Cloud Native Apps
New Serverless World - Cloud Native Apps
 
Microservice Transformation of the Haufe Publishing System
Microservice Transformation of the Haufe Publishing SystemMicroservice Transformation of the Haufe Publishing System
Microservice Transformation of the Haufe Publishing System
 
Haufe API Strategy
Haufe API StrategyHaufe API Strategy
Haufe API Strategy
 
Haufe's Tech Strategy In Practice
Haufe's Tech Strategy In PracticeHaufe's Tech Strategy In Practice
Haufe's Tech Strategy In Practice
 
API Management with wicked.haufe.io
API Management with wicked.haufe.ioAPI Management with wicked.haufe.io
API Management with wicked.haufe.io
 

Kubernetes Intro @HaufeDev

  • 1. One of the most unpolished Kubernetes introduction presentations ever given on a Thursday afternoon from Freiburg, Germany, ever Martin Danielsson -- 2017-01-05 Haufe-Lexware GmbH & Co. KG, CTO Office Twitter: @donmartin76, GitHub: DonMartin76
  • 2. You might have figured, this is the Kubernetes logo
  • 3. Thank you for your attention! Just kidding.
  • 4. What is Kubernetes? “Kubernetes is an open-source platform for automating deployment, scaling, and operations of application containers across clusters of hosts, providing container-centric infrastructure.” http://kubernetes.io/docs/whatisk8s/ Holy smokes!Which means?
  • 5. What does Kubernetes do? • Provide a runtime environment for Docker containers • Scale and load balance docker containers • Abstract away the infrastructure containers run on • Monitor/health check containers • Declarative definition for running containers • Update containers (also rolling updates) • Storage mounting (allow abstracting infrastructure) • Service discovery and exposure • Labelling and selection of any kind of object (we‘ll get to this)
  • 6. What does Kubernetes fucking not do? • Provide any additional services than just Docker • Compile or build your source code (needs images) • Provide real orchestration, relies on containers working independently • Mandate or provide any kind of special configuration language • You’re free to do whatever you want • But: You have to find out a way yourself
  • 8. Recap - Docker? Docker Host (e.g. Ubuntu 16.04 LTS) Container nginx Container node.js App Container PostgreSQL • Docker containers share Kernel with Host • Many containers can efficiently run on one Host • Powerful developer tooling • Dockerfiles are used to build images • A Docker Registry can store Docker images • Haufe’s registry.haufe.io • Official hub.docker.com • Docker Engine used by Kubernetes under the hood • Kubernetes is alternative to Docker Swarm • Older, more mature • Used e.g. by GCE (Google Container Engine)
  • 9. Kubernetes and Docker • Kubernetes adds functionality to Docker • Manages a set of Docker Hosts, forming a Cluster • Takes care of Container scheduling • Supervises Docker containers • Kubernetes is replacement/alternative for Docker Swarm
  • 10. Node workload workload workload Node workload workload workload Kubernetes Master(s) apiserver controllers Node workload workload workload All blue boxes are Docker Hosts (VMs) Kubernetes Components are also running as stateless containers! etcd (cluster) scheduler Deployment Architecture
  • 11. Node 1 Kubernetes Runtime Pod X Container A Container B Pod Y Container C Node 2 Pod Y Container C Pod Z Container D Node 3 Pod Z Container D Pod X Container A Container B
  • 12. Deployment Replica Set Pod Spec Abstractions (1) - “Boxes in boxes” Container Spec Container Spec Docker image Environment variables Storage Claims Node selector Service labels How many Pods should run? How are updates handled? Rolling/recreation
  • 13. Abstractions (2) - Services Pod Pod Pod Pod PodService B, select “B”, http://ser vice-b A A A B B Service A, select “A” e.g., http://ser vice-a
  • 14. Abstractions (3) - Other things • Jobs (one-off containers) • DaemonSets (one container per node) • StatefulSet (handles lifetime of pods differently)
  • 15. Exposing Services (1) - NodePort Node 1 Node 2 Node 3 Service A 31234 (non-privileged) 31234 31234 Can be used to put an external Load Balancer in front of a service
  • 16. Exposing Services (2) - LoadBalancer Node 1 Node 2 Node 3 Service A • Depends on Cloud Provider (Azure, AWS,…) how this is done • Will provision a Load Balancer on the cloud provider’s infrastructure • (e.g. Elastic LB, Azure LB,…) LB
  • 17. Exposing Services (3) - Ingress Kubernetes Cluster Service A Service B Service C Pod Pod Pod Pod Pod Pod Pod Pod Pod … LB Ingress Definition Ingress Controller (SNI, TLS) • E.g., “route Host x.y.z to Service A”, “Use TLS Certificate abc for host x.y.z” • Abstract definition of rules • Implemented by Ingress Controller • Flexible; leverages “LoadBalancer” on cloud provider • Can provide SNI (Server Name Indication) and TLS termination
  • 18. Working with kubectl $ kubectl apply -f deployment.yml Created deployment “nginx” $ Kubernetes Master(s) apiserver scheduler ~/.kube/config Authentication/ Authorization • kubectl is a convenient way to talk to the Kubernetes API • Uses ~/.kube/config for AuthN/Z
  • 19. Example kubectl YAML file apiVersion: extensions/v1beta1 kind: Deployment metadata: name: idesk-mobile-2851 spec: replicas: 2 # keep the latest three deployments on k8s revisionHistoryLimit: 3 template: metadata: labels: service: idesk-mobile-2851 feature: "false” spec: containers: - env: - name: API_GATEWAY_HOST value: https://api.idesk-apim.haufe-ep.de - name: CLIENT_ID value: "ad283bd8273bdbe9a72bdef” image: "aurora/aurora.mobile.client:v2851” name: idesk-mobile ports: - containerPort: 80 protocol: TCP restartPolicy: Always imagePullSecrets: - name: aurora-registry-haufe-io $ kubectl apply -f idesk-mobile.yml Created deployment “idesk-mobile-2851” $ kubectl get po NAME READY STATUS RESTARTS AGE idesk-mobile 1/2 Running 0 10s $ Container(s) Pod Replica Set Deployment
  • 20. Example Service YML apiVersion: v1 kind: Service metadata: labels: service: idesk-mobile-2851 feature: ”true” name: idesk-mobile-2851 spec: type: NodePort ports: - name: “https” port: 443 protocol: TCP targetPort: 443 nodePort: 31851 selector: service: idesk-mobile-2851 status: loadBalancer: {} Reachable over any Agent IP: https://aurora-k8s.haufe-ep.de:31851
  • 21. Demo • Add an nginx Deployment • Add a service • Expose service via an Ingress definition • Kubernetes Dashboard • Deleting with a selector filter
  • 22. Example Ingress YML apiVersion: extensions/v1beta1 kind: Ingress metadata: name: nginx-demo spec: rules: - host: nginx-demo.donmartin76.com http: paths: - path: backend: serviceName: nginx-demo servicePort: 80