-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move cluster create/delete to scripts
- Loading branch information
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
NAME=$1 | ||
KUBECONFIG=/tmp/admin.conf | ||
|
||
kind get clusters | grep "${NAME}" > /dev/null | ||
if [ $? -eq 1 ]; then | ||
kind create cluster --name "${NAME}" | ||
else | ||
echo "Cluster \"${NAME}\" already exists." | ||
fi | ||
|
||
docker pull kubernetes/pause | ||
kind load docker-image --name "${NAME}" kubernetes/pause | ||
kind get kubeconfig --name "${NAME}" > ${KUBECONFIG} | ||
|
||
echo "Output kubeconfig to ${KUBECONFIG}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
NAME=$1 | ||
|
||
kind get clusters | grep "${NAME}" > /dev/null | ||
if [ $? -eq 0 ]; then | ||
kind delete cluster --name "${NAME}" | ||
else | ||
echo "Cluster \"${NAME}\" does not exist." | ||
fi |
5e03763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to spend more time with this. The makefile doesn't work for me locally, but that's likely a result of my build environment. Almost everything info locally is just done in a docker container and as a result I almost never use makefiles. I'm still working my way through.