This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
minikube-start.sh
executable file
·58 lines (48 loc) · 2.07 KB
/
minikube-start.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
########
# Create and configure a new minikube cluster
#
# Env vars:
# - MINIKUBE_PROFILE: set the current minikube profile (optional, default="minikube")
# - MINIKUBE_DRIVER: minikube driver (optional, default=auto detected by minikube itself)
# - MINIKUBE_CPUS: number of CPUs for minikube cluster (optional, default=4)
# - MINIKUBE_MEMORY: MB of RAM assigned to minikube cluster (optional, default=8192)
# - MINIKUBE_KUBERNETES_VERSION: Kubernetes version to use (optional, default="v1.23.12")
########
SCRIPT_DIR_PATH=`dirname "${BASH_SOURCE[0]}"`
KUSTOMIZE_DIR="${SCRIPT_DIR_PATH}/../../kustomize"
disable_extra_components=$1
. "${SCRIPT_DIR_PATH}/configure.sh" minikube
stat "${SCRIPT_DIR_PATH}/../.." &> /dev/null || die "Can't cd to repository root"
minikube_opts=""
if [ -n "${MINIKUBE_DRIVER}" ]; then
minikube_opts="${minikube_opts} --driver=${MINIKUBE_DRIVER}"
fi
if [ -n "${MINIKUBE_CONTAINER_RUNTIME}" ]; then
minikube_opts="${minikube_opts} --container-runtime=${MINIKUBE_CONTAINER_RUNTIME}"
fi
set -x
minikube -p "${MINIKUBE_PROFILE}" ${minikube_opts} \
--memory "${MINIKUBE_MEMORY}" \
--cpus "${MINIKUBE_CPUS}" \
"--kubernetes-version=${MINIKUBE_KUBERNETES_VERSION}" \
start
sleep 30
minikube -p "${MINIKUBE_PROFILE}" addons enable ingress
sleep 5
minikube -p "${MINIKUBE_PROFILE}" addons enable ingress-dns
sleep 5
minikube -p "${MINIKUBE_PROFILE}" addons enable registry
sleep 5
if [ "${disable_extra_components}" != 'true' ]; then
kustomize build ${KUSTOMIZE_DIR}/overlays/local/keycloak | kubectl apply -f -
sleep 5
kubectl wait pod -l app-component=keycloak --for=condition=Ready --timeout=600s -n keycloak
sleep 5
istioctl manifest apply --skip-confirmation --set values.gateways.istio-ingressgateway.type="ClusterIP" -f ${SCRIPT_DIR_PATH}/istio-manifest.yaml
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/v0.9.0/manifests/setup/prometheus-operator-0servicemonitorCustomResourceDefinition.yaml
. "${SCRIPT_DIR_PATH}/knative-installer.sh"
sleep 5
. "${SCRIPT_DIR_PATH}/camel-k-installer.sh"
fi
set +x