forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-setup-minikube.sh
executable file
·32 lines (25 loc) · 1.06 KB
/
ci-setup-minikube.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
#!/bin/bash
set -euo pipefail
if [[ -z "${CI:-}" ]]; then
echo "Aborted: this script is for use in CI, it may alter your system in an" \
"unwanted way" >&2
exit 1
fi
KUBERNETES_VERSION="${KUBERNETES_VERSION:?required}"
MINIKUBE_VERSION="${MINIKUBE_VERSION:?required}"
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:?required}"
set -x
curl -Lo kubectl \
"https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/ && rm kubectl
curl -Lo minikube \
"https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64"
sudo install minikube /usr/local/bin/ && rm minikube
minikube config set profile minikube
minikube config set vm-driver docker
minikube config set kubernetes-version "$KUBERNETES_VERSION"
minikube config set container-runtime "$CONTAINER_RUNTIME"
# Start minikube, try again once if fails and print logs if the second
# attempt fails too.
minikube start --wait=all || { minikube delete && minikube start --wait=all; } || minikube logs
kubectl cluster-info