SlideShare a Scribd company logo
Segmentation and Isolation on Kubernetes
for Enterprise Teams
Microservices & Cloud Native Apps,
December 12th 2017
2
Kubernetes cluster sprawl
is the new VM sprawl
Our Goal:
Optimize the number of clusters by
sharing them across users & teams
3
•Developer, VP Engineering, Founder at Nirmata
•Developing large-scale software since the early 90’s.
•Expertise in centralized management for complex
distributed systems.
•Co-founded Nirmata in 2013, for enterprise
management of cloud-native applications.
Damien Toledo
4
ITSM Service Catalog
Public Clouds Private Clouds
Infrastructure-as-a-Service
Containerized Apps
What Nirmata Enables
Benefits:
 Multi-Cluster Policies & Governance
 Integrated Monitoring, Alarms, Remediation
 Automated Cluster & Node Management
CI/CD Tools
Kubernetes Clusters
Use Cases:
 Self-service Environments
 Continuous Delivery
 Adaptive Application Operations
5
• Brief Introduction to Kubernetes
• Namespaces
• Resource Quota
• Role Base Access Control
• Micro Segmentation
• Demo
Agenda
Kubernetes
7
• Kubernetes is an open source
container orchestration solution
originally developed by Google now
part of CNCF
• Enable Enterprise DevOps
• Kubernetes is designed for
microservices but can support
stateful applications
Kubernetes
(Greek for “helmsman" or "pilot")
8
Pod
Deployment
Service Ingress
Replica Set
Stateful SetDaemon Set
Network Policy
Job
Container
Secrets
Dude, where’s my app?
Persistent
Volume
Namespace
Ingress Controller
Persistent
Volume Claim
Storage Class
Network
Controller
Cloud
Provider
9
Kubernetes is awesome! But ...
“For newcomers, Kubernetes
can be intimidating….” -- Joe
Beda
“Kubernetes was created by
system engineers, for system
engineers”
-- Craig McLuckie
“Guardrails are important.”
-- Steve Sandke, Salesforce
Namespaces
11
• Most obvious construct to create virtual clusters
• Provide a scope for names
• Provide a way to divide cluster resources using quota
• By default namespace does not provide
• Network isolation  Any service can reach any service
• Access Control Anybody can do everything
Namespace
12
Should I use
One namespace per user/developer
One namespace per team
One per service type
One namespace per application type
One namespace per running instance of your application
application
Namespace scope
13
Namespace Per Application Instance
Service
Deployment
Pod
NetworkPolic
y
ReplicaSet
Pod
Service
Deployment
Pod
NetworkPolic
y
ReplicaSet
Pod
Service
Deployment
PodNetworkPolicy
ReplicaSet
Pod
Service
Deployment
Pod
NetworkPolic
y
ReplicaSet
Pod
Service
Deployment
Pod
NetworkPolic
y
ReplicaSet
Pod
Service
Deployment
PodNetworkPolicy
ReplicaSet
Pod
Namespace (shopme-joe) Namespace (shopme-susan)
Cluster
14
Resources Creation & Namespaces
apiVersion: v1
kind: Service
metadata:
name: customer
namespace: shopme-john
spec:
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
selector:
service: customer
All resources belonging to the same
application instance must be created in
the same Namespace
kubectl create –f service-customer.yaml
Quota & Limits
16
• Used to provide different level of QoS to Pods
• Containers can specify
• Requests: Guaranteed amount of a specific resource (CPU,
Memory, …)
• Limits: Maximum amount of a resource allowed
• Request <= Limit
• Scheduling is based on Requests, not on Limits
• Sum of limits can exceed system capacity (i.e. oversubscription)
Container Requests & Limits
17
Container Requests & Limits - Example
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: payment
namespace: shopme
spec:
replicas: 1
template:
spec:
containers:
- name: payment
image: nirmata/payment:latest
ports:
- containerPort: 80
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "1"
18
Compressible Resources (CPU)
• Pods are guaranteed to get the amount of CPU requested
• Excess CPU is distributed based on the amount requested
• If a Pod exceeds a limit, the process using the most amount of the resource will be
killed.
• Pods are throttled if they exceed their limit
Incompressible Resources (Memory)
• If a Pod exceeds its request, it can be killed if other Pods needs more memory
• If a Pod exceeds a limit, the process using the most amount of the resource will be
killed.
Container Requests & Limits
19
Resource Quota
• Resource Quota are defined at the namespace level
• Limit aggregate resource consumption
• Limit number of objects (Service, NodePort, Pod, …)
• Limit that total compute resources (CPU, memory, storage)
• Resource Quotas should be created by administrators
• If creating or updating a resource violate a Resource Quota,
the operation is denied (403 FORBIDDEN)
• Users must specify container Requests when Resource
Quotas are in use
20
Resource Quota - Example
In a cluster with 64 GiB RAM, 16 cores, 500 GiB disk
apiVersion: v1
kind: ResourceQuota
metadata:
name: shopme-john-quota
namespace: shopme-john
spec:
hard:
pods: "4"
requests.cpu: “8"
requests.memory: 32Gi
requests.storage: 100Gi
limits.cpu: “16"
limits.memory: 64Gi
shopme-john-quota.yaml
kubectl create –f shopme-john-quota.yaml
apiVersion: v1
kind: ResourceQuota
metadata:
name: shopme-susan-quota
namespace: shopme-susan
spec:
hard:
pods: "4"
requests.cpu: “8"
requests.memory: 32Gi
requests.storage: 200Gi
limits.cpu: “12"
limits.memory: 48Gi
shopme-susan-quota.yaml
kubectl create –f shopme-susan-
quota.yaml
21
Object Count Quota
apiVersion: v1
kind: ResourceQuota
metadata:
name: shopme-quota
namespace: shopme-susan
spec:
hard:
persistentvolumeclaims: "1“
pods: “3"
services.nodeports: "0"
shopme-quota.yaml status:
hard:
persistentvolumeclaims: "1"
services.nodeports: "0"
used:
persistentvolumeclaims: "0“
pods: “2"
services.nodeports: "0“
kubectl create –f shopme-quota.yaml
Kubectl get resourcequota shopme-quota –n
shopme-susan
22
Default CPU Request & Limits
apiVersion: v1
kind: LimitRange
metadata:
name: cpu-limit
spec:
limits:
- default:
cpu: 1
type: Container
shopme-cpu-limit.yaml
kubectl create –f shopme-cpu-limit.yaml –n shopme-susan
23
Default Memory Request & Limits
apiVersion: v1
kind: LimitRange
metadata:
name: cpu-limit
spec:
limits:
- default:
memory: 512Mi
defaultRequest:
memory: 256Mi
type: Container
shopme-cpu-limit.yaml
kubectl create –f shopme-memory-limit.yaml –n shopme-susan
RBAC
25
• General availability in K8s 1.8
• Policies controlling permissions within a cluster
• Can provide cluster wide defaults
• Fined grained access control per Namespace
Kubernetes RBAC
26
Service Accounts
• Managed by Kubernetes
• Bound to specific Namespaces
• Tied to a set of credentials stored as Secrets
Normal Users
• Managed outside K8s
• There are no k8s objects representing users
• Can use private keys, file with list of users, user store like keystone, etc
Kubernetes Users
27
Kubernetes RBAC Model
RoleUser
ServiceAccount
RoleBinding
ClusterRole
ClusterRoleBindin
g
All K8s Resources
Pod
Deployment
ReplicaSet
StatefulSet
Ingress
PersistenVolume
Verbs:
update
create
Delete
get
list
watch
28
Role Creation - Example
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: shopme-john
name: pod-reader
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["get", "watch", "list"]
kubectl create –f pod-reader-role.yaml
pod-reader-role.yaml
29
Role Binding Creation - Example
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: read-pods
namespace: shopme-john
subjects:
- kind: User
name: susan
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: pod-reader
apiGroup: rbac.authorization.k8s.io
kubectl create –f pod-reader-role-binding.yaml
pod-reader-role-binding.yaml
Micro segmentation
31
All Containers can communicates with all containers within a cluster
Best pratices:
1. Enable network policies using a plugin (Calico, Cilium, Kuke-router, Romana,
Weave Net, ..)
2. By default, deny all traffic to your services
3. Create Network Policies to selectively enable traffic from other services
Kubernetes Networking is Great But …
32
Kubernetes Microsegmentation
Service
payment
Pod
NetworkPolicy
Namespace
shopme-john
Service
customers
Pod
NetworkPolicy
Service
Recommendation
s
Pod
NetworkPolicy
Allow
Deny
Service
Pod
Service
Pod
Service
customers
Pod
NetworkPolicy
Namespace
shopme-susan
Deny
Deny
33
Network Policies Creation
apiVersion:
networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
namespace: shopme-john
spec:
podSelector:
policyType:
- Ingress
kubectl create –f default-deny-all.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: payment-network-policy
namespace: shopme-john
spec:
podSelector:
matchLabels:
service: customer
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: shopme-john
- podSelector:
matchLabels:
service: customers
ports:
- protocol: TCP
name: payment-port
kubectl create –f payment-policy.yaml
Additional Constructs
35
• Storage
• ConfigMaps
• Labels
• Pod Selector
• Secrets
Additional Constructs
Demo
Conclusion
38
• Kubernetes is a powerful toolbox
• Provides many building blocks that can be used to implement application
isolation
• Developers shouldn’t have to worry about this
• Admins need solutions to simplify their work …
Conclusion
39
• Single management plane
across multiple clusters
• Secure and scalable
multi-cloud management
• Seamless integrations for
continuous delivery
Nirmata simplifies Kubernetes
forenterpriseDevOpsteams
Thank-you!
http://try.nirmata.io

More Related Content

What's hot

Kubernetes Meetup - Seattle 2017-06-01
Kubernetes Meetup - Seattle 2017-06-01Kubernetes Meetup - Seattle 2017-06-01
Kubernetes Meetup - Seattle 2017-06-01
Bassam Tabbara
 
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
CodeOps Technologies LLP
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
rajdeep
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
Kubernetes and Istio
Kubernetes and IstioKubernetes and Istio
Kubernetes and Istio
Ketan Gote
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Gabriel Carro
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
Stefan Schimanski
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Martin Danielsson
 
Enabling ceph-mgr to control Ceph services via Kubernetes
Enabling ceph-mgr to control Ceph services via KubernetesEnabling ceph-mgr to control Ceph services via Kubernetes
Enabling ceph-mgr to control Ceph services via Kubernetes
mountpoint.io
 
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
brendandburns
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
Kubernetes Networking - Sreenivas Makam - Google - CC18
Kubernetes Networking - Sreenivas Makam - Google - CC18Kubernetes Networking - Sreenivas Makam - Google - CC18
Kubernetes Networking - Sreenivas Makam - Google - CC18
CodeOps Technologies LLP
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview
Krishna-Kumar
 
KuberNETes - meetup
KuberNETes - meetupKuberNETes - meetup
KuberNETes - meetup
Nathan Ness
 
VMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - OverviewVMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - Overview
rajdeep
 
Security best practices for kubernetes deployment
Security best practices for kubernetes deploymentSecurity best practices for kubernetes deployment
Security best practices for kubernetes deployment
Michael Cherny
 
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes WorkloadsAWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summits
 
Kubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesKubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slides
Simone Morellato
 
Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)
Krishna-Kumar
 

What's hot (20)

Kubernetes Meetup - Seattle 2017-06-01
Kubernetes Meetup - Seattle 2017-06-01Kubernetes Meetup - Seattle 2017-06-01
Kubernetes Meetup - Seattle 2017-06-01
 
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview
 
Kubernetes and Istio
Kubernetes and IstioKubernetes and Istio
Kubernetes and Istio
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
OpenStack Cinder
OpenStack CinderOpenStack Cinder
OpenStack Cinder
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Enabling ceph-mgr to control Ceph services via Kubernetes
Enabling ceph-mgr to control Ceph services via KubernetesEnabling ceph-mgr to control Ceph services via Kubernetes
Enabling ceph-mgr to control Ceph services via Kubernetes
 
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 
Kubernetes Networking - Sreenivas Makam - Google - CC18
Kubernetes Networking - Sreenivas Makam - Google - CC18Kubernetes Networking - Sreenivas Makam - Google - CC18
Kubernetes Networking - Sreenivas Makam - Google - CC18
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview
 
KuberNETes - meetup
KuberNETes - meetupKuberNETes - meetup
KuberNETes - meetup
 
VMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - OverviewVMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - Overview
 
Security best practices for kubernetes deployment
Security best practices for kubernetes deploymentSecurity best practices for kubernetes deployment
Security best practices for kubernetes deployment
 
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes WorkloadsAWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
 
Kubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesKubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slides
 
Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)
 

Similar to Meetup 12-12-2017 - Application Isolation on Kubernetes

Implementing-SaaS-on-Kubernetes-Michael-Knapp-Andrew-Gao-Capital-One.pdf
Implementing-SaaS-on-Kubernetes-Michael-Knapp-Andrew-Gao-Capital-One.pdfImplementing-SaaS-on-Kubernetes-Michael-Knapp-Andrew-Gao-Capital-One.pdf
Implementing-SaaS-on-Kubernetes-Michael-Knapp-Andrew-Gao-Capital-One.pdf
ssuserf4844f
 
K8s best practices from the field!
K8s best practices from the field!K8s best practices from the field!
K8s best practices from the field!
DoiT International
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
DoKC
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
DoKC
 
K8s vs Cloud Foundry
K8s vs Cloud FoundryK8s vs Cloud Foundry
K8s vs Cloud Foundry
Ivan Borshukov
 
Kube journey 2017-04-19
Kube journey   2017-04-19Kube journey   2017-04-19
Kube journey 2017-04-19
Doug Davis
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-HassanKubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-Hassan
Syed Murtaza Hassan
 
An Introduction to Kubernetes and Continuous Delivery Fundamentals
An Introduction to Kubernetes and Continuous Delivery FundamentalsAn Introduction to Kubernetes and Continuous Delivery Fundamentals
An Introduction to Kubernetes and Continuous Delivery Fundamentals
All Things Open
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
Bob Killen
 
MongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise Kubernetes
MongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise KubernetesMongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise Kubernetes
MongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise Kubernetes
MongoDB
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
Inhye Park
 
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Opcito Technologies
 
Kubernetes Administration from Zero to Hero.pdf
Kubernetes Administration from Zero to Hero.pdfKubernetes Administration from Zero to Hero.pdf
Kubernetes Administration from Zero to Hero.pdf
ArzooGupta16
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operators
J On The Beach
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)
Allan Naim
 
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
DevDay.org
 
Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design Patterns
Bilgin Ibryam
 
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
VMUG IT
 
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
Mario-Leander Reimer
 
A hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stackA hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stack
QAware GmbH
 

Similar to Meetup 12-12-2017 - Application Isolation on Kubernetes (20)

Implementing-SaaS-on-Kubernetes-Michael-Knapp-Andrew-Gao-Capital-One.pdf
Implementing-SaaS-on-Kubernetes-Michael-Knapp-Andrew-Gao-Capital-One.pdfImplementing-SaaS-on-Kubernetes-Michael-Knapp-Andrew-Gao-Capital-One.pdf
Implementing-SaaS-on-Kubernetes-Michael-Knapp-Andrew-Gao-Capital-One.pdf
 
K8s best practices from the field!
K8s best practices from the field!K8s best practices from the field!
K8s best practices from the field!
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
K8s vs Cloud Foundry
K8s vs Cloud FoundryK8s vs Cloud Foundry
K8s vs Cloud Foundry
 
Kube journey 2017-04-19
Kube journey   2017-04-19Kube journey   2017-04-19
Kube journey 2017-04-19
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-HassanKubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-Hassan
 
An Introduction to Kubernetes and Continuous Delivery Fundamentals
An Introduction to Kubernetes and Continuous Delivery FundamentalsAn Introduction to Kubernetes and Continuous Delivery Fundamentals
An Introduction to Kubernetes and Continuous Delivery Fundamentals
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
 
MongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise Kubernetes
MongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise KubernetesMongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise Kubernetes
MongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise Kubernetes
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
 
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
 
Kubernetes Administration from Zero to Hero.pdf
Kubernetes Administration from Zero to Hero.pdfKubernetes Administration from Zero to Hero.pdf
Kubernetes Administration from Zero to Hero.pdf
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operators
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)
 
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
 
Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design Patterns
 
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
 
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
 
A hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stackA hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stack
 

Recently uploaded

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 

Recently uploaded (20)

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 

Meetup 12-12-2017 - Application Isolation on Kubernetes

  • 1. Segmentation and Isolation on Kubernetes for Enterprise Teams Microservices & Cloud Native Apps, December 12th 2017
  • 2. 2 Kubernetes cluster sprawl is the new VM sprawl Our Goal: Optimize the number of clusters by sharing them across users & teams
  • 3. 3 •Developer, VP Engineering, Founder at Nirmata •Developing large-scale software since the early 90’s. •Expertise in centralized management for complex distributed systems. •Co-founded Nirmata in 2013, for enterprise management of cloud-native applications. Damien Toledo
  • 4. 4 ITSM Service Catalog Public Clouds Private Clouds Infrastructure-as-a-Service Containerized Apps What Nirmata Enables Benefits:  Multi-Cluster Policies & Governance  Integrated Monitoring, Alarms, Remediation  Automated Cluster & Node Management CI/CD Tools Kubernetes Clusters Use Cases:  Self-service Environments  Continuous Delivery  Adaptive Application Operations
  • 5. 5 • Brief Introduction to Kubernetes • Namespaces • Resource Quota • Role Base Access Control • Micro Segmentation • Demo Agenda
  • 7. 7 • Kubernetes is an open source container orchestration solution originally developed by Google now part of CNCF • Enable Enterprise DevOps • Kubernetes is designed for microservices but can support stateful applications Kubernetes (Greek for “helmsman" or "pilot")
  • 8. 8 Pod Deployment Service Ingress Replica Set Stateful SetDaemon Set Network Policy Job Container Secrets Dude, where’s my app? Persistent Volume Namespace Ingress Controller Persistent Volume Claim Storage Class Network Controller Cloud Provider
  • 9. 9 Kubernetes is awesome! But ... “For newcomers, Kubernetes can be intimidating….” -- Joe Beda “Kubernetes was created by system engineers, for system engineers” -- Craig McLuckie “Guardrails are important.” -- Steve Sandke, Salesforce
  • 11. 11 • Most obvious construct to create virtual clusters • Provide a scope for names • Provide a way to divide cluster resources using quota • By default namespace does not provide • Network isolation  Any service can reach any service • Access Control Anybody can do everything Namespace
  • 12. 12 Should I use One namespace per user/developer One namespace per team One per service type One namespace per application type One namespace per running instance of your application application Namespace scope
  • 13. 13 Namespace Per Application Instance Service Deployment Pod NetworkPolic y ReplicaSet Pod Service Deployment Pod NetworkPolic y ReplicaSet Pod Service Deployment PodNetworkPolicy ReplicaSet Pod Service Deployment Pod NetworkPolic y ReplicaSet Pod Service Deployment Pod NetworkPolic y ReplicaSet Pod Service Deployment PodNetworkPolicy ReplicaSet Pod Namespace (shopme-joe) Namespace (shopme-susan) Cluster
  • 14. 14 Resources Creation & Namespaces apiVersion: v1 kind: Service metadata: name: customer namespace: shopme-john spec: ports: - name: http protocol: TCP port: 80 targetPort: 80 selector: service: customer All resources belonging to the same application instance must be created in the same Namespace kubectl create –f service-customer.yaml
  • 16. 16 • Used to provide different level of QoS to Pods • Containers can specify • Requests: Guaranteed amount of a specific resource (CPU, Memory, …) • Limits: Maximum amount of a resource allowed • Request <= Limit • Scheduling is based on Requests, not on Limits • Sum of limits can exceed system capacity (i.e. oversubscription) Container Requests & Limits
  • 17. 17 Container Requests & Limits - Example apiVersion: extensions/v1beta1 kind: Deployment metadata: name: payment namespace: shopme spec: replicas: 1 template: spec: containers: - name: payment image: nirmata/payment:latest ports: - containerPort: 80 resources: requests: memory: "64Mi" cpu: "250m" limits: memory: "128Mi" cpu: "1"
  • 18. 18 Compressible Resources (CPU) • Pods are guaranteed to get the amount of CPU requested • Excess CPU is distributed based on the amount requested • If a Pod exceeds a limit, the process using the most amount of the resource will be killed. • Pods are throttled if they exceed their limit Incompressible Resources (Memory) • If a Pod exceeds its request, it can be killed if other Pods needs more memory • If a Pod exceeds a limit, the process using the most amount of the resource will be killed. Container Requests & Limits
  • 19. 19 Resource Quota • Resource Quota are defined at the namespace level • Limit aggregate resource consumption • Limit number of objects (Service, NodePort, Pod, …) • Limit that total compute resources (CPU, memory, storage) • Resource Quotas should be created by administrators • If creating or updating a resource violate a Resource Quota, the operation is denied (403 FORBIDDEN) • Users must specify container Requests when Resource Quotas are in use
  • 20. 20 Resource Quota - Example In a cluster with 64 GiB RAM, 16 cores, 500 GiB disk apiVersion: v1 kind: ResourceQuota metadata: name: shopme-john-quota namespace: shopme-john spec: hard: pods: "4" requests.cpu: “8" requests.memory: 32Gi requests.storage: 100Gi limits.cpu: “16" limits.memory: 64Gi shopme-john-quota.yaml kubectl create –f shopme-john-quota.yaml apiVersion: v1 kind: ResourceQuota metadata: name: shopme-susan-quota namespace: shopme-susan spec: hard: pods: "4" requests.cpu: “8" requests.memory: 32Gi requests.storage: 200Gi limits.cpu: “12" limits.memory: 48Gi shopme-susan-quota.yaml kubectl create –f shopme-susan- quota.yaml
  • 21. 21 Object Count Quota apiVersion: v1 kind: ResourceQuota metadata: name: shopme-quota namespace: shopme-susan spec: hard: persistentvolumeclaims: "1“ pods: “3" services.nodeports: "0" shopme-quota.yaml status: hard: persistentvolumeclaims: "1" services.nodeports: "0" used: persistentvolumeclaims: "0“ pods: “2" services.nodeports: "0“ kubectl create –f shopme-quota.yaml Kubectl get resourcequota shopme-quota –n shopme-susan
  • 22. 22 Default CPU Request & Limits apiVersion: v1 kind: LimitRange metadata: name: cpu-limit spec: limits: - default: cpu: 1 type: Container shopme-cpu-limit.yaml kubectl create –f shopme-cpu-limit.yaml –n shopme-susan
  • 23. 23 Default Memory Request & Limits apiVersion: v1 kind: LimitRange metadata: name: cpu-limit spec: limits: - default: memory: 512Mi defaultRequest: memory: 256Mi type: Container shopme-cpu-limit.yaml kubectl create –f shopme-memory-limit.yaml –n shopme-susan
  • 24. RBAC
  • 25. 25 • General availability in K8s 1.8 • Policies controlling permissions within a cluster • Can provide cluster wide defaults • Fined grained access control per Namespace Kubernetes RBAC
  • 26. 26 Service Accounts • Managed by Kubernetes • Bound to specific Namespaces • Tied to a set of credentials stored as Secrets Normal Users • Managed outside K8s • There are no k8s objects representing users • Can use private keys, file with list of users, user store like keystone, etc Kubernetes Users
  • 27. 27 Kubernetes RBAC Model RoleUser ServiceAccount RoleBinding ClusterRole ClusterRoleBindin g All K8s Resources Pod Deployment ReplicaSet StatefulSet Ingress PersistenVolume Verbs: update create Delete get list watch
  • 28. 28 Role Creation - Example kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: namespace: shopme-john name: pod-reader rules: - apiGroups: [""] # "" indicates the core API group resources: ["pods"] verbs: ["get", "watch", "list"] kubectl create –f pod-reader-role.yaml pod-reader-role.yaml
  • 29. 29 Role Binding Creation - Example kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: read-pods namespace: shopme-john subjects: - kind: User name: susan apiGroup: rbac.authorization.k8s.io roleRef: kind: Role name: pod-reader apiGroup: rbac.authorization.k8s.io kubectl create –f pod-reader-role-binding.yaml pod-reader-role-binding.yaml
  • 31. 31 All Containers can communicates with all containers within a cluster Best pratices: 1. Enable network policies using a plugin (Calico, Cilium, Kuke-router, Romana, Weave Net, ..) 2. By default, deny all traffic to your services 3. Create Network Policies to selectively enable traffic from other services Kubernetes Networking is Great But …
  • 33. 33 Network Policies Creation apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: default-deny namespace: shopme-john spec: podSelector: policyType: - Ingress kubectl create –f default-deny-all.yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: payment-network-policy namespace: shopme-john spec: podSelector: matchLabels: service: customer policyTypes: - Ingress ingress: - from: - namespaceSelector: matchLabels: name: shopme-john - podSelector: matchLabels: service: customers ports: - protocol: TCP name: payment-port kubectl create –f payment-policy.yaml
  • 35. 35 • Storage • ConfigMaps • Labels • Pod Selector • Secrets Additional Constructs
  • 36. Demo
  • 38. 38 • Kubernetes is a powerful toolbox • Provides many building blocks that can be used to implement application isolation • Developers shouldn’t have to worry about this • Admins need solutions to simplify their work … Conclusion
  • 39. 39 • Single management plane across multiple clusters • Secure and scalable multi-cloud management • Seamless integrations for continuous delivery Nirmata simplifies Kubernetes forenterpriseDevOpsteams