Marc Sluiter - 15 Kubernetes Features in 15 Minutes
-
Upload
marc-sluiter -
Category
Software
-
view
266 -
download
0
Transcript of Marc Sluiter - 15 Kubernetes Features in 15 Minutes
@slintes#Devoxx #Kubernetes
Who am I?
• Software Engineer @ Luminis Technologies
• Java, Go, Angular2
• Working on
• Amdatu
• INAETICS
• CloudRTI
@slintes#Devoxx #Kubernetes
Kubernetes
• Greek for "helmsman" or “pilot"
• schedules, runs and manages containers in a cluster of virtual or physical machines
• declarative approach:
• try permanently to reach the declared cluster state
@slintes#Devoxx #Kubernetes
Kubernetes
• started by Google in 2014
• based on over 10 years experience (“Borg”)
• first release in Juli 2015
• donated to Cloud Native Computing Foundation
• 100% Open Source
• Go
@slintes#Devoxx #Kubernetes
#1 Pods
• smallest deployable unit
• small group of tightly coupled containers
• shared network and data volumes
• routable IP address
• mortal!
@slintes#Devoxx #Kubernetes
#2 ReplicaSets
• run x copies (replicas) of a pod
• start or kill pods if necessary
• handle pod failures
• health checks
@slintes#Devoxx #Kubernetes
#3 Deployments
• contains declaration of your application
• which containers (image / tag)
• environment variables
• data volumes
• defines number of replicas
• creates ReplicaSets, which in turn create Pods
@slintes#Devoxx #Kubernetes
#4 Services
• pods are mortal!
• services provide a permanent virtual IP and DNS name
• proxy traffic to selected pods
• simple load balancing including session affinity
@slintes#Devoxx #Kubernetes
#5 Ingress
• expose services to the outside world
• map URLs to services
• SSL termination
• needs ingress provider
@slintes#Devoxx #Kubernetes
#6 Namespaces
• Namespaces group kubernetes resources (pods, replicasets, deployments, …)
• by default everything is in the “default” namespace
• create namespaces for your environments (e.g. test, staging, production) and / or tenants
• restrict access to specific namespaces for k8s users
• namespaces can have separated networks (depends on network provider)
@slintes#Devoxx #Kubernetes
#7 Clusters
• a cluster is a set of virtual or physical machines (nodes), running a k8s master and one or more k8s worker nodes
• cluster federation:
• run a federation master, which knows all your clusters
• run your apps distributed across clusters, e.g. across Amazon / Google / … regions
@slintes#Devoxx #Kubernetes
#8 Secrets and ConfigMaps
• separate your application code (= images) and configuration
• both Secrets and ConfigMaps are key-value-pairs
• use Secrets for binary values (e.g. certificates, keys)
• use ConfigMaps for string values
• both can be read by the container via environment variables or mapped into a data volume e.g. like property files
@slintes#Devoxx #Kubernetes
#9 Data Volumes
• map directories into containers
• multiple containers in one pod share the same volumes
• many volume types:
• empty directory, host directory, Google Persistent Disk, Amazon Blob Store, NFS, glusterfs, rdb, cephs, git repository, …
• can be preconfigured by cluster admins for easier usage by cluster users
@slintes#Devoxx #Kubernetes
#10 PetSets
• a Pet is a stateful pod
• a PetSet has a scalable number of Pets
• a Pet is bound to a dynamically created data volume
• that data volume will never be deleted automatically
• the Pet is bound to the same volume on a restart
@slintes#Devoxx #Kubernetes
#11 Jobs
• sometimes you need to run short living tasks
• a Job ensures that a container which executes such a task runs successfully exactly once (ore more times)
• retry on failure
• ScheduledJobs can be started at specific times (like cron)
@slintes#Devoxx #Kubernetes
#12 DaemonSets
• DaemonSets run pods on all (or a selected set of) nodes in the cluster
• useful for running containers for logging and monitoring
@slintes#Devoxx #Kubernetes
#13 Autoscaling
• Horizontal Pod Autoscaling
• scales ReplicaSets based on pod’s CPU usage or app-provided metrics
• Cluster Autoscaling
• scale the number of nodes in your cluster based on CPU and memory usage
• depends on cloud provider
@slintes#Devoxx #Kubernetes
#14 API
• every functionality is provided via a REST API
• easy integration in your existing workflows (continuous delivery)
• command line tool “kubectl” (uses the REST API internally)
@slintes#Devoxx #Kubernetes
#15 Community!
• constantly growing community
• active on Stackoverflow, Google Groups and Slack
• many contributors from many companies
• KubeCon conference
@slintes#Devoxx #Kubernetes
Links...
http://kubernetes.io @kubernetesio
https://github.com/kubernetes
http://www.luminis.eu http://luminis-technologies.com
http://www.amdatu.org http://www.inaetics.org
http://www.cloud-rti.com