NOTES.txt 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. The Prometheus server can be accessed via port {{ .Values.server.service.servicePort }} on the following DNS name from within your cluster:
  2. {{ template "prometheus.server.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
  3. {{ if .Values.server.ingress.enabled -}}
  4. From outside the cluster, the server URL(s) are:
  5. {{- range .Values.server.ingress.hosts }}
  6. http://{{ . }}
  7. {{- end }}
  8. {{- else }}
  9. Get the Prometheus server URL by running these commands in the same shell:
  10. {{- if contains "NodePort" .Values.server.service.type }}
  11. export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus.server.fullname" . }})
  12. export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  13. echo http://$NODE_IP:$NODE_PORT
  14. {{- else if contains "LoadBalancer" .Values.server.service.type }}
  15. NOTE: It may take a few minutes for the LoadBalancer IP to be available.
  16. You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prometheus.server.fullname" . }}'
  17. export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prometheus.server.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
  18. echo http://$SERVICE_IP:{{ .Values.server.service.servicePort }}
  19. {{- else if contains "ClusterIP" .Values.server.service.type }}
  20. export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "prometheus.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
  21. kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9090
  22. {{- end }}
  23. {{- if .Values.server.persistentVolume.enabled }}
  24. {{- else }}
  25. #################################################################################
  26. ###### WARNING: Persistence is disabled!!! You will lose your data when #####
  27. ###### the Server pod is terminated. #####
  28. #################################################################################
  29. {{- end }}
  30. {{- end }}
  31. {{ if .Values.alertmanager.enabled }}
  32. The Prometheus alertmanager can be accessed via port {{ .Values.alertmanager.service.port }} on the following DNS name from within your cluster:
  33. {{ template "prometheus.alertmanager.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
  34. {{ if .Values.alertmanager.ingress.enabled -}}
  35. From outside the cluster, the alertmanager URL(s) are:
  36. {{- range .Values.alertmanager.ingress.hosts }}
  37. http://{{ . }}
  38. {{- end }}
  39. {{- else }}
  40. Get the Alertmanager URL by running these commands in the same shell:
  41. {{- if contains "NodePort" .Values.alertmanager.service.type }}
  42. export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus.alertmanager.fullname" . }})
  43. export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  44. echo http://$NODE_IP:$NODE_PORT
  45. {{- else if contains "LoadBalancer" .Values.alertmanager.service.type }}
  46. NOTE: It may take a few minutes for the LoadBalancer IP to be available.
  47. You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prometheus.alertmanager.fullname" . }}'
  48. export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prometheus.alertmanager.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
  49. echo http://$SERVICE_IP:{{ .Values.alertmanager.service.servicePort }}
  50. {{- else if contains "ClusterIP" .Values.alertmanager.service.type }}
  51. export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "alertmanager.name" .Subcharts.alertmanager }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
  52. kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9093
  53. {{- end }}
  54. {{- end }}
  55. {{- if .Values.alertmanager.persistence.enabled }}
  56. {{- else }}
  57. #################################################################################
  58. ###### WARNING: Persistence is disabled!!! You will lose your data when #####
  59. ###### the AlertManager pod is terminated. #####
  60. #################################################################################
  61. {{- end }}
  62. {{- end }}
  63. {{- if (index .Values "prometheus-node-exporter" "enabled") }}
  64. #################################################################################
  65. ###### WARNING: Pod Security Policy has been disabled by default since #####
  66. ###### it deprecated after k8s 1.25+. use #####
  67. ###### (index .Values "prometheus-node-exporter" "rbac" #####
  68. ###### . "pspEnabled") with (index .Values #####
  69. ###### "prometheus-node-exporter" "rbac" "pspAnnotations") #####
  70. ###### in case you still need it. #####
  71. #################################################################################
  72. {{- end }}
  73. {{ if (index .Values "prometheus-pushgateway" "enabled") }}
  74. The Prometheus PushGateway can be accessed via port {{ index .Values "prometheus-pushgateway" "service" "port" }} on the following DNS name from within your cluster:
  75. {{ include "prometheus-pushgateway.fullname" (index .Subcharts "prometheus-pushgateway") }}.{{ .Release.Namespace }}.svc.cluster.local
  76. {{ if (index .Values "prometheus-pushgateway" "ingress" "enabled") -}}
  77. From outside the cluster, the pushgateway URL(s) are:
  78. {{- range (index .Values "prometheus-pushgateway" "ingress" "hosts") }}
  79. http://{{ . }}
  80. {{- end }}
  81. {{- else }}
  82. Get the PushGateway URL by running these commands in the same shell:
  83. {{- $pushgateway_svc_type := index .Values "prometheus-pushgateway" "service" "type" -}}
  84. {{- if contains "NodePort" $pushgateway_svc_type }}
  85. export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "prometheus-pushgateway.fullname" (index .Subcharts "prometheus-pushgateway") }})
  86. export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  87. echo http://$NODE_IP:$NODE_PORT
  88. {{- else if contains "LoadBalancer" $pushgateway_svc_type }}
  89. NOTE: It may take a few minutes for the LoadBalancer IP to be available.
  90. You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "prometheus-pushgateway.fullname" (index .Subcharts "prometheus-pushgateway") }}'
  91. export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "prometheus-pushgateway.fullname" (index .Subcharts "prometheus-pushgateway") }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
  92. echo http://$SERVICE_IP:{{ index .Values "prometheus-pushgateway" "service" "port" }}
  93. {{- else if contains "ClusterIP" $pushgateway_svc_type }}
  94. export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "prometheus.name" (index .Subcharts "prometheus-pushgateway") }},component=pushgateway" -o jsonpath="{.items[0].metadata.name}")
  95. kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9091
  96. {{- end }}
  97. {{- end }}
  98. {{- end }}
  99. For more information on running Prometheus, visit:
  100. https://prometheus.io/