Damien Russell

intro to k8s

a.k.a. k8s

originates from Greek, meaning helmsman or pilot

 replace 8 letters “ubernete” with an “8”

Cuban Yeti(s)

What is it?

  • a container platform
  • a microservices platform
  • a portable cloud platform 

A management environment for 

container orchestration

What is it?

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:

What is it?

Worker Nodes and Masters Nodes

Nodes

Masters

What is it?

k8s is comprised of three parts

Add-Ons 

Node Components

Master Components

What is it?

MASTER COMPONENTS

These run on each master in the cluster

What is it?

KUBE CONTROLLER MANAGER

Control Plane component that runs  controller processes.

  • Node Controller
  • Replication Controller
  • Endpoints Controller
  • Service Account & Token Controllers

What is it?

CLOUD CONTROLLER MANAGER

Cloud controller manager runs cloud-provider specific controller loops only

  • Node Controller
  • Route Controller
  • Service Controller
  • Volume Controller

What is it?

NODE COMPONENTS

These run on each node in the cluster

Add Ons

Not Strictly Required

  • Monitoring (prometheus and grafana)
  • Cluster Level Logging
  • and many more...

While the other addons are not strictly required, all Kubernetes clusters should have  cluster dns in order to serve DNS records for Kubernetes services

 

DNS IS Required

k8s all together

k8s API

Manage the System

Manage what lives on the system

Services, Jobs, Deployments

Secrets...

Masters, Nodes, Volumes, Networks...

A Simple REST API

k8s API

kubectl

cli for communicating with the api

client libraries

 

official libraries: Go, Python, Java, dotnet, Javascript

 

interacting with the api

kubectl

A cli tool that wraps calls to the api for you.

kubectl

Trouble Shooting

k8s API

Kubernetes Objects

Persistent Entities that act as Records of Intent

  • what's running
  • resources available
  • policies around how things behave

Objects can describe:

Object Spec and Status == Desired State and Current State

Minikube

master components

node components

Single Node Cluster

Minikube

/* 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

Infastructure

masters

nodes

AWS

Our Vpc

m5.large

m5.xlarge

Infastructure

$ 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

Infastructure

$ eksctl create cluster \
 --name k8s-suit \
 --without-nodegroup

The New Way to Create

OR

Kubernetes Intro to k8s

By Damien Russell

Kubernetes Intro to k8s

k8s basics with minikube

  • 813