NOTES.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. 1. Get your '{{ .Values.adminUser }}' user password by running:
  2. kubectl get secret --namespace {{ template "grafana.namespace" . }} {{ template "grafana.fullname" . }} -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
  3. 2. The Grafana server can be accessed via port {{ .Values.service.port }} on the following DNS name from within your cluster:
  4. {{ template "grafana.fullname" . }}.{{ template "grafana.namespace" . }}.svc.cluster.local
  5. {{ if .Values.ingress.enabled }}
  6. If you bind grafana to 80, please update values in values.yaml and reinstall:
  7. ```
  8. securityContext:
  9. runAsUser: 0
  10. runAsGroup: 0
  11. fsGroup: 0
  12. command:
  13. - "setcap"
  14. - "'cap_net_bind_service=+ep'"
  15. - "/usr/sbin/grafana-server &&"
  16. - "sh"
  17. - "/run.sh"
  18. ```
  19. Details refer to https://grafana.com/docs/installation/configuration/#http-port.
  20. Or grafana would always crash.
  21. From outside the cluster, the server URL(s) are:
  22. {{- range .Values.ingress.hosts }}
  23. http://{{ . }}
  24. {{- end }}
  25. {{ else }}
  26. Get the Grafana URL to visit by running these commands in the same shell:
  27. {{ if contains "NodePort" .Values.service.type -}}
  28. export NODE_PORT=$(kubectl get --namespace {{ template "grafana.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "grafana.fullname" . }})
  29. export NODE_IP=$(kubectl get nodes --namespace {{ template "grafana.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
  30. echo http://$NODE_IP:$NODE_PORT
  31. {{ else if contains "LoadBalancer" .Values.service.type -}}
  32. NOTE: It may take a few minutes for the LoadBalancer IP to be available.
  33. You can watch the status of by running 'kubectl get svc --namespace {{ template "grafana.namespace" . }} -w {{ template "grafana.fullname" . }}'
  34. export SERVICE_IP=$(kubectl get svc --namespace {{ template "grafana.namespace" . }} {{ template "grafana.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
  35. http://$SERVICE_IP:{{ .Values.service.port -}}
  36. {{ else if contains "ClusterIP" .Values.service.type }}
  37. export POD_NAME=$(kubectl get pods --namespace {{ template "grafana.namespace" . }} -l "app.kubernetes.io/name={{ template "grafana.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
  38. kubectl --namespace {{ template "grafana.namespace" . }} port-forward $POD_NAME 3000
  39. {{- end }}
  40. {{- end }}
  41. 3. Login with the password from step 1 and the username: {{ .Values.adminUser }}
  42. {{- if not .Values.persistence.enabled }}
  43. #################################################################################
  44. ###### WARNING: Persistence is disabled!!! You will lose your data when #####
  45. ###### the Grafana pod is terminated. #####
  46. #################################################################################
  47. {{- end }}