Unit #1
Hello, k8s!

use ←↑↓→ or <space>

Skyscrapers vs. Skylines


Scaling up

Adds resources (CPU, memory) to the server

Oldest capacity management method


Hardware can only get so big

Time, money, or technical reasons


Scaling out

Adds more servers to application

Multiple for the same part of the app


Requires app re-architecting

Can be difficult for humans to manage, troubleshoot

Containers and clustering



Libraries, versions, key configuration

Co-hosted apps may have conflicting requirements!


Packages OS image with application

Dependencies managed as single unit


Popular container toolkit

Simplifies underlying container details

Strong developer support


Clustering containers

Requires deep knowledge

Difficult to manage manually

What to manage?

  • Provisioning
  • Resource limits & access policies
  • Network, firewall, load balancing
  • Health monitoring
  • Lots more...

Kubernetes to the rescue!

Container orchestrator

Coordinates hosts (nodes) to act as one

Deploys instances, distributes load, delivers resources

Open source

Created by Google, maintained by CNCF

Available on Github

Expressive power

Pods only one manageable object

Taylor k8s to your app, not the other way around


Objects defined as declarative YAML

Can be live edited, patched, diffed

Terminal friendly

kubectl command

Single point of access to cluster

Plays well with scripts, automation

Hosting Kubernetes


More work, but you control everything

Requires dedicated staff to maintain

Dedicated manager node required


  1. Install Docker, kubelet
  2. Install kubeadm, kubectl on manager
  3. Install Container Networking, such as Calico
  4. Use kubeadm to stand up cluster

Tutorial on Linode docs


Requires additional infrastructure for k8s

NFS works, Ceph, Rook, Heketi are k8s native

Managed hosting

Like a VPS, but for k8s workloads

Pay only for workers, storage baked in


Amazon, Azure, DigitalOcean, Google GKE, others

Pick the Right Solution on k8s docs


Worldwide k8s provider

REST-based API

Creating a cluster


Always estimate capacity first!

New servers easier to add in k8s

Server count

2 worker nodes minimum

3 or more is best

CPU, memory

Balance hosting costs with needed resources

Start with today's resources * 1.25


Scaling out easier on managed k8s

Plan, but not too hard!


Done at hosting provider level

Via web portal, API, or dedicated CLI app

Not kubectl!

Using the API

POST a JSON request using curl

ten7.digitalocean role on Ansible Galaxy

Using the web portal


Create > Clusters


Using kubectl


Multiple options, different pros, cons

From dist

Installs only needed binaries


Package Manager

homebrew on macOS

Chocolatey, Scoop, or Powershell Gallery On Windows

Linux: use your distro's default

Docker for Mac, Win

kubectl included out of the box

Docker needed to develop containers

Large (1GB) download, requires account


Depends on hosting provider

CLI command, auth token, kubeconfig file

Getting kubeconfig

  1. cloud.digitalocean.com
  2. Manage > Kubernetes
  3. Click Download config file

Getting via API

Better for scripts, automation

ten7.digitalocean_kubeconfig role

Using a Service Account

Requires prior access

Advanced, has security implications

Command form

kubectl verb object

Listing worker nodes

$ kubectl get nodes

web-pool-b64y   Ready    <none>   2d13h   v1.13.10
web-pool-b6hs   Ready    <none>   2d13h   v1.13.10
web-pool-b6hu   Ready    <none>   2d14h   v1.13.10

Getting details

kubectl describe node nodeName

Lists status, CPU, memory allocation, and more

Lab #1

  1. Install kubectl
  2. Create cluster
  3. Download kubeconfig file
  4. Interact with cluster