Skip to content

Commit

Permalink
Merge pull request #1 from trozet/fix_kind_clustername
Browse files Browse the repository at this point in the history
Fixes scaled nodes to be part of proper kind cluster
  • Loading branch information
lobuhi authored May 13, 2024
2 parents 5fe73b7 + 2632c0c commit 73a426f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kindscaler.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euxo pipefail

# Check for required commands
if ! command -v kind &> /dev/null; then
Expand Down Expand Up @@ -76,7 +77,7 @@ for i in $(seq $start_index $end_index); do
--security-opt seccomp=unconfined --security-opt apparmor=unconfined \
--tmpfs /tmp --tmpfs /run --volume /var \
--volume /lib/modules:/lib/modules:ro -e KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER \
--detach --tty --label io.x-k8s.kind.cluster=kind --net kind \
--detach --tty --label io.x-k8s.kind.cluster=$CLUSTER_NAME --net kind \
--restart=on-failure:1 --init=false $IMAGE > /dev/null 2>&1
NEW_IP=$(docker inspect $CLUSTER_NAME-$ROLE$i | grep IPAddress | tail -1 | cut -d "\"" -f 4)
sed -i -r "s/$ORIGINAL_IP/$NEW_IP/g" "./kubeadm-$i.conf"
Expand All @@ -95,7 +96,7 @@ for i in $(seq $start_index $end_index); do
--security-opt seccomp=unconfined --publish=127.0.0.1:$PORT:6443/TCP \
--security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run --volume /var \
--volume /lib/modules:/lib/modules:ro -e KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER \
--detach --tty --label io.x-k8s.kind.cluster=kind --net kind \
--detach --tty --label io.x-k8s.kind.cluster=$CLUSTER_NAME --net kind \
--restart=on-failure:1 --init=false $IMAGE > /dev/null 2>&1
NEW_IP=$(docker inspect $CLUSTER_NAME-$ROLE$i | grep IPAddress | tail -1 | cut -d "\"" -f 4)
sed -i -r "s/$ORIGINAL_IP/$NEW_IP/g" "./kubeadm-$i.conf"
Expand Down

0 comments on commit 73a426f

Please sign in to comment.