SlideShare a Scribd company logo
Kubernetes on AWS
@ZalandoTech
AWS BERLIN USER GROUP
2017-05-09
HENNING JACOBS
@try_except_
2
ZALANDO
15 markets
6 fulfillment centers
20 million active customers
3.6 billion € net sales 2016
165 million visits per month
12,000 employees in Europe
3
ZALANDO TECHNOLOGY
HOME-BREWED,
CUTTING-EDGE
& SCALABLE
technology solutions
>1,600
employees from
tech locations
+ HQs in Berlin6
77
nations
help our brand to
WIN ONLINE
4
KUBERNETES ON AWS: CONTEXT
200 engineering teams
30 prod. clusters
AWS
Dockerized apps
No manual operations
Reliability
Autoscaling
Seamless migration
5
ARCHITECTURE
6
ISOLATED AWS ACCOUNTS
Internet
*.abc.example.org *.xyz.example.org
Product ABC Product XYZ
EC2
LBLB
7
KUBERNETES ON AWS
8
CLUSTER PROVISIONING
9
CLUSTER PROVISIONING
• Two Cloud Formation stacks
• Master & worker ASGs + etcd
• Nodes w/ Container Linux
• K8s manifests applied separately
• kube-system Deployments
• DaemonSets
10
DEPLOYMENT
11
DEPLOYMENT CONFIGURATION
.
├── apply
│ ├── credentials.yaml # K8s TPR
│ ├── ingress.yaml # K8s Ingress
│ ├── redis-deployment.yaml # K8s Deployment
│ ├── redis-service.yaml # K8s Service
│ └── service.yaml # K8s Service
├── deployment.yaml # K8s Deployment
└── pipeline.yaml # proprietary config
12
JENKINS DEPLOY PIPELINE
13
INGRESS
14
INGRESS.YAML
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: "..."
spec:
rules:
# DNS name your application should be exposed on
- host: "myapp.foo.example.org"
http:
paths:
- backend:
serviceName: "{{ application }}"
servicePort: 80
15
INGRESS CONTROLLER
https://github.com/zalando-incubator/kube-ingress-aws-controller / https://github.com/kubernetes-incubator/external-dns
16
AWS INTEGRATION
17
CLOUD FORMATION VIA CI/CD
.
├── apply
│ ├── cf-iam-role.yaml # AWS IAM Role
│ ├── cf-rds.yaml # AWS RDS Database
│ ├── kube-ingress.yaml # K8s Ingress
│ ├── kube-secret.yaml # K8s Secret
│ └── kube-service.yaml # K8s Service
├── deployment.yaml # K8s Deployment
└── pipeline.yaml # CI/CD config
18
ASSIGNING AWS IAM ROLE TO POD
kind: Deployment
spec:
template:
metadata:
annotations:
# annotation for kube2iam
iam.amazonaws.com/role: "app-{{ application }}-1"
spec:
containers:
- name: ...
...
https://github.com/jtblin/kube2iam
⇒ AWS SDKs just work as expected
19
CLUSTER
AUTOSCALING
20
CLUSTER AUTOSCALING
Control # of worker nodes in ASG:
• Satisfy all resource requests
• One spare node per AZ
• No manual config “tweaking”
• Scale down, but not too fast
21
CURRENT SETUP
• https://github.com/hjacobs/kube-aws-autoscaler
• Node draining via systemd unit
Open topic: node “readiness” during scale out
Kubernetes on AWS @Zalando - Berlin AWS User Group 2017-05-09
23
OAUTH / IAM
INTEGRATION
24
DECLARING NEEDED CREDENTIALS
# apply/credentials.yaml
apiVersion: "zalando.org/v1"
kind: PlatformCredentialsSet
metadata:
name: "..."
spec:
tokens: # OAuth service tokens
mytok:
privileges:
- com.zalando::foobar.write
clients: # OAuth clients
implicit:
grant: implicit # grant type according to RFC-6749
realm: users
redirectUri: https://myapp.foo.example.org/oauth
⇒ TPRs FTW
25
MOUNTING THE OAUTH CREDENTIALS
kind: Deployment
spec:
template:
spec:
containers:
- name: ...
...
volumeMounts:
- name: "..."
mountPath: /meta/credentials
readOnly: true
volumes:
- name: "..."
secret:
secretName: "..."
26
USING THE OAUTH CREDENTIALS
#!/bin/bash
type=$(cat /meta/credentials/mytok-token-type)
secret=$(cat /meta/credentials/mytok-token-secret)
curl -H "Authorization: $type $secret" 
https://resource-server.example.org/protected
27
POSTGRESQL
28
POSTGRESQL ON KUBERNETES
• StatefulSet + PV (EBS)
• Spilo/Patroni
• PostgreSQL Operator
• ThirdPartyResources
https://github.com/zalando/spilo https://github.com/zalando/patroni
29
WHY NOT RDS?
• Logical Replication
• Outbound Streaming Replication
• Heterogeneous Replicas
• Custom Extensions
• Real Superuser
• OAuth Login
NB: we also use RDS
and it works great!
30
OPERATIONS
31
CLUSTER
UPDATES
32
LIMIT RANGE
kubectl describe limitrange
Name: limits
Namespace: default
Type Resource Min Max Default Req Default Limit Max Limit/Request Ratio
---- -------- --- --- ----------- ------------- -----------------------
Container memory - 64Gi 100Mi 1Gi -
Container cpu - 16 100m 3 -
http://kubernetes-on-aws.readthedocs.io/en/latest/admin-guide/kubernetes-in-production.html#resources
⇒ Mitigate errors on OSI layer 8 ;-)
https://github.com/hjacobs/kube-ops-view
34
KUBERNETES
VS.
AWS ECS
35
AWS API
Tasks, Services
Static AWS API
Blox
Operating worker nodes
Vendor community/support
AWS only
KUBERNETES VS. AWS ECS
Declarative API (fast & no rate limits)
High level abstractions (Ingress, CronJob)
Extensible API (e.g. TPR)
Batteries included (DaemonSet, StatefulSet)
Operating etcd, master & worker nodes
Huge community
Run anywhere
⟺
⟺
⟺
⟺
⟺
⟺
⟺
disclaimer: incomplete and opinionated ;-)
36
OPEN SOURCE
37
LINKS
Running Kubernetes in Production on AWS
http://kubernetes-on-aws.readthedocs.io/en/latest/admin-guide/kubernetes-in-production.html
Kube AWS Ingress Controller
https://github.com/zalando-incubator/kube-ingress-aws-controller
External DNS
https://github.com/kubernetes-incubator/external-dns
Zalando Cluster Configuration
https://github.com/zalando-incubator/kubernetes-on-aws
List of Organizations using Kubernetes on AWS
https://github.com/hjacobs/kubernetes-on-aws-users
QUESTIONS?
HENNING JACOBS
TECH INFRASTRUCTURE
CLOUD ENGINEER
henning@zalando.de
@try_except_
Illustrations by @01k

More Related Content

PDF
Kubernetes at Zalando - CNCF End User Committee Presentation
PDF
From AWS/STUPS to Kubernetes on AWS @Zalando - Berlin Kubernetes Meetup
PDF
Kubernetes on AWS at Europe's Leading Online Fashion Platform
PDF
Plan B: Service to Service Authentication with OAuth
PDF
API First with Connexion - PyConWeb 2018
PDF
Developer Journey at Zalando - Idea to Production with Containers in the Clou...
PDF
STUPS by Zalando @WHD.local Frankfurt: STUPS.io - an Open Source Cloud Framew...
PDF
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - C...
Kubernetes at Zalando - CNCF End User Committee Presentation
From AWS/STUPS to Kubernetes on AWS @Zalando - Berlin Kubernetes Meetup
Kubernetes on AWS at Europe's Leading Online Fashion Platform
Plan B: Service to Service Authentication with OAuth
API First with Connexion - PyConWeb 2018
Developer Journey at Zalando - Idea to Production with Containers in the Clou...
STUPS by Zalando @WHD.local Frankfurt: STUPS.io - an Open Source Cloud Framew...
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - C...

What's hot (20)

PDF
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...
PDF
05.10.2017 AWS User Group Meetup - FALLACIES OF DISTRIBUTED COMPUTING WITH KU...
PDF
Kubernetes on AWS at Zalando: Failures & Learnings - DevOps NRW
PDF
18.09.2017 Clojure Meetup - PATH TO MICROSERVICES
PPTX
How do we use Kubernetes
PDF
Kubernetes on AWS
PDF
ZMON: Monitoring Zalando's Engineering Platform
PPTX
ITGM#14 - How do we use Kubernetes in Zalando
PDF
Kubernetes on AWS @ Zalando Tech
PDF
Docker Berlin Meetup Nov 2015: Zalando Intro
PDF
Zero to Serverless in 60s - Anywhere
PDF
Paris Container Day 2016 : Running docker clusters on AWS (Amazon Web Services)
PDF
Universal JavaScript - Frontend United Athens 2017
PDF
DevOps and Hybrid Applications: What You Need to Know
PDF
STUPS by Zalando @ AWS User Group Ireland Meet Up September 2015
PDF
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
PDF
AWS ElasticBeanstalk and Docker
PDF
Introduction to IBM Bluemix
PDF
[Workshop] "Vuetify in practice", Alexander Stepanov
PDF
Serverless architecture: introduction & first steps
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...
05.10.2017 AWS User Group Meetup - FALLACIES OF DISTRIBUTED COMPUTING WITH KU...
Kubernetes on AWS at Zalando: Failures & Learnings - DevOps NRW
18.09.2017 Clojure Meetup - PATH TO MICROSERVICES
How do we use Kubernetes
Kubernetes on AWS
ZMON: Monitoring Zalando's Engineering Platform
ITGM#14 - How do we use Kubernetes in Zalando
Kubernetes on AWS @ Zalando Tech
Docker Berlin Meetup Nov 2015: Zalando Intro
Zero to Serverless in 60s - Anywhere
Paris Container Day 2016 : Running docker clusters on AWS (Amazon Web Services)
Universal JavaScript - Frontend United Athens 2017
DevOps and Hybrid Applications: What You Need to Know
STUPS by Zalando @ AWS User Group Ireland Meet Up September 2015
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
AWS ElasticBeanstalk and Docker
Introduction to IBM Bluemix
[Workshop] "Vuetify in practice", Alexander Stepanov
Serverless architecture: introduction & first steps
Ad

Similar to Kubernetes on AWS @Zalando - Berlin AWS User Group 2017-05-09 (20)

PDF
12.07.2017 Docker Meetup - KUBERNETES ON AWS @ ZALANDO TECH
PDF
How Zalando runs Kubernetes clusters at scale on AWS - AWS re:Invent
PDF
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
PDF
Application Lifecycle Management on AWS
PPTX
The Challenges of Becoming Cloud Native
PPTX
Webinar: Dealing with automation tool overload!
PDF
Building serverless apps with Node.js
PDF
Kaleido Platform Overview and Full-stack Blockchain Services
PDF
Powering Radical Agility with Docker
PDF
HOW TO DRONE.IO IN CI/CD WORLD
PDF
Developing and deploying serverless applications (February 2017)
PPTX
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
PPTX
Scheduled Retweets Using AWS Lambda
PPTX
Auto Retweets Using AWS Lambda
PPTX
DevOps, Microservices and Serverless Architecture
PDF
AWS Serverless Workshop
PDF
Developer Experience at Zalando - CNCF End User SIG-DX
PDF
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
PPTX
Kube journey 2017-04-19
PDF
Scaling .net containers with event driven workloads
12.07.2017 Docker Meetup - KUBERNETES ON AWS @ ZALANDO TECH
How Zalando runs Kubernetes clusters at scale on AWS - AWS re:Invent
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Application Lifecycle Management on AWS
The Challenges of Becoming Cloud Native
Webinar: Dealing with automation tool overload!
Building serverless apps with Node.js
Kaleido Platform Overview and Full-stack Blockchain Services
Powering Radical Agility with Docker
HOW TO DRONE.IO IN CI/CD WORLD
Developing and deploying serverless applications (February 2017)
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
Scheduled Retweets Using AWS Lambda
Auto Retweets Using AWS Lambda
DevOps, Microservices and Serverless Architecture
AWS Serverless Workshop
Developer Experience at Zalando - CNCF End User SIG-DX
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
Kube journey 2017-04-19
Scaling .net containers with event driven workloads
Ad

More from Henning Jacobs (17)

PDF
Open Source at Zalando - OSB Open Source Day 2019
PDF
Why I love Kubernetes Failure Stories and you should too - GOTO Berlin
PDF
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
PDF
Kubernetes + Python = ❤ - Cloud Native Prague
PDF
Kubernetes Failure Stories, or: How to Crash Your Cluster - ContainerDays EU ...
PDF
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
PDF
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
PDF
Kubernetes Failure Stories - KubeCon Europe Barcelona
PDF
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
PDF
Ensuring Kubernetes Cost Efficiency across (many) Clusters - DevOps Gathering...
PDF
Let's talk about Failures with Kubernetes - Hamburg Meetup
PDF
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
PDF
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - DevO...
PDF
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
PDF
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...
PDF
STUPS @ AWS Enterprise Web Day Oktober 2015
PDF
Python at Zalando Technology @ Python Users Berlin Meetup September 2015
Open Source at Zalando - OSB Open Source Day 2019
Why I love Kubernetes Failure Stories and you should too - GOTO Berlin
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
Kubernetes + Python = ❤ - Cloud Native Prague
Kubernetes Failure Stories, or: How to Crash Your Cluster - ContainerDays EU ...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Kubernetes Failure Stories - KubeCon Europe Barcelona
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
Ensuring Kubernetes Cost Efficiency across (many) Clusters - DevOps Gathering...
Let's talk about Failures with Kubernetes - Hamburg Meetup
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - DevO...
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...
STUPS @ AWS Enterprise Web Day Oktober 2015
Python at Zalando Technology @ Python Users Berlin Meetup September 2015

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Empathic Computing: Creating Shared Understanding
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
Mobile App Security Testing_ A Comprehensive Guide.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Network Security Unit 5.pdf for BCA BBA.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation
MIND Revenue Release Quarter 2 2025 Press Release
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks
A comparative analysis of optical character recognition models for extracting...
Advanced methodologies resolving dimensionality complications for autism neur...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars

Kubernetes on AWS @Zalando - Berlin AWS User Group 2017-05-09