Prometheus: Add configurable readiness/liveness Probes
This change adds probes to the prometheus statefulset using the HTK probe generation functions Change-Id: I249d662dd0d23dd964f7118af94c733bbdc5db92
This commit is contained in:
parent
f7ed96c701
commit
f4bdb713c1
@ -15,7 +15,7 @@ apiVersion: v1
|
|||||||
appVersion: v2.12.0
|
appVersion: v2.12.0
|
||||||
description: OpenStack-Helm Prometheus
|
description: OpenStack-Helm Prometheus
|
||||||
name: prometheus
|
name: prometheus
|
||||||
version: 0.1.1
|
version: 0.1.2
|
||||||
home: https://prometheus.io/
|
home: https://prometheus.io/
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/prometheus/prometheus
|
- https://github.com/prometheus/prometheus
|
||||||
|
@ -12,6 +12,20 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- define "probeTemplate" }}
|
||||||
|
{{- $probePort := tuple "monitoring" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
|
{{- $probeUser := .Values.endpoints.monitoring.auth.admin.username }}
|
||||||
|
{{- $probePass := .Values.endpoints.monitoring.auth.admin.password }}
|
||||||
|
{{- $authHeader := printf "%s:%s" $probeUser $probePass | b64enc }}
|
||||||
|
httpGet:
|
||||||
|
path: /status
|
||||||
|
port: {{ $probePort }}
|
||||||
|
httpHeaders:
|
||||||
|
- name: Authorization
|
||||||
|
value: Basic {{ $authHeader }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
{{- if .Values.manifests.statefulset_prometheus }}
|
{{- if .Values.manifests.statefulset_prometheus }}
|
||||||
{{- $envAll := . }}
|
{{- $envAll := . }}
|
||||||
|
|
||||||
@ -171,12 +185,8 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- name: prom-metrics
|
- name: prom-metrics
|
||||||
containerPort: {{ tuple "monitoring" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
containerPort: {{ tuple "monitoring" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
readinessProbe:
|
{{ dict "envAll" . "component" "prometheus" "container" "prometheus" "type" "readiness" "probeTemplate" (include "probeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
|
||||||
httpGet:
|
{{ dict "envAll" . "component" "prometheus" "container" "prometheus" "type" "liveness" "probeTemplate" (include "probeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
|
||||||
path: /status
|
|
||||||
port: {{ tuple "monitoring" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
timeoutSeconds: 30
|
|
||||||
env:
|
env:
|
||||||
{{- if .Values.pod.env.prometheus }}
|
{{- if .Values.pod.env.prometheus }}
|
||||||
{{ include "helm-toolkit.utils.to_k8s_env_vars" .Values.pod.env.prometheus | indent 12 }}
|
{{ include "helm-toolkit.utils.to_k8s_env_vars" .Values.pod.env.prometheus | indent 12 }}
|
||||||
|
@ -110,7 +110,19 @@ pod:
|
|||||||
limits:
|
limits:
|
||||||
memory: "1024Mi"
|
memory: "1024Mi"
|
||||||
cpu: "2000m"
|
cpu: "2000m"
|
||||||
|
probes:
|
||||||
|
prometheus:
|
||||||
|
prometheus:
|
||||||
|
readiness:
|
||||||
|
enabled: true
|
||||||
|
params:
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 30
|
||||||
|
liveness:
|
||||||
|
enabled: false
|
||||||
|
params:
|
||||||
|
initialDelaySeconds: 120
|
||||||
|
timeoutSeconds: 30
|
||||||
endpoints:
|
endpoints:
|
||||||
cluster_domain_suffix: cluster.local
|
cluster_domain_suffix: cluster.local
|
||||||
local_image_registry:
|
local_image_registry:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user