Files
kube-prometheus/hack/cluster-monitoring/deploy
Frederic Branczyk 309c677270 kube-prometheus: extract ServiceMonitors into single files
Starting with Kubernetes 1.6 `kubectl apply` works for TPRs so we can
start using it, therefore using multiple files is no issue.
2017-04-27 12:44:46 +02:00

32 lines
823 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 apply -f manifests/prometheus-operator
# Wait for TPRs to be ready.
printf "Waiting for Operator to register third party objects..."
until kctl get servicemonitor > /dev/null 2>&1; do sleep 1; printf "."; done
until kctl get prometheus > /dev/null 2>&1; do sleep 1; printf "."; done
until kctl get alertmanager > /dev/null 2>&1; do sleep 1; printf "."; done
echo "done!"
kctl apply -f manifests/exporters
kctl apply -f manifests/grafana/grafana-credentials.yaml
kctl apply -f manifests/grafana
kctl apply -f manifests/prometheus/
kctl apply -f manifests/alertmanager/