SlideShare a Scribd company logo
K8s on AWS:
Holy Grail --- or --- Holy Moly ?
Meetup Zurich , Feb 2019
About Me
● BigData & Cloud Engineer/Consultant at
○ Hadoop, Kafka, AWS, Azure, Openshift
● OpenSource enthusiast
● Udemy instructor
You can find me on
● LinkedIn: https://www.linkedin.com/in/gerdkoenig
● GitHub: https://github.com/gkoenig/
● Twitter: https://twitter.com/gerd_koenig
Meetup Zurich , Feb 2019
Topics
1. K8s core components
...and how they are implemented in EKS
2. Setting up an EKS cluster
3. User authentication (IAM) / authorization (RBAC)
4. Network Overlay
5. Network policies by Calico
6. Persistent Volumes
7. Scaling worker nodes...incl Spot Instances
Meetup Zurich , Feb 2019
K8s core components
Master Nodes (Control Plane)
“Brain” of the cluster
Worker Nodes (Data Plane)
Container execution
Communication
API-server ⇔ kubelet
Meetup Zurich , Feb 2019
K8s core components….in EKS
AZ B AZ CAZ A
AWSMANAGED
Master Node Master Node
Etcd Etcd Etcd
Master Node
K8s worker nodes K8s worker nodes K8s worker nodes
USER
Shared responsibility:
● Control Plane/Masters
=> AWS
● Data Plane/Workers
=> User
Control Plane
● HA setup, multi AZ
● Built upon
EC2,ELB,ASG,NLB,VPC
Source:https://www.udemy.com/amazon-eks-starter-kubernetes-on-aws/
Meetup Zurich , Feb 2019
Setting up EKS
● Provision Control Plane
○ via eksctl/CloudFormation/AWS
console/aws-cli
○ Creates VPC/EC2/LB, assigns current IAM
user the K8s master role
● Launch worker nodes
○ In ASG
○ across AZs
● Configure tools to talk to your cluster
○ kubectl, incl aws-iam-authenticator
● Deploy your K8s apps
…… P A R T Y
Meetup Zurich , Feb 2019
Setting up EKS
Lets get our hands dirty
….and quickly explore a running EKS
Meetup Zurich , Feb 2019
User authentication (IAM) / authorization (RBAC)
...exclusively managed by IAM
IAM policy attached to user/group
E.g. grant all EKS access
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"eks:*"
],
"Resource": "*"
}
]
}
IAM role, assumed by EKS, to access
other resources on your behalf
...exclusively managed by K8s RBAC, not
EKS specific
RBAC primitives:
Subjects Operations
Resources
Who can do what
where
!!
the user you used to create EKS cluster is
hardwired into system:masters group,
hence he can perform all activities
&
Authentication Authorization
Meetup Zurich , Feb 2019
User authentication (IAM) / authorization (RBAC)
● Authentication is held by IAM
● Authorization is done by
Kubernetes RBAC (native auth
for K8s)
● This is done through a
collaboration done between
AWS and Heptio
● You can assign RBAC directly to
IAM entities!
● By default, the role you assign to
your K8s cluster has
system:master permissions
> kubectl IAM
Kubernetes
RBAC
2. Verify AWS
Identity
3. Authorize AWS Identity
With Kubernetes RBAC
1. Send AWS
Identity
4. Allow / Deny
Meetup Zurich , Feb 2019
Network Overlay
Source:https://itnext.io/kubernetes-is-hard-why-eks-makes-it-easier-for-network-and-security-
architects-ea6d8b2ca965
VPC CNI plugin
● Pods running in same IP space
as host (subnet of VPC), no
additional vNIC
● ENIs will be attached to EC2
workers on demand (as no of
pods grows)
● !! EC2 instance type limits max
number of pods per host
(=no of ENIs * max IPs per
Interface)
https://docs.aws.amazon.com/AWSEC2/latest/UserGui
de/using-eni.html#AvailableIpPerENI
● IPs of ENIs are pre-warmed,
ensure to have a big enough
VPC
Meetup Zurich , Feb 2019
Networking policies via Calico
Project Calico => OpenSource tool to limit network traffic flow based on specified policies
Not just K8s, also DockerEE/OpenStack/bare-metal
Calico on top of AWS-VPC-CNI to limit access in 2-Tier-app
https://www.projectcalico.org
Client
Backend
Frontend
namespace
Lets get our hands even dirtier
Meetup Zurich , Feb 2019
Persistent Volumes
Deploying stateful apps => persistent volumes
● Block storage
● attached to one EC2 instance
● Can be re-attached, e.g. on EC2
failure
● use ReplicaSet over Deployment
● an EBS vol. lives just in one AZ
When to use?
Apps w/ local storage, not shared across app-instances
● Shared filesystem
● NFS
● Multi read/write
● Multi AZ availability
When to use?
Apps with storage shared across app-instances and
AZs
PV-1
(EBS)
PV-3
(EBS)
PV-2
(EBS)
Node 1 Node 2
Pod 1
Pod 3
Pod 2
EFS
Security Group
Node 1 Node 2
Pod 1
Pod 3
Pod 2
Meetup Zurich , Feb 2019
Persistent Volumes
Sample Scenario using EFS & EBS: Deploy Wordpress & MySQL
MySQL pod
...
Node 1 Node 2
Elastic filesystem (EFS)
EFS provisioner
storageclass
pvc mysql
Pvc
wordpress
EK
S
EFS
/EB
S
WP pod
WP pod
WP pod
EBS provisioner
storageclass
Elastic block store (EBS)
Meetup Zurich , Feb 2019
Scaling worker nodes...incl Spot Instances
● By default worker nodes are made of on-demand EC2 instances
● Spot Instances are ways cheaper and a good fit to scale your cluster and cover
peaks, but: they can be terminated by AWS with short notice time
● Since Nov 2018: mixed types of EC2 instances in same ASG possible
Spot + OnDemand && different sizing
● Node labelling required for intelligent scheduling to On-demand vs SpotInstance
● Additional _taints_ to further select where to run
● Quick Demo:
Run sample deployment , which prefers pods on
SpotInstances but does not require it
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: lifecycle
operator: In
values:
- Ec2Spot
tolerations:
- key: "spotInstance"
operator: "Equal"
value: "true"
effect: "PreferNoSchedule"
Meetup Zurich , Feb 2019
<= ? =>
HA Control Plane managed by AWS
Runs certified, upstream K8s
So what ?
May be overwhelming if new to AWS
Instance type limits no of Pods
(=>ENI)
Meetup Zurich , Feb 2019
Thank You !!!

More Related Content

PPTX
AWS EKS: Amazon Manages Kubernetes
PPTX
AWS EKS Security Best Practices
PDF
Introduction to EKS (AWS User Group Slovakia)
PDF
Introduction to EKS and eksctl
PDF
AWS CDK Introduction
PPTX
Docker best practices
PPTX
Eks and fargate
PDF
AWS ECS vs EKS
AWS EKS: Amazon Manages Kubernetes
AWS EKS Security Best Practices
Introduction to EKS (AWS User Group Slovakia)
Introduction to EKS and eksctl
AWS CDK Introduction
Docker best practices
Eks and fargate
AWS ECS vs EKS

What's hot (15)

PDF
Amazon EKS - Aws community day bengaluru 2019
PDF
Monoliths to Microservices - Madhu - AWS - CC18
PDF
IaC로 AWS인프라 관리하기 - 이진성 (AUSG) :: AWS Community Day Online 2021
PDF
Containers Meetup (AWS+CNCF) Milano Jan 15th 2020
PDF
IDI 2022: Making sense of the '17 ways to run containers on AWS'
PDF
Keynote @ IoT World Paris
PDF
Getting Started on Amazon EKS
PDF
AWS Community Day - Andrew May - Running Containers in AWS
PDF
A 60-mn tour of AWS compute (March 2016)
PPTX
Amazon EKS Deep Dive
PPTX
Amazon Elastic Container Service (ECS)
PDF
Riot Games 글로벌 게임 운영을 위한 Docker 및 Amazon ECS 활용사례 - AWS Summit Seoul 2017
PDF
AWS CDK introduction
PDF
Amazon EKS Managed Kubernetes Cluster
PPTX
AWS CDK: Your Infrastructure is Code!
Amazon EKS - Aws community day bengaluru 2019
Monoliths to Microservices - Madhu - AWS - CC18
IaC로 AWS인프라 관리하기 - 이진성 (AUSG) :: AWS Community Day Online 2021
Containers Meetup (AWS+CNCF) Milano Jan 15th 2020
IDI 2022: Making sense of the '17 ways to run containers on AWS'
Keynote @ IoT World Paris
Getting Started on Amazon EKS
AWS Community Day - Andrew May - Running Containers in AWS
A 60-mn tour of AWS compute (March 2016)
Amazon EKS Deep Dive
Amazon Elastic Container Service (ECS)
Riot Games 글로벌 게임 운영을 위한 Docker 및 Amazon ECS 활용사례 - AWS Summit Seoul 2017
AWS CDK introduction
Amazon EKS Managed Kubernetes Cluster
AWS CDK: Your Infrastructure is Code!
Ad

Similar to Kubernetes on AWS => EKS || CNCF Meetup Zurich, Feb 2019 (20)

PDF
Amazon Elastic Kubernetes Service (EKS) From Zero to Day 1
PPTX
Meetup CNCF Torino - Amazon EKS March 29th 2019
PDF
Max Körbächer - AWS EKS and beyond – master your Kubernetes deployment on AWS...
PDF
Max Körbächer - AWS EKS and beyond master your Kubernetes deployment on AWS -...
PDF
kubernetes on awsjourneryssdddddddddddddd
PPTX
Running kubernetes with amazon eks
PDF
EKS Workshop
PPTX
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
PPTX
EKS AWS Presentation kuberneted oriented
PPTX
Kubernetes security with AWS
PDF
Amazon EKS - security best practices - 2022
PDF
게임 고객사를 위한 ‘AWS 컨테이너 교육’ 자료 - 유재석 솔루션즈 아키텍트, AWS :: Gaming Immersion Day 201...
PPTX
Kubernetes-Fundamentals.pptx
PDF
Aws container services overview
PDF
What Is AWS Elastic Kubernetes Service
PPTX
EKS New features - Re:invent 2022 recap at AWSUGNL Benelux
PDF
Operationalizing Amazon EKS
PDF
Lessons learned migrating 100+ services to Kubernetes
PPTX
Demystifying Kubernetes Security using AWS EKS
PDF
Managing Containers on AWS
Amazon Elastic Kubernetes Service (EKS) From Zero to Day 1
Meetup CNCF Torino - Amazon EKS March 29th 2019
Max Körbächer - AWS EKS and beyond – master your Kubernetes deployment on AWS...
Max Körbächer - AWS EKS and beyond master your Kubernetes deployment on AWS -...
kubernetes on awsjourneryssdddddddddddddd
Running kubernetes with amazon eks
EKS Workshop
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
EKS AWS Presentation kuberneted oriented
Kubernetes security with AWS
Amazon EKS - security best practices - 2022
게임 고객사를 위한 ‘AWS 컨테이너 교육’ 자료 - 유재석 솔루션즈 아키텍트, AWS :: Gaming Immersion Day 201...
Kubernetes-Fundamentals.pptx
Aws container services overview
What Is AWS Elastic Kubernetes Service
EKS New features - Re:invent 2022 recap at AWSUGNL Benelux
Operationalizing Amazon EKS
Lessons learned migrating 100+ services to Kubernetes
Demystifying Kubernetes Security using AWS EKS
Managing Containers on AWS
Ad

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Electronic commerce courselecture one. Pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Review of recent advances in non-invasive hemoglobin estimation
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
20250228 LYD VKU AI Blended-Learning.pptx
Understanding_Digital_Forensics_Presentation.pptx
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
Spectral efficient network and resource selection model in 5G networks
Electronic commerce courselecture one. Pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The AUB Centre for AI in Media Proposal.docx
Review of recent advances in non-invasive hemoglobin estimation

Kubernetes on AWS => EKS || CNCF Meetup Zurich, Feb 2019

  • 1. K8s on AWS: Holy Grail --- or --- Holy Moly ?
  • 2. Meetup Zurich , Feb 2019 About Me ● BigData & Cloud Engineer/Consultant at ○ Hadoop, Kafka, AWS, Azure, Openshift ● OpenSource enthusiast ● Udemy instructor You can find me on ● LinkedIn: https://www.linkedin.com/in/gerdkoenig ● GitHub: https://github.com/gkoenig/ ● Twitter: https://twitter.com/gerd_koenig
  • 3. Meetup Zurich , Feb 2019 Topics 1. K8s core components ...and how they are implemented in EKS 2. Setting up an EKS cluster 3. User authentication (IAM) / authorization (RBAC) 4. Network Overlay 5. Network policies by Calico 6. Persistent Volumes 7. Scaling worker nodes...incl Spot Instances
  • 4. Meetup Zurich , Feb 2019 K8s core components Master Nodes (Control Plane) “Brain” of the cluster Worker Nodes (Data Plane) Container execution Communication API-server ⇔ kubelet
  • 5. Meetup Zurich , Feb 2019 K8s core components….in EKS AZ B AZ CAZ A AWSMANAGED Master Node Master Node Etcd Etcd Etcd Master Node K8s worker nodes K8s worker nodes K8s worker nodes USER Shared responsibility: ● Control Plane/Masters => AWS ● Data Plane/Workers => User Control Plane ● HA setup, multi AZ ● Built upon EC2,ELB,ASG,NLB,VPC Source:https://www.udemy.com/amazon-eks-starter-kubernetes-on-aws/
  • 6. Meetup Zurich , Feb 2019 Setting up EKS ● Provision Control Plane ○ via eksctl/CloudFormation/AWS console/aws-cli ○ Creates VPC/EC2/LB, assigns current IAM user the K8s master role ● Launch worker nodes ○ In ASG ○ across AZs ● Configure tools to talk to your cluster ○ kubectl, incl aws-iam-authenticator ● Deploy your K8s apps …… P A R T Y
  • 7. Meetup Zurich , Feb 2019 Setting up EKS Lets get our hands dirty ….and quickly explore a running EKS
  • 8. Meetup Zurich , Feb 2019 User authentication (IAM) / authorization (RBAC) ...exclusively managed by IAM IAM policy attached to user/group E.g. grant all EKS access { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "eks:*" ], "Resource": "*" } ] } IAM role, assumed by EKS, to access other resources on your behalf ...exclusively managed by K8s RBAC, not EKS specific RBAC primitives: Subjects Operations Resources Who can do what where !! the user you used to create EKS cluster is hardwired into system:masters group, hence he can perform all activities & Authentication Authorization
  • 9. Meetup Zurich , Feb 2019 User authentication (IAM) / authorization (RBAC) ● Authentication is held by IAM ● Authorization is done by Kubernetes RBAC (native auth for K8s) ● This is done through a collaboration done between AWS and Heptio ● You can assign RBAC directly to IAM entities! ● By default, the role you assign to your K8s cluster has system:master permissions > kubectl IAM Kubernetes RBAC 2. Verify AWS Identity 3. Authorize AWS Identity With Kubernetes RBAC 1. Send AWS Identity 4. Allow / Deny
  • 10. Meetup Zurich , Feb 2019 Network Overlay Source:https://itnext.io/kubernetes-is-hard-why-eks-makes-it-easier-for-network-and-security- architects-ea6d8b2ca965 VPC CNI plugin ● Pods running in same IP space as host (subnet of VPC), no additional vNIC ● ENIs will be attached to EC2 workers on demand (as no of pods grows) ● !! EC2 instance type limits max number of pods per host (=no of ENIs * max IPs per Interface) https://docs.aws.amazon.com/AWSEC2/latest/UserGui de/using-eni.html#AvailableIpPerENI ● IPs of ENIs are pre-warmed, ensure to have a big enough VPC
  • 11. Meetup Zurich , Feb 2019 Networking policies via Calico Project Calico => OpenSource tool to limit network traffic flow based on specified policies Not just K8s, also DockerEE/OpenStack/bare-metal Calico on top of AWS-VPC-CNI to limit access in 2-Tier-app https://www.projectcalico.org Client Backend Frontend namespace Lets get our hands even dirtier
  • 12. Meetup Zurich , Feb 2019 Persistent Volumes Deploying stateful apps => persistent volumes ● Block storage ● attached to one EC2 instance ● Can be re-attached, e.g. on EC2 failure ● use ReplicaSet over Deployment ● an EBS vol. lives just in one AZ When to use? Apps w/ local storage, not shared across app-instances ● Shared filesystem ● NFS ● Multi read/write ● Multi AZ availability When to use? Apps with storage shared across app-instances and AZs PV-1 (EBS) PV-3 (EBS) PV-2 (EBS) Node 1 Node 2 Pod 1 Pod 3 Pod 2 EFS Security Group Node 1 Node 2 Pod 1 Pod 3 Pod 2
  • 13. Meetup Zurich , Feb 2019 Persistent Volumes Sample Scenario using EFS & EBS: Deploy Wordpress & MySQL MySQL pod ... Node 1 Node 2 Elastic filesystem (EFS) EFS provisioner storageclass pvc mysql Pvc wordpress EK S EFS /EB S WP pod WP pod WP pod EBS provisioner storageclass Elastic block store (EBS)
  • 14. Meetup Zurich , Feb 2019 Scaling worker nodes...incl Spot Instances ● By default worker nodes are made of on-demand EC2 instances ● Spot Instances are ways cheaper and a good fit to scale your cluster and cover peaks, but: they can be terminated by AWS with short notice time ● Since Nov 2018: mixed types of EC2 instances in same ASG possible Spot + OnDemand && different sizing ● Node labelling required for intelligent scheduling to On-demand vs SpotInstance ● Additional _taints_ to further select where to run ● Quick Demo: Run sample deployment , which prefers pods on SpotInstances but does not require it spec: affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 preference: matchExpressions: - key: lifecycle operator: In values: - Ec2Spot tolerations: - key: "spotInstance" operator: "Equal" value: "true" effect: "PreferNoSchedule"
  • 15. Meetup Zurich , Feb 2019 <= ? => HA Control Plane managed by AWS Runs certified, upstream K8s So what ? May be overwhelming if new to AWS Instance type limits no of Pods (=>ENI)
  • 16. Meetup Zurich , Feb 2019 Thank You !!!