Created
August 22, 2024 18:37
-
-
Save todd-dsm/13965172439ffecc1998c05df3efd38a to your computer and use it in GitHub Desktop.
install kube-prometheus-stack on minikube via helm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###---------------------------------------------------------------------------- | |
### MAIN PROGRAM | |
###---------------------------------------------------------------------------- | |
### PREP | |
###--- | |
###--- | |
### The kube-prometheus stack includes a resource metrics API server, so the | |
### metrics-server addon is unnecessary. | |
###--- | |
pMsg "Disabling the metrics-server, it's unnecessary with Prometheus..." | |
minikube addons disable metrics-server | |
###--- | |
### Install | |
### * kube-prometheus-stack-operator | |
### * kube-state-metrics | |
### * prometheus-node-exporter | |
### REF: github|kube-prometheus-stack | https://bit.ly/4cx7Byw | |
###--- | |
pMsg "Deploying the kube-prometheus-stack..." | |
helm upgrade --install "$kpsRelName" prometheus-community/kube-prometheus-stack \ | |
--namespace "$kpsNameSpace" --create-namespace --timeout=120s | |
###--- | |
### Wait for it... | |
###--- | |
pMsg "Waiting for pods to go Ready..." | |
kubectl --namespace="$kpsNameSpace" wait --for condition=Ready pod \ | |
-l release="$kpsRelName" | |
kubectl --namespace="$kpsNameSpace" wait --for condition=Ready pod \ | |
-l app.kubernetes.io/instance=${kpsRelName}-kube-prometheus-stack-prometheus | |
###---------------------------------------------------------------------------- | |
### Expose the services | |
###---------------------------------------------------------------------------- | |
### Expose Grafana via LoadBalancer | |
###--- | |
kubectl -n monitoring expose deployment "${kpsRelName}-grafana" \ | |
--type=LoadBalancer --port=3000 --name grafana | |
###--- | |
### Expose Prometheus via LoadBalancer | |
###--- | |
kubectl -n monitoring expose service "${kpsRelName}-kube-prometheus-stack-prometheus" \ | |
--type=LoadBalancer --port=9090 --name prometheus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Learning Material
install and basic config