Kubernetes presentation for SASAG.org meetup
Donovan Finch, SASAG President
Powered by Vimdeck
Donovan Finch AWS Cloud Support Engineer - Deployment services github.com/finchd www.linkedin.com/in/finchd @positvpessimist
Who is this talk for?
Who is Kubernetes (k8s) for?
What's in the talk?
Set a program's operating environment like it was a VM:
Then distribute the result as a single object, just like a VM image.
That's it!
Design Note: Restarting a container or deleting and making new should have the same effect. Store persistent state outside.
and why is it so hard to spell?
k8s is still rapidly changing - any book is immediately out of date, kubernetes.io/docs/ are excellent but incomplete
Words! pods, volumes, labels, annotations, nodes/workers, masters
CM agents are in a race to enforcement. Maybe your change is applied everywhere, maybe you missed one?
Read-Only production systems keep people mutating changes in other, safer places:
If you don't have staging systems, local laptop/desktop historically didn't match OS of Prod
Realtime vs Human-time
Orchestration was always also required, whether you used CM or not
Active/reactive The goal of "Automation" in general
Restart on container exit Recreate new containers on other workers when a worker stops responding update to newest version / rollback
"publish" - make reachable from outside cluster's CNI network usually makes a load balancer in cloud account or bind to a publically-routable IP address
keep data - Volumes abstract a place for permanent data - admins can set what kinds (LVM, glusterfs, NFS) are allowed and how big, by whom
Things you make in kubernetes
Pod: group of containers sharing a network namespace (setns), localhost, and one IP on the CNI network Ex. httpd, nrpe plugins, logstash/filebeat/fluentd log shipper in seperate containers
Volume+VolumeClaim: storage abstraction for persistent data
Deployment: plural of pod. run X copies of the pod simultaneously on multiple nodes, and X is mutable, but manually and through automation
Rollout: Created by an update to a deployment, can walk the timeline of rollouts, and revert
Service: Allow inbound traffic to a Deployment's pods. Types:
DaemonSet - Always run one of this pod per node (log shipper, etc)
kubernetes is made of plugins!
Worker components:
container runtime: Docker/rkt/cri-o
Container Network Interface (CNI)
Kubelet: the worker
cAdvisor: performance metrics gathering
kube-proxy:
Master components: Worker components +
Kubernetes Dashboard - Service+Deployment that comes pre-installed on most hosted k8s
Prometheus - FLOSS pull (polling) metrics server
fluentd DaemonSet - log shipping agent
Horizontal Pod AutoScaler - dynamic update of Service's pod count based on container metrics
Cluster AutoScaling - dynamically create/destroy cluster nodes based on cluster/container metrics (AWS EC2 AutoScaling Group, etc)
a dozen different installers aimed at various skill-levels/node types (VMware, Azure, GCE, AWS)
minikube - local single-VM with all components (Hyper-V, VirtualBox, KVM, xhyve, etc)
kubeadm - generic by-hand installer runs per node, you have to make nodes first
AWS: kops, tectonic, kube-aws, AWS EKS (hosted)
GCE: kube-up.sh, Google GKE (hosted)
Azure: ACS-Engine, Azure ACS (hosted)
Ansible-based kubespray
everything talks to the kube-apiserver REST JSON API
** kubectl with YAML
jsonnet meta-JSON
place YAML files in a folder on the master
minikube on KVM at home
kops on AWS
EKS on AWS