Kubernetes (k8s)
Dharmit Shah
(@dharm1t)
Who am I?
@
About Me
● Software Engineer @ Red Hat
● Develop tools for Developers like you!
● CI/CD
● Previous Life:
○ Tech Support Engineer
○ Linux Admin
○ Django developer
What is Kubernetes?
● Open-source platform
● Deploy application containers across clusters of hosts
● Container-centric infrastructure
● Features:
○ Quickly deploy applications
○ Scale the applications
○ Rolling updates
● Physical and Virtual machines
● Google, Red Hat, Intel, Puppet, CoreOS, etc.
Key Concepts
● Pods
● Labels
● Services
● Replication Controllers
● Deployments
● Volumes
● Persistent Volumes
● …
Pods
● Smallest deployable units that can be created and managed in k8s
● Group of containers scheduled on the same host
● Share resources like volumes, IP address
● Containers within a pod can find each other via localhost
● Can also communicate using standard IPC
● Containers in different pods have distinct IP addresses and can not
communicate by IPC.
DEM0!
Labels
● Key/Value pairs that are attached to objects, such as pods
● Used to organize and select subsets of objects
● Example labels:
○ "release" : "stable", "release" : "canary"
○ "environment" : "dev", "environment" : "qa", "environment" :
"production"
DEM0!
Replication Controllers (rc)
● Ensures a specified number of pod “replicas” are running
● If there are more pods, it’ll kill some
● If there are less pods, it’ll start more
● Manages all the pods with labels which match the “selector”
● Increase/Decrease number of replicas on the fly
DEM0!
Services
● Pod IP addresses cannot be relied upon!
● What if pods (backend) provide some service to other pods (frontend)
and backend pods suddenly die?
● Services define logical set of Pods
● Set of Pods targeted by a Service is determined by “selector” (same
concept as rc)
DEM0!
Deployments
● Provides declarative updates for Pods and Replica Sets (next gen RC)
● Used to bring up Pods and Replica Sets
● Canary deployments
Volumes
● Just another directory accessible to the Pod
● Ceases to exist when Pod ceases to exist
● Support for many volume types; Pod can use any number of them
simultaneously
● Mounted at the specified paths within the image
Volume Types
● emptyDir
● hostPath
● gcePersistentDisk
● awsElasticBackStore
● nfs
● iscsi
● glusterfs
● rbd (Ceph)
DEM0!
Persistent Volume
● A piece of networked storage in the cluster provisioned by an
administrator
● Lifecycle independent of any individual pod that uses the PV
● Types:
○ GCEPersistentDisk
○ RBD (Ceph)
○ Glusterfs
○ NFS
○ iSCSI
○ …
DEM0!
Join the community!
● Slack - kubernetes.slack.com
● GitHub - https://github.com/kubernetes/kubernetes/
Questions?

Kubernetes

  • 1.
  • 2.
  • 3.
    About Me ● SoftwareEngineer @ Red Hat ● Develop tools for Developers like you! ● CI/CD ● Previous Life: ○ Tech Support Engineer ○ Linux Admin ○ Django developer
  • 5.
    What is Kubernetes? ●Open-source platform ● Deploy application containers across clusters of hosts ● Container-centric infrastructure ● Features: ○ Quickly deploy applications ○ Scale the applications ○ Rolling updates ● Physical and Virtual machines ● Google, Red Hat, Intel, Puppet, CoreOS, etc.
  • 6.
    Key Concepts ● Pods ●Labels ● Services ● Replication Controllers ● Deployments ● Volumes ● Persistent Volumes ● …
  • 7.
    Pods ● Smallest deployableunits that can be created and managed in k8s ● Group of containers scheduled on the same host ● Share resources like volumes, IP address ● Containers within a pod can find each other via localhost ● Can also communicate using standard IPC ● Containers in different pods have distinct IP addresses and can not communicate by IPC.
  • 8.
  • 9.
    Labels ● Key/Value pairsthat are attached to objects, such as pods ● Used to organize and select subsets of objects ● Example labels: ○ "release" : "stable", "release" : "canary" ○ "environment" : "dev", "environment" : "qa", "environment" : "production"
  • 10.
  • 11.
    Replication Controllers (rc) ●Ensures a specified number of pod “replicas” are running ● If there are more pods, it’ll kill some ● If there are less pods, it’ll start more ● Manages all the pods with labels which match the “selector” ● Increase/Decrease number of replicas on the fly
  • 12.
  • 13.
    Services ● Pod IPaddresses cannot be relied upon! ● What if pods (backend) provide some service to other pods (frontend) and backend pods suddenly die? ● Services define logical set of Pods ● Set of Pods targeted by a Service is determined by “selector” (same concept as rc)
  • 14.
  • 15.
    Deployments ● Provides declarativeupdates for Pods and Replica Sets (next gen RC) ● Used to bring up Pods and Replica Sets ● Canary deployments
  • 16.
    Volumes ● Just anotherdirectory accessible to the Pod ● Ceases to exist when Pod ceases to exist ● Support for many volume types; Pod can use any number of them simultaneously ● Mounted at the specified paths within the image
  • 17.
    Volume Types ● emptyDir ●hostPath ● gcePersistentDisk ● awsElasticBackStore ● nfs ● iscsi ● glusterfs ● rbd (Ceph)
  • 18.
  • 19.
    Persistent Volume ● Apiece of networked storage in the cluster provisioned by an administrator ● Lifecycle independent of any individual pod that uses the PV ● Types: ○ GCEPersistentDisk ○ RBD (Ceph) ○ Glusterfs ○ NFS ○ iSCSI ○ …
  • 20.
  • 21.
    Join the community! ●Slack - kubernetes.slack.com ● GitHub - https://github.com/kubernetes/kubernetes/
  • 22.