Helm/Grafana: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 39: Line 39:
| valign="top" |
| valign="top" |
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
kubectl exec -n grafana -it grafana-6fd8886fd4-4vwgh -- cat /etc/os-release
kubectl -n grafana exec -it grafana-6fd8886fd4-4vwgh -- cat /etc/os-release
kubectl exec -n grafana -it grafana-6fd8886fd4-4vwgh -- bash
kubectl -n grafana exec -it grafana-6fd8886fd4-4vwgh -- bash
kubectl exec -n grafana -it grafana-6fd8886fd4-4vwgh -- sh
kubectl -n grafana exec -it grafana-6fd8886fd4-4vwgh -- sh
</syntaxhighlight>
</syntaxhighlight>


Line 50: Line 50:
| valign="top" |
| valign="top" |
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
kubectl delete all --all -n grafana
kubectl -n grafana logs -f grafana-6fd8886fd4-4vwgh
kubectl delete ing --all -n grafana
kubectl -n grafana rollout restart deploy grafana
kubectl delete sts --all -n grafana
kubectl -n grafana rollout restart sts grafana
kubectl -n grafana logs -f grafana-hash
</syntaxhighlight>
</syntaxhighlight>


| valign="top" |
| valign="top" |
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
kubectl delete svc --all -n grafana
kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl delete pvc --all -n grafana
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl delete pv  --all -n grafana
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten
</syntaxhighlight>
</syntaxhighlight>


Line 66: Line 68:
----
----
|-
|-
| valign="top" |
| valign="top" colspan="2" |
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
kubectl logs -f grafana-6fd8886fd4-4vwgh -n grafana
kubectl -n grafana get secret grafana -o json|jq -r '.data."admin-password"'|base64 -d;echo
kubectl rollout restart deploy grafana -n grafana
kubectl -n grafana get secret grafana -o json|jq -r '.data."admin-user"'|base64 -d;echo
kubectl rollout restart sts grafana -n grafana
kubectl -n grafana get cm    grafana -o yaml
kubectl logs -f grafana-hash -n grafana
</syntaxhighlight>
</syntaxhighlight>


|-
| colspan="2" |
----
|-
| valign="top" |
| valign="top" |
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl -n grafana delete all --all
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl -n grafana delete ing --all
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl -n grafana delete sts --all
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten
</syntaxhighlight>
</syntaxhighlight>


|-
| valign="top" |
| colspan="2" |
<syntaxhighlight lang="bash">
----
kubectl -n grafana delete svc --all
|-
kubectl -n grafana delete pvc --all
| valign="top" colspan="2" |
kubectl -n grafana delete pv  --all
<syntaxhighlight lang="yaml">
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
</syntaxhighlight>
</syntaxhighlight>



Revision as of 02:30, 2 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

helm show values grafana/grafana
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 -n grafana exec -it grafana-6fd8886fd4-4vwgh -- cat /etc/os-release
kubectl -n grafana exec -it grafana-6fd8886fd4-4vwgh -- bash
kubectl -n grafana exec -it grafana-6fd8886fd4-4vwgh -- sh

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

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

References