mirror of
https://github.com/prometheus-operator/kube-prometheus.git
synced 2025-08-21 22:41:01 +02:00
20 lines
580 B
Bash
Executable File
20 lines
580 B
Bash
Executable File
#!/bin/bash
|
|
|
|
which kind
|
|
if [[ $? != 0 ]]; then
|
|
echo 'kind not available in $PATH, installing latest kind'
|
|
# Install latest kind
|
|
curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest \
|
|
| grep "browser_download_url.*kind-linux-amd64" \
|
|
| cut -d : -f 2,3 \
|
|
| tr -d \" \
|
|
| wget -qi -
|
|
mv kind-linux-amd64 kind && chmod +x kind
|
|
fi
|
|
|
|
cluster_created=$($PWD/kind get clusters 2>&1)
|
|
if [[ "$cluster_created" == "No kind clusters found." ]]; then
|
|
$PWD/kind create cluster
|
|
else
|
|
echo "Cluster '$cluster_created' already present"
|
|
fi |