Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kubernetes in Docker - Killing Bugs with KINDness

Kubernetes in Docker - Killing Bugs with KINDness

Abstract: KIND - Kubernetes IN Docker - is a relatively new tool for running Kubernetes clusters within Docker. KIND enables engineers to spin up local development cluster in under a minute, utilising Docker containers as "nodes". KIND was originally born as a method of running conformance tests for the Kubernetes project itself, and has quickly gained in popularity within the community thanks to its fast startup time, ease of use, and growing feature set. In this talk I will briefly look at how KIND differs from other local cluster tools, discuss a range of possible use-cases for KIND - both for local development and within CI/CD pipelines, and finally demonstrate how you can get starting using KIND.

Josh Michielsen

July 25, 2019
Tweet

More Decks by Josh Michielsen

Other Decks in Programming

Transcript

  1. Killing Bugs with KINDness Introduction to Kubernetes in Docker (KIND)

    By Josh Michielsen Senior Software Engineer Condé Nast International (@condenasteng) 1
  2. 3

  3. What is KIND? kind is a tool for running local

    Kubernetes clusters using Docker container "nodes". - https://kind.sigs.k8s.io/ 4
  4. 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
  5. 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
  6. 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 <path/to/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
  7. 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
  8. 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.
  9. 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
  10. 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.