Files
kube-prometheus/hack/cluster-monitoring/deploy
Chance Zibolski c845c3c96b Don't pass $KUBECONFIG to kubectl --kubeconfig flag
The $KUBECONFIG variable is like $PATH, and supports multiple files
separated by `:`, but --kubeconfig only takes a single file as a value.
Since kubectl picks up the $KUBECONFIG variable already, don't pass it
to kubectl.

Also, use --namespace instead of -n to support older kubectl versions.
2016-12-30 11:39:25 -08:00

28 lines
608 B
Bash
Executable File

#!/usr/bin/env bash
if [ -z "${KUBECONFIG}" ]; then
export KUBECONFIG=~/.kube/config
fi
if [ -z "${NAMESPACE}" ]; then
NAMESPACE=monitoring
fi
kubectl create namespace "$NAMESPACE"
kctl() {
kubectl --namespace "$NAMESPACE" "$@"
}
kctl create -f manifests/prometheus-operator.yaml
# Wait for TPRs to be ready.
until kctl get servicemonitor; do sleep 1; done
until kctl get prometheus; do sleep 1; done
until kctl get alertmanager; do sleep 1; done
kctl create -f manifests/exporters
kctl create -f manifests/grafana
kctl create -f manifests/prometheus
kctl create -f manifests/alertmanager