From 7eabf8618356e841d272971688f48dddc0573101 Mon Sep 17 00:00:00 2001
From: Andri Joos <andri@joos.io>
Date: Mon, 3 Mar 2025 16:30:12 +0100
Subject: [PATCH] fixup! add distribution.create_cluster

---
 distribution.create_cluster.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/distribution.create_cluster.sh b/distribution.create_cluster.sh
index f16946b..e7e7ea6 100644
--- a/distribution.create_cluster.sh
+++ b/distribution.create_cluster.sh
@@ -15,4 +15,21 @@ k3d cluster create distribution \
     --kubeconfig-update-default=true \
     --kubeconfig-switch-context=true
 
+calico_dir="/tmp/calico"
+git clone https://git.420joos.dev/kubernetes-cluster/networking/calico.git "${calico_dir}"
+
+calico_repo_name="projectcalico"
+helm repo add ${calico_repo_name} https://docs.tigera.io/calico/charts
+helm upgrade calico ${calico_repo_name}/tigera-operator \
+    --install \
+    --version "${CALICO_VERSION:-v3.29.2}" \
+    --namespace ${NAMESPACE} \
+    --create-namespace \
+    --values "${calico_dir}/values.yaml" \
+    --wait \
+    --set "installation.calicoNetwork.ipPools[0].cidr=${CLUSTER_CIDR}"
+
+helm repo remove ${calico_repo_name}
+rm -rf "${calico_dir}"
+
 # TODO: setup cluster for usage (agent & maybe calico)
-- 
GitLab