Helm/Grafana: Difference between revisions

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

Revision as of 17:20, 1 July 2024

helm repo add grafana https://grafana.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 grafana
cat <<YML | helm install -n grafana grafana grafana/grafana -f -
ingress:
  enabled: true
  hosts:
  - grafana.k8s.local
YML

Uninstall

helm uninstall -n grafana grafana
helm delete    -n grafana grafana

Playground

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

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

kubectl logs -f grafana-6fd8886fd4-4vwgh -n grafana
kubectl rollout restart deploy grafana -n grafana
kubectl rollout restart sts grafana -n grafana
kubectl logs -f grafana-hash -n grafana
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 grafana grafana -o json|jq -r '.data."admin-password"'|base64 -d;echo
kubectl get secret -n grafana grafana -o json|jq -r '.data."admin-user"'|base64 -d;echo

References