Files
kube-prometheus/hack/cluster-monitoring/teardown
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

24 lines
490 B
Bash
Executable File

#!/usr/bin/env bash
if [ -z "${KUBECONFIG}" ]; then
export KUBECONFIG=~/.kube/config
fi
if [ -z "${NAMESPACE}" ]; then
NAMESPACE=monitoring
fi
kctl() {
kubectl --namespace "$NAMESPACE" "$@"
}
kctl delete -f manifests/exporters
kctl delete -f manifests/grafana
kctl delete -f manifests/prometheus
kctl delete -f manifests/alertmanager
# Hack: wait a bit to let the controller delete the deployed Prometheus server.
sleep 5
kctl delete -f manifests/prometheus-operator.yaml