Kubernetes in Docker (KinD) — Cluster Bootstrap Script for Continuous Integration

$ ./kind.sh --help
usage: kind.sh [--name ]
[--num-workers ]
[--config-file ]
[--kubernetes-version ]
[--cluster-apiaddress ]
[--cluster-apiport ]
[--cluster-loglevel ]
[--cluster-podsubnet ]
[--cluster-svcsubnet ]
[--disable-default-cni]
[--install-calico-cni]
[--install-cilium-cni]
[--install-multus-cni]
[--install-istio]
[--install-metallb]
[--install-nginx-ingress]
[--install-contour-ingress]
[--install-istio-gateway-api]
[--install-contour-gateway-api]
[--install-olm]
[--help]

--name Name of the KIND cluster
DEFAULT: kind
--num-workers Number of worker nodes.
DEFAULT: 0 worker nodes.
--config-file Name of the KIND J2 configuration file.
DEFAULT: ./kind.yaml.j2
--kubernetes-version Flag to specify the Kubernetes version.
DEFAULT: Kubernetes v1.21.1
--cluster-apiaddress Kubernetes API IP address for kind (master).
DEFAULT: 0.0.0.0.
--cluster-apiport Kubernetes API port for kind (master).
DEFAULT: 6443.
--cluster-loglevel Log level for kind (master).
DEFAULT: 4.
--cluster-podsubnet Pod subnet IP address range.
DEFAULT: 10.128.0.0/14.
--cluster-svcsubnet Service subnet IP address range.
DEFAULT: 172.30.0.0/16.
--disable-default-cni Flag to disable Kind default CNI - required to install custom cni plugin.
DEFAULT: Default CNI used.
--install-calico-cni Flag to install Calico CNI Components.
DEFAULT: Don't install calico cni components.
--install-cilium-cni Flag to install Cilium CNI Components.
DEFAULT: Don't install cilium cni components.
--install-multus-cni Flag to install Multus CNI Components.
DEFAULT: Don't install multus cni components.
--install-istio Flag to install Istio Service Mesh Components.
DEFAULT: Don't install istio components.
--install-metallb Flag to install Metal LB Components.
DEFAULT: Don't install loadbalancer components.
--install-nginx-ingress Flag to install Ingress Components - can't be used in combination with istio.
DEFAULT: Don't install ingress components.
--install-contour-ingress Flag to install Ingress Components - can't be used in combination with istio.
DEFAULT: Don't install ingress components.
--install-istio-gateway-api Flag to install Istio Service Mesh Gateway API Components.
DEFAULT: Don't install istio components.
--install-contour-gateway-api Flag to install Ingress Components - can't be used in combination with istio.
DEFAULT: Don't install ingress components.
--install-olm Flag to install Operator Lifecyle Manager
DEFAULT: Don't install olm components.
Visit https://operatorhub.io to install available operators
--delete Delete Kind cluster.
stages {
stage('Prepare workspace') {
steps {
git credentialsId: 'github-ssh', url: 'git@gist.github.com:ab7fb36162f39dbed08f7bd90072a3d2.git'
}
}

stage('Create Kind cluster') {
steps {
sh '''#!/bin/bash
bash ./kind.sh --kubernetes-version v1.21.1 \
--install-nginx-ingress
'''
}
}
stage('Clean-up workspace') {
steps {
sh 'rm -rf *'
}
}
}
...
stage ('Create Kind cluster') {
steps {
build job: 'create-kind-cluster'
}
}
...

--

--

Highly versatile Senior technical Lead Engineer, I am a consummate and competent qualified IT Professional specialising in distributed systems

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store