Helm/Prometheus: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 111: Line 111:
|-
|-
| valign="top" |
| valign="top" |
* [https://grafana.com/grafana/dashboards/315-kubernetes-cluster-monitoring-via-prometheus/ Grafana » Dashboards » K8s » Prometheus ]
* [https://spacelift.io/blog/prometheus-helm-chart Prometheus » Spacelift » Blog]
* [https://grafana.com/docs/grafana/latest/setup-grafana/installation/helm/ Grafana » Helm » Install]
* [https://grafana.com/grafana/dashboards/315-kubernetes-cluster-monitoring-via-prometheus/ Prometheus » K8s » Grafana]
* [https://grafana.com/docs/grafana/latest/setup-grafana/installation/kubernetes/ Grafana » K8s » Install]
* [https://prometheus.io/ Prometheus]
* [https://grafana.com/grafana/dashboards/ Grafana » Dashboards]
* [https://grafana.com/grafana/ Grafana]


| valign="top" |
| valign="top" |

Revision as of 22:42, 1 July 2024

helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo update
helm repo list

Config

export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"

Install

kubectl create namespace prometheus
helm show values prometheus/prometheus
cat <<YML | helm install -n prometheus prometheus prometheus/prometheus -f -
ingress:
  enabled: true
  hosts:
  - prometheus.k8s.local
YML

Uninstall

helm uninstall -n prometheus prometheus
helm delete    -n prometheus prometheus

Playground

helm upgrade --install -f values.yaml prometheus prometheus/prometheus
helm upgrade --install prometheus prometheus/prometheus
helm show values prometheus/prometheus
kubectl exec -n prometheus -it prometheus-6fd8886fd4-4vwgh -- cat /etc/os-release
kubectl exec -n prometheus -it prometheus-6fd8886fd4-4vwgh -- bash
kubectl exec -n prometheus -it prometheus-6fd8886fd4-4vwgh -- sh

kubectl delete all --all -n prometheus
kubectl delete ing --all -n prometheus
kubectl delete sts --all -n prometheus
kubectl delete svc --all -n prometheus
kubectl delete pvc --all -n prometheus
kubectl delete pv  --all -n prometheus

kubectl logs -f prometheus-6fd8886fd4-4vwgh -n prometheus
kubectl rollout restart deploy prometheus -n prometheus
kubectl rollout restart sts prometheus -n prometheus
kubectl logs -f prometheus-hash -n prometheus
kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten

kubectl get secret -n prometheus prometheus -o json|jq -r '.data."admin-password"'|base64 -d;echo
kubectl get secret -n prometheus prometheus -o json|jq -r '.data."admin-user"'|base64 -d;echo

References