-
Notifications
You must be signed in to change notification settings - Fork 26
/
setup-kubernetes.sh
executable file
·36 lines (30 loc) · 1.03 KB
/
setup-kubernetes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env sh
######################################
# Setup script for local developemnt #
######################################
set -ex
while getopts c:t: flag; do
case "${flag}" in
c) CLUSTER_OPTION=${OPTARG} ;;
t) TYPE_OPTION=${OPTARG} ;;
*) ;;
esac
done
CLUSTER_NAME=${CLUSTER_OPTION:-kind}
TYPE=${TYPE_OPTION:-java}
if [ "$TYPE" = "java" ]; then
TYPE_CMD="dockerBuild"
elif [ "$TYPE" = "native" ]; then
TYPE_CMD="dockerBuildNative"
fi
kind get clusters
./gradlew clean $TYPE_CMD --refresh-dependencies
kind --name "$CLUSTER_NAME" load docker-image micronaut-kubernetes-example-service:latest
kind --name "$CLUSTER_NAME" load docker-image micronaut-kubernetes-example-client:latest
kind --name "$CLUSTER_NAME" load docker-image micronaut-kubernetes-client-example:latest
kind --name "$CLUSTER_NAME" load docker-image micronaut-kubernetes-informer-example:latest
kind --name "$CLUSTER_NAME" load docker-image micronaut-kubernetes-operator-example:latest
#
# Run Kubernetes API proxy
pkill -9 kubectl || true
kubectl proxy &