Skip to content

Instantly share code, notes, and snippets.

@dredfett
Last active March 31, 2019 20:29
Show Gist options
  • Save dredfett/4d94a31cf8b466a5da32bc328052efe1 to your computer and use it in GitHub Desktop.
Save dredfett/4d94a31cf8b466a5da32bc328052efe1 to your computer and use it in GitHub Desktop.
Setup for Minikube using the prometheus-operator helm charts.
#!/bin/bash
minikube start --bootstrapper kubeadm --vm-driver kvm2 --memory 8192 --cpus 4 --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=Webhook --extra-config=scheduler.address=0.0.0.0 --extra-config=controller-manager.address=0.0.0.0
# Create service account for Tiller
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
# Init helm and insteall prometheus-operator
helm init --service-account tiller
helm install --name monitoring --namespace monitoring stable/prometheus-operator --values=values_minikube.yaml
# Start proxy and port forward grafana so it is reachable from http://localhost:3000
kubectl proxy
kubectl port-forward $(kubectl get pods --selector=app=grafana -n monitoring --output=jsonpath="{.items..metadata.name}") -n monitoring 3000
# If the helm chart for prometheus-operator has already been setup, upgrade it with the new values:
#helm upgrade monitoring stable/prometheus-operator --values=values_minikube.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment