Skip to content

Instantly share code, notes, and snippets.

@dredfett
Created March 31, 2019 21:14
Show Gist options
  • Save dredfett/2e3d344597bf31e8dee3daa6cfd9a5c6 to your computer and use it in GitHub Desktop.
Save dredfett/2e3d344597bf31e8dee3daa6cfd9a5c6 to your computer and use it in GitHub Desktop.
Setup CoreOS Kube-Prometheus
#!/bin/bash
# Clone the git repo
#git clone git@github.com:coreos/prometheus-operator.git prometheus
# cd into prometheus/contrib/kube-prometheus
kubectl create -f manifests/
until kubectl get customresourcedefinitions servicemonitors.monitoring.coreos.com ; do date; sleep 1; echo ""; done
until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
kubectl apply -f manifests/ # This command sometimes may need to be done twice (to workaround a race condition).
# Port forwards
#kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090
#kubectl --namespace monitoring port-forward svc/grafana 3000
#kubectl --namespace monitoring port-forward svc/alertmanager-main 9093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment