From 2d660d2f594084b1b727b1d8b0a88c220f8a0407 Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Fri, 29 Sep 2023 10:40:24 -0500 Subject: [PATCH] Add a single worker Kind config and deployment method (#354) * Add a single worker Kind config and deployment method * Free disk space update --- Makefile | 8 ++++++++ config/k8s-cluster/single-worker.yaml | 12 ++++++++++++ scripts/deploy-k8s-cluster-single-worker.sh | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 config/k8s-cluster/single-worker.yaml create mode 100755 scripts/deploy-k8s-cluster-single-worker.sh diff --git a/Makefile b/Makefile index 55278109..6640643a 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,14 @@ rebuild-cluster: delete-cluster ./scripts/delete-standard-storageclass.sh ./scripts/remove-control-plane-taint.sh +# Creates a k8s cluster with a single worker +rebuild-cluster-single-worker: delete-cluster + ./scripts/deploy-k8s-cluster-single-worker.sh + ./scripts/deploy-calico.sh + ./scripts/preload-images.sh + ./scripts/delete-standard-storageclass.sh + ./scripts/remove-control-plane-taint.sh + delete-cluster: ./scripts/delete-k8s-cluster.sh diff --git a/config/k8s-cluster/single-worker.yaml b/config/k8s-cluster/single-worker.yaml new file mode 100644 index 00000000..4cc73b7d --- /dev/null +++ b/config/k8s-cluster/single-worker.yaml @@ -0,0 +1,12 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +networking: + ipFamily: dual + disableDefaultCNI: true + apiServerAddress: "0.0.0.0" + apiServerPort: 6443 +nodes: + - role: control-plane + image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 + - role: worker + image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 diff --git a/scripts/deploy-k8s-cluster-single-worker.sh b/scripts/deploy-k8s-cluster-single-worker.sh new file mode 100755 index 00000000..2b6525b0 --- /dev/null +++ b/scripts/deploy-k8s-cluster-single-worker.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -x + +# Kind base with kindnetcni and ipv4/ipv6 +kind create cluster --config=config/k8s-cluster/single-worker.yaml