Damien Russell
Artist, gamer, and software engineer, I'm a well rounded nerd.
Damien Russell
intro to k8s
originates from Greek, meaning helmsman or pilot
replace 8 letters “ubernete” with an “8”
Cuban Yeti(s)
A management environment for
container orchestration
Kubernetes is comprised of a set of independent, composable control processes that continuously drive the current state towards the provided desired state.
It shouldn’t matter how you get from A to C.
source:
Worker Nodes and Masters Nodes
Nodes
Masters
k8s is comprised of three parts
Add-Ons
Node Components
Master Components
MASTER COMPONENTS
These run on each master in the cluster
KUBE CONTROLLER MANAGER
Control Plane component that runs controller processes.
CLOUD CONTROLLER MANAGER
Cloud controller manager runs cloud-provider specific controller loops only
NODE COMPONENTS
These run on each node in the cluster
While the other addons are not strictly required, all Kubernetes clusters should have cluster dns in order to serve DNS records for Kubernetes services
Manage the System
Manage what lives on the system
Services, Jobs, Deployments
Secrets...
Masters, Nodes, Volumes, Networks...
A Simple REST API
kubectl
cli for communicating with the api
client libraries
official libraries: Go, Python, Java, dotnet, Javascript
full list of libraries:
interacting with the api
A cli tool that wraps calls to the api for you.
Trouble Shooting
Kubernetes Objects
Persistent Entities that act as Records of Intent
Objects can describe:
Object Spec and Status == Desired State and Current State
master components
node components
Single Node Cluster
/* start minikube */
$ minikube start
/* check your context */
$ kubectl config current-context
/* view kubeconfig for the cluster kubectl has context for */
$ kubectl config view
/** get a url to access your cluster */
$ kubectl cluster-info
/* create a deployment using our image expose port 80 */
$ kubectl run friendlyhello --image=olofguard/friendlyhello:v1 --port=80
/* create a service that exposes the new deployment via an ephemeral node port */
$ kubectl expose deploy friendlyhello --type=NodePort
/* list all the deployments in the default namespace */
$ kubectl get deploy,svc
/* scale the deployment to 2 pods */
$ kubectl scale --replicas=2 deploy/friendlyhello
/* deploy a new version of the app */
$ kubectl set image deploy/friendlyhello friendlyhello=olofguard/friendlyhello:v2
masters
nodes
AWS
Our Vpc
m5.large
m5.xlarge
$ kops create cluster --v=8 $NAME --cloud aws \
--zones "us-east-1b,us-east-1c,us-east-1d" \
--master-zones "us-east-1b,us-east-1c,us-east-1d" \
--networking flannel \
--topology private \
--node-count 3 \
--node-size m4.large \
--ssh-public-key $SSH_PUBLIC_KEY \
--master-size m3.medium \
--cloud-labels "Environment=dev,Cluster=suit" \
--target terraform \
--out=./dev/terraform \
--kubernetes-version=1.8.3
The Old Way to Create
$ eksctl create cluster \
--name k8s-suit \
--without-nodegroup
The New Way to Create
OR
By Damien Russell
k8s basics with minikube