Slide 1

Slide 1 text

Killing Bugs with KINDness Introduction to Kubernetes in Docker (KIND) By Josh Michielsen Senior Software Engineer Condé Nast International (@condenasteng) 1

Slide 2

Slide 2 text

About Me Senior Software Engineer Australian Cyclist Photographer Dog Lover @jmickey_ jmichielsen jmickey mickey.dev [email protected] 2

Slide 3

Slide 3 text

3

Slide 4

Slide 4 text

What is KIND? kind is a tool for running local Kubernetes clusters using Docker container "nodes". - https://kind.sigs.k8s.io/ 4

Slide 5

Slide 5 text

KIND Architecture 5 via https://kind.sigs.k8s.io/docs/design/initial

Slide 6

Slide 6 text

Why KIND? 6 1 Rapid startup time (~30 sec) 2 Supports multi-node HA clusters 3 Supports Windows, macOS, and Linux 4 CNCF certified conformant 5 Exposes the Kubeadm config surface

Slide 7

Slide 7 text

Installing KIND 1 Via Go GO111MODULE=”on” go get sigs.k8s.io/[email protected] 2 Via Docker (from source) git clone https://github.com/kubernetes-sigs/kind.git make build 3 Via Pre-Compiled Binaries Download from https://github.com/kubernetes-sigs/kind/releases Copy to $PATH 7

Slide 8

Slide 8 text

8 kind create cluster

Slide 9

Slide 9 text

9 Launch Specific Kubernetes Version kind create cluster --image kindest/node:v1.13.7 Additional Clusters kind create cluster --name cluster-2 Pass Config kind create cluster --config Retrieve KubeConfig & Set $KUBECONFIG kind get kubeconfig export KUBECONFIG="$(kind get kubeconfig-path)" Sideload Docker Image kind load docker-image hello-world Sideload Docker Archive kind load image-archive archive.tar.gz

Slide 10

Slide 10 text

10 KIND has its own configuration API which can be used to describe the desired state of a cluster. Such as: - Nodes - Port Mappings - Networking KIND also exposes the Kubeadm configuration surface through config patch structs. Configuration

Slide 11

Slide 11 text

11 HA Cluster Additional Port Mappings Use with NodePort services to allow ingress to applications.

Slide 12

Slide 12 text

12 Kubeadm Patch

Slide 13

Slide 13 text

13 Use Cases 1 Local Development. Caveats: No Load Balancer or ClusterIP support. Limited use case for testing ingress services. 2 CI: Helm Charts Validation Test that changes to helm charts within CI to ensure all services are deployed correctly. 3 Cluster Config Sanity check cluster config changes, e.g. Pod Affinity/Anti-Affinity. 4 Pre-merge Ephemerial Deployments Testing application changes in short-lived environments. A common use case within the Kubernetes team is testing Operators.

Slide 14

Slide 14 text

KIND in CI KIND has been tested, and is working, within a number of popular CI systems, including: CircleCI, TravisCI, GitLab, Concourse, Azure Pipelines, and Drone. A repo of example configurations for various CI systems is maintained here: https://github.com/kind-ci/examples 14

Slide 15

Slide 15 text

Comparison to Alternatives 15 Minikube ● Either requires a Hypervisor, or will create a container for each control plane component. ● Not CI friendly. ● Much slower to start. Docker Desktop Kubernetes ● Slow to install. ● Single node cluster, no HA support. ● Not CI friendly. ● More resource intensive.

Slide 16

Slide 16 text

Additional Features 16 Mount host machine filesystem paths Customise networking Customisable listenAddress and API ports

Slide 17

Slide 17 text

17 @jmickey_ jmichielsen jmickey mickey.dev [email protected] Thanks for listening!