diff --git a/kind/delete_kind.sh b/kind/delete_kind.sh new file mode 100644 index 0000000..3383b97 --- /dev/null +++ b/kind/delete_kind.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +for cluster in $(kind get clusters); do + echo "deleting.. $cluster" + kind delete cluster --name $cluster +done \ No newline at end of file diff --git a/kind/kind_config1.yaml b/kind/kind_config1.yaml new file mode 100644 index 0000000..c6575e8 --- /dev/null +++ b/kind/kind_config1.yaml @@ -0,0 +1,12 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +name: kind-1 +networking: + apiServerAddress: "127.0.0.1" + apiServerPort: 8443 +nodes: +- role: control-plane + #image: kindest/node:v1.27.3 + extraPortMappings: + - containerPort: 6443 + hostPort: 8081 # maps to spire server on kind-1 cluster diff --git a/kind/kind_config2.yaml b/kind/kind_config2.yaml new file mode 100644 index 0000000..13d38c3 --- /dev/null +++ b/kind/kind_config2.yaml @@ -0,0 +1,12 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +name: kind-2 +networking: + apiServerAddress: "127.0.0.1" + apiServerPort: 9443 +nodes: +- role: control-plane + #image: kindest/node:v1.27.3 + extraPortMappings: + - containerPort: 6443 + hostPort: 8082 # maps to spire server on kind-2 cluster diff --git a/kind/start_kind.sh b/kind/start_kind.sh new file mode 100644 index 0000000..6275cf6 --- /dev/null +++ b/kind/start_kind.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# kind-1 +KINDCONFIG1="$PWD/kind_config1.yaml" +KUBECONFIG1="$PWD/kind-1.kubeconfig" +kind create cluster --config $KINDCONFIG1 +kind get kubeconfig --name kind-1 > $KUBECONFIG1 +echo "kind-1 Kubeconfig generated - $KUBECONFIG1" + +# kind-2 +KINDCONFIG2="$PWD/kind_config2.yaml" +KUBECONFIG2="$PWD/kind-1.kubeconfig" +kind create cluster --config $KINDCONFIG +kind get kubeconfig --name kind-1 > $KUBECONFIG2 +echo "kind-1 Kubeconfig generated - $KUBECONFIG2"