mirror of
https://github.com/prometheus-operator/kube-prometheus.git
synced 2025-10-27 22:21:34 +01:00
28 lines
646 B
Bash
Executable File
28 lines
646 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
if [ -z "${KUBECONFIG}" ]; then
|
|
KUBECONFIG=~/.kube/config
|
|
fi
|
|
|
|
if [ -z "${NAMESPACE}" ]; then
|
|
NAMESPACE=monitoring
|
|
fi
|
|
|
|
kubectl --kubeconfig="$KUBECONFIG" create namespace "$NAMESPACE"
|
|
|
|
kctl() {
|
|
kubectl --kubeconfig="$KUBECONFIG" -n "$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
|