Demystifying Kubernetes
for Enterprise Developers!
Jim Bugwadia, Nirmata
DevOps Summit, November 1st 2017
22
High-performing IT organizations
deploy 46x more frequently with 440x
shorter lead times; their failure rate is
5x lower and they recover 96x faster.
2017 State of DevOps Report by Puppet Labs
3
• Why Kubernetes
• Kubernetes
Cluster Concepts
• Kubernetes
Applications Concepts
Agenda
4
•Founder and CEO, Nirmata
•Developing large-scale distributed
systems since the early 90’s
(Go, Java, JS, C++)
•Expertise in centralized
management for complex
distributed systems.
Jim Bugwadia
Why Kubernetes?
6
Businesses that deliver faster, win!
Dev -> QA -> Ops
Infrastructure as Pets
Configuration
Management
Monoliths in VMs
DevOps
Infrastructure as Cattle
Immutable
images
Microservices in Containers
7
•Kubernetes is an open source
container orchestration solution
originally developed by Google
now part of CNCF
•Kubernetes is designed for
microservices but can support
stateful applications
Kubernetes
(Greek for “helmsman" or "pilot")
8
Kubernetes is popular!
9
• Builds on Google’s 10+ years of
experience with containers
• Robust, scalable, and extensible
• Governed by the Cloud-Native
Compute Foundation (CNCF)
Why Kubernetes
10
But…
Kubernetes Cluster Concepts
12
Kubernetes Architecture
•Nodes
•Components
•Add-ons
•Cloud Provider
• Networking
• Storage
13
• kube-apiserver: front-end for the Kubernetes control-
plane
• etcd: datastore for the cluster
• kube-controller-manager: controllers for routine
cluster tasks
• cloud-controller-manager: controllers specific to cloud
providers
• kube-scheduler: assigns Pods to nodes
Master nodes run Kubernetes
components
14
•Required:
• kubelet: manages pods, executes liveness probes, reports pod and node status.
• kube-proxy: network proxy; performs connection forwarding
• docker / rkt / containerd: the container engine
•Optional
• add-ons
• supervisord
• fluentd
•Your application pods
Each worker node runs
15
•DNS: serves DNS for Kubernetes components and
containers. Consider as required.
•Heapster: provides container resource monitoring. Is
used for Horizontal Pod Autoscaling.
•Web UI: dashboard to monitor and manage the cluster.
Common Add-ons
16
• K8s networking follows these principles:
1. All containers can communicate with all other containers
without NAT
2. All nodes can communicate with all containers (and vice-
versa) without NAT
3. The IP that a container sees itself as is the same IP that others
see it as
• Each pod gets its own IP address
• CNI is the plugin model used by the Kubelet to
invoke the networking implementation
• CNI plugins: Calico, Contiv, Flannel , GCE, …
Networking
17
•Pods can contain one or more Volumes
• Volume types: emptyDir, hostPath,
persistentVolumeClaim, secret, awsElasticBlockStore,
AzureDiskVolume, …
•A PersistentVolumeClaim requests a
PersistentVolume that may be dynamically
provisioned.
• Admins can configure StorageClasses for persistent
volume claims like “bronze”, “silver”, or “gold”. A
storage class has a Provisioner, like AzureDisk.
Storage
Demo!
19
Kubernetes Application Concepts
21
Dude, where’s my app?
22
•Basic unit of application deployment
•Contains
• One or more Containers
• One or more PVCs
•Other constructs
• nodeSelector
• affinity
• serviceAccountName
• secrets
• initContainers
Pods
Pod
Container
Secrets
Persistent
Volume Claim
23
•Pods can be managed individually, but
don’t do this!
•Pods lifecycles are best managed using
one of:
• Deployments
• StatefulSets
• DaemonSets
•Less often used:
• ReplicaSets (Deployments manage ReplicaSets)
• Jobs (short-lived run-to-completion tasks)
Managing Pods
24
•Deployments automatically
create (and delete) ReplicaSets
•Rollout: a new ReplicaSet is created and scaled
up. The existing ReplicaSet is scaled down.
•Rollback: only impacts the Pod template. Can
rollback to a specific revision ID.
•Rolling upgrade strategy
tunables:
• maxUnavailable
• maxSurge
Deployment
Pod
Deployment
Replica Set
25
•Pods with stable identities
• names, network, storage
•Ordered creation, updates, scaling, and
deletion
• Pods are created, and named, in order from {0…N-1}
•Use for clustered apps that use client-
side identities
• ZooKeeperAddresses: “zoo-1:2181, zoo-2:2181, zoo-3:2181”
StatefulSet
26
•Ensures that all Nodes run an instance
of a Pod
•Useful for monitoring & security
agents, log daemons, etc.
•A node selector can be used to target a
subset of nodes
DaemonSet
27
•Service
• provides load-balancing. Addressed via IP (cluster
IP) or a DNS name.
•Network Policy
• manages routing rules across pods (east-west
traffic.)
•Ingress
• manages external routes to services (north-south
traffic.) An Ingress Controller does the load-
balancing. Ingress Resources specify the rules.
Networking your app
28
Source: Steve Watt, Red Hat
Configuring storage for your app
29
• Most apps will contain one or more
services / tiers
• And each service will have:
• Deployment  ReplicaSet  Pod  Container(s)
• Service
• Ingress
• Network Policy
• Persistent Volume Claim(s)
Modeling a Kubernetes Application
External facing services only
Demo!
31
Summary
33
1. Microservices and containers enable
enterprise DevOps best practices
2. Kubernetes provides a powerful,
scalable, and extensible platform to
run containers
3. Every enterprise should consider
building a Kubernetes strategy
Summary
34
• Single management plane
across multiple clusters
• Secure and scalable
multi-cloud management
• Seamless integrations for
continuous delivery
Nirmata simplifies Kubernetes
for enterprise DevOps teams
Thank-you!
http://try.nirmata.io
Catch a full demo at both 410!
Demystifying Kubernetes for Enterprise DevOps

Demystifying Kubernetes for Enterprise DevOps

  • 1.
    Demystifying Kubernetes for EnterpriseDevelopers! Jim Bugwadia, Nirmata DevOps Summit, November 1st 2017
  • 2.
    22 High-performing IT organizations deploy46x more frequently with 440x shorter lead times; their failure rate is 5x lower and they recover 96x faster. 2017 State of DevOps Report by Puppet Labs
  • 3.
    3 • Why Kubernetes •Kubernetes Cluster Concepts • Kubernetes Applications Concepts Agenda
  • 4.
    4 •Founder and CEO,Nirmata •Developing large-scale distributed systems since the early 90’s (Go, Java, JS, C++) •Expertise in centralized management for complex distributed systems. Jim Bugwadia
  • 5.
  • 6.
    6 Businesses that deliverfaster, win! Dev -> QA -> Ops Infrastructure as Pets Configuration Management Monoliths in VMs DevOps Infrastructure as Cattle Immutable images Microservices in Containers
  • 7.
    7 •Kubernetes is anopen source container orchestration solution originally developed by Google now part of CNCF •Kubernetes is designed for microservices but can support stateful applications Kubernetes (Greek for “helmsman" or "pilot")
  • 8.
  • 9.
    9 • Builds onGoogle’s 10+ years of experience with containers • Robust, scalable, and extensible • Governed by the Cloud-Native Compute Foundation (CNCF) Why Kubernetes
  • 10.
  • 11.
  • 12.
  • 13.
    13 • kube-apiserver: front-endfor the Kubernetes control- plane • etcd: datastore for the cluster • kube-controller-manager: controllers for routine cluster tasks • cloud-controller-manager: controllers specific to cloud providers • kube-scheduler: assigns Pods to nodes Master nodes run Kubernetes components
  • 14.
    14 •Required: • kubelet: managespods, executes liveness probes, reports pod and node status. • kube-proxy: network proxy; performs connection forwarding • docker / rkt / containerd: the container engine •Optional • add-ons • supervisord • fluentd •Your application pods Each worker node runs
  • 15.
    15 •DNS: serves DNSfor Kubernetes components and containers. Consider as required. •Heapster: provides container resource monitoring. Is used for Horizontal Pod Autoscaling. •Web UI: dashboard to monitor and manage the cluster. Common Add-ons
  • 16.
    16 • K8s networkingfollows these principles: 1. All containers can communicate with all other containers without NAT 2. All nodes can communicate with all containers (and vice- versa) without NAT 3. The IP that a container sees itself as is the same IP that others see it as • Each pod gets its own IP address • CNI is the plugin model used by the Kubelet to invoke the networking implementation • CNI plugins: Calico, Contiv, Flannel , GCE, … Networking
  • 17.
    17 •Pods can containone or more Volumes • Volume types: emptyDir, hostPath, persistentVolumeClaim, secret, awsElasticBlockStore, AzureDiskVolume, … •A PersistentVolumeClaim requests a PersistentVolume that may be dynamically provisioned. • Admins can configure StorageClasses for persistent volume claims like “bronze”, “silver”, or “gold”. A storage class has a Provisioner, like AzureDisk. Storage
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
    22 •Basic unit ofapplication deployment •Contains • One or more Containers • One or more PVCs •Other constructs • nodeSelector • affinity • serviceAccountName • secrets • initContainers Pods Pod Container Secrets Persistent Volume Claim
  • 23.
    23 •Pods can bemanaged individually, but don’t do this! •Pods lifecycles are best managed using one of: • Deployments • StatefulSets • DaemonSets •Less often used: • ReplicaSets (Deployments manage ReplicaSets) • Jobs (short-lived run-to-completion tasks) Managing Pods
  • 24.
    24 •Deployments automatically create (anddelete) ReplicaSets •Rollout: a new ReplicaSet is created and scaled up. The existing ReplicaSet is scaled down. •Rollback: only impacts the Pod template. Can rollback to a specific revision ID. •Rolling upgrade strategy tunables: • maxUnavailable • maxSurge Deployment Pod Deployment Replica Set
  • 25.
    25 •Pods with stableidentities • names, network, storage •Ordered creation, updates, scaling, and deletion • Pods are created, and named, in order from {0…N-1} •Use for clustered apps that use client- side identities • ZooKeeperAddresses: “zoo-1:2181, zoo-2:2181, zoo-3:2181” StatefulSet
  • 26.
    26 •Ensures that allNodes run an instance of a Pod •Useful for monitoring & security agents, log daemons, etc. •A node selector can be used to target a subset of nodes DaemonSet
  • 27.
    27 •Service • provides load-balancing.Addressed via IP (cluster IP) or a DNS name. •Network Policy • manages routing rules across pods (east-west traffic.) •Ingress • manages external routes to services (north-south traffic.) An Ingress Controller does the load- balancing. Ingress Resources specify the rules. Networking your app
  • 28.
    28 Source: Steve Watt,Red Hat Configuring storage for your app
  • 29.
    29 • Most appswill contain one or more services / tiers • And each service will have: • Deployment  ReplicaSet  Pod  Container(s) • Service • Ingress • Network Policy • Persistent Volume Claim(s) Modeling a Kubernetes Application External facing services only
  • 30.
  • 31.
  • 32.
  • 33.
    33 1. Microservices andcontainers enable enterprise DevOps best practices 2. Kubernetes provides a powerful, scalable, and extensible platform to run containers 3. Every enterprise should consider building a Kubernetes strategy Summary
  • 34.
    34 • Single managementplane across multiple clusters • Secure and scalable multi-cloud management • Seamless integrations for continuous delivery Nirmata simplifies Kubernetes for enterprise DevOps teams
  • 35.