24 lines
529 B
Bash
Executable File
24 lines
529 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -o xtrace
|
|
|
|
if [ -z "${KUBECONFIG}" ]; then
|
|
KUBECONFIG=~/.kube/config
|
|
fi
|
|
|
|
kubectl --kubeconfig="$KUBECONFIG" create namespace monitoring
|
|
|
|
kctl() {
|
|
kubectl --kubeconfig="$KUBECONFIG" -n "monitoring" "$@"
|
|
}
|
|
|
|
kctl apply -f manifests/controllers/prometheus-controller.yaml
|
|
|
|
# Wait for TPRs to be ready.
|
|
until kctl get servicemonitor; do sleep 0.1; done
|
|
until kctl get prometheus; do sleep 0.1; done
|
|
|
|
kctl apply -f manifests/exporters
|
|
kctl apply -f manifests/grafana
|
|
kctl apply -f manifests/prometheus
|