Intro to Kubernetees (K8S)
At We've
- 2012 -Monolith Python app (turned off 4 weeks ago)
- 2014 - Migration to Go & Microservices (on their own VM each $$$$)
- 2016 - Kubernetees in prod (in a month!)
- 2018 - Service mesh in prod
Go
Go can compile down to it's own binary, which basically means that you only need "scratch" docker image mindblown
- Docker
- rkt
- ContainerD - docker except more opensource
How do manage if you have thousands???
- Resource usage?
- How do you rolling updates with no downtime?
Kubernetes: orchestration tools
Google's Borg: their private instance of Kubernetes. for 15 years
They behave as one machine
One of the most active projects on Github.
AWS launched their own hosted version of Kubernetes.
So let me get this strait. You want to build an external version of the borg task schedule. One of the most important competitive advantages. The one we don't even talk about externally. And. On top of that, you want to open source it?
Install
- Mini-cube is the easiest bet + virtual box
Architecture
- Work nodes
- Master nodes
Key value store
API server -> what you talk to
Manager:
- make sure it's in the right state
Scheduler
- What services startup were
kubelet / proxy
- a bunch of docker containers (simplified)
kubectl: cube cuttle?
Pods
This is the biggest difference. (Mesos wasn't on the map)
the lowest level is a pod. And a pod can multiple containers. It has an IP address. It can have volumes as well.
You have a micro service inside the container that just has a address, we could change how it works.
YML defines a pod
kubectl run busy box -i -t --image busy box --restart=Never /bin/sh
^- drops you into a cli
minikube dashbaord (visualize)
What happens when a pod runs out of memory
kubectl -f <confg.yml>
Pods are ephemeral (mortal), it's just going to create new ones every time, new ip's every time
Pods random hostname etc...
Services logical grouping of pods
- round-robin requests to them
- Example
- Selector:
- route to right pod specifically
- Services
- NodePort: easy way
How do we do rolling updates and other fancy magic???
Promethius Bringing -Fire- Kubernetees to man
Deployment
- Wraps around pods, declarative
- Auto-scaling setup
Creating your own kind of Object in K8s
kc create
- Create a smoke tests
- etc.
Defining it:
- nice name
- Version name
- spec:
- any key values you want
Service Mesh - Helm
-
Dedicated infrastructure for handling service to service communication
-
Sidecar: middleware?