Helm/Prometheus: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with " helm repo add prometheus https://prometheus-community.github.io/helm-charts helm repo update helm repo list ==Config== <syntaxhighlight lang="properties"> export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml" export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml" export KUBECONFIG="${HOME}/.kube/config" </syntaxhighlight> ==Install== <syntaxhighlight lang="yaml"> kubectl create namespace prometheus helm show values prometheus/prometheus cat <<YML | helm install -n pr...")
 
Line 98: Line 98:
| valign="top" |
| valign="top" |
* [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>]
* [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>]
* [https://github.com/grafana/helm-charts/tree/main/charts/grafana Helm » Grafana » GitHub]
* [https://github.com/prometheus-community/helm-charts Helm » Prometheus » GitHub]
* [https://artifacthub.io/packages/helm/grafana/grafana Helm » Grafana]
* [https://artifacthub.io/packages/helm/prometheus-community/prometheus Helm » Prometheus]
* [[Helm]]
* [[Helm]]



Revision as of 22:38, 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