Kind - Quickstart with Ingress Controller and more…
Helper to create a local Kubernetes in docker (kind) cluster with Ingress, NetworkPolicy support (with canal or calico) and RWX PersistentVolume (with extraMounts).
Requirements
Description
kind/quickstart.sh script performs the following operations :
- Create a kind cluster with a generated configuration including :
extraPortMappings
to deploy ingress controller on the master node (like config/ingress-ready.yaml)extraMounts
of/var/devbox
on/devbox
for each node (see PV and PVC in docs/nginx-rwx.yml)- OIDC authentication
- Optionally install custom CNI (canal or calico)
- Install metric-server
- Install cert-manager with a mkcert cluster issuer (if locally available)
- Install traefik or nginx-ingress-controller with kind compatible config
- Install whoami sample app
- Install kubernetes-dashboard
Parameters
Name | Description | Default value |
---|---|---|
KIND_CLUSTER_NAME |
The name of the kind cluster | devbox |
KIND_WORKER_COUNT |
The number of worker node | 3 |
KIND_CNI |
Customize CNI using “default”, “calico” or “canal” (note that default doesn’t supports NetworkPolicies) | default |
KIND_ADMISSION_PLUGINS |
Allows to customize admission plugins | NodeRestriction,ResourceQuota |
DEVBOX_INGRESS (1) |
Allows to install either traefik or nginx | traefik |
KIND_INGRESS_READY |
Allows to disable extraPortMappings on ports 80 and 443 |
1 |
DOCKERHUB_PROXY |
Allows to use a mirror for DockerHub | "" |
KIND_OIDC_ISSUER_URL (2) |
Allows to enable OIDC authentication | "" |
(1) Note that
k8s-install.sh
must use the same value. (2) Do not add useless “/” (${KIND_OIDC_ISSUER_URL}/.well-known/openid-configuration
must exists)
Usage
# Delete cluster if exists
kind delete clusters devbox
# Create kind cluster and deploy
bash kind/quickstart.sh
How it works?
An helper script ( kind/config/generate.sh ) allows to generate kind configuration with some options :
# Number of worker nodes
export KIND_WORKER_COUNT=5
# enable OIDC auth on Kubernetes API
export KIND_OIDC_ISSUER_URL=https://keycloak.quadtreeworld.net/realms/master
# use a mirror for dockerhub
export DOCKERHUB_PROXY=https://docker-mirror.quadtreeworld.net
# Install custom CNI (required for NetworkPolicies)
# default, calico or canal
export KIND_CNI=calico
# Generate config to create kind cluster
bash kind/config/generate.sh
Ressources
- kind.sigs.k8s.io - Quick Start
- kind.sigs.k8s.io - Setting Up An Ingress Controller
- kind.sigs.k8s.io - Installing MetalLB using default manifests
- See metallb-install.sh where a “.0/24” subnet is required for kind