Skip to content

Instantly share code, notes, and snippets.

@lukaszbudnik
Created June 18, 2020 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszbudnik/1ca75fff7e779f67c32e9ef8e617b187 to your computer and use it in GitHub Desktop.
Save lukaszbudnik/1ca75fff7e779f67c32e9ef8e617b187 to your computer and use it in GitHub Desktop.
Shows how to setup Prometheus on minikube
# minikube version
minikube version
minikube version: v1.11.0
commit: 57e2f55f47effe9ce396cea42a1e0eb4f611ebbd
# Kubernetes version
kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-21T14:51:23Z", GoVersion:"go1.14.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-20T12:43:34Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
# helm version
helm version
version.BuildInfo{Version:"v3.1.2", GitCommit:"d878d4d45863e42fd5cff6743294a11d28a9abce", GitTreeState:"clean", GoVersion:"go1.13.8"}
# start minikube
minikube start
# install prometheus
helm install prometheus stable/prometheus
POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace default port-forward $POD_NAME 9090
# install grafana
helm install grafana stable/grafana
POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/instance=grafana,app.kubernetes.io/name=grafana" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace default port-forward $POD_NAME 3000
# get admin password
kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
# open Grafana
# in the browser add new source and use http://prometheus-server
# import dashboard from graphana.com: 1621
open localhost:3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment