Skip to content

Commit

Permalink
Add kind cluster setup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishant Patil authored and Nishant Patil committed Feb 17, 2024
1 parent be2d917 commit ce67db1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kind/delete_kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

for cluster in $(kind get clusters); do
echo "deleting.. $cluster"
kind delete cluster --name $cluster
done
12 changes: 12 additions & 0 deletions kind/kind_config1.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions kind/kind_config2.yaml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions kind/start_kind.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit ce67db1

Please sign in to comment.