File tree Expand file tree Collapse file tree
src/app_charts/prometheus Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# prometheus deployment. How could we let them override prometheus-cloud.values.yaml?
66# NOTE: The order here is important. The domain and project might be part of other values and
77# need to be replaced last.
8- {{ .Files.Get "files/prometheus-operator-chart.cloud.yaml" | replace "${CR_GF_SERVER_DOMAIN}" .Values.gf_server_domain | replace "${CR_GF_SERVER_ROOT_URL}" .Values.gf_server_root_url | replace "${CR_GF_CSRF_TRUSTED_ORIGINS}" .Values.gf_csrf_trusted_origins | replace "${CR_GF_SMTP_ENABLED}" .Values.gf_smtp_enabled | replace "${CR_GF_SMTP_HOST}" .Values.gf_smtp_host | replace "${CR_GF_SMTP_USER}" .Values.gf_smtp_user | replace "${CR_GF_SMTP_PASSWORD}" .Values.gf_smtp_password | replace "${CR_GF_SMTP_FROM_ADDRESS}" .Values.gf_smtp_from_address | replace "${CR_GF_SMTP_FROM_NAME}" .Values.gf_smtp_from_name | replace "${CR_GF_SMTP_SKIP_VERIFY}" .Values.gf_smtp_skip_verify | replace "${CR_GF_INGRESS_AUTH_URL}" .Values.gf_ingress_auth_url | replace "${CR_GF_INGRESS_AUTH_SIGNIN}" .Values.gf_ingress_auth_signin | replace "${CR_GF_INGRESS_ERROR_PAGE_403}" .Values.gf_ingress_error_page_403 | replace "${CR_PROM_INGRESS_AUTH_URL}" .Values.prom_ingress_auth_url | replace "${CR_PROM_INGRESS_AUTH_SIGNIN}" .Values.prom_ingress_auth_signin | replace "${CR_PROM_INGRESS_ERROR_PAGE_403}" .Values.prom_ingress_error_page_403 | replace "HELM-NAMESPACE" .Release.Namespace | replace "${LIMITS_MEMORY}" .Values.limits.memory | replace "${LIMITS_CPU}" .Values.limits.cpu | replace "${REQUESTS_STORAGE}" .Values.requests.storage | replace "${RETENTION_TIME}" .Values.retention.time | replace "${RETENTION_SIZE}" .Values.retention.size | replace "${EXTERNAL_URL}" .Values.prom_external_url | replace "${CLOUD_ROBOTICS_DOMAIN}" .Values.domain | replace "${GCP_PROJECT_ID}" .Values.project }}
8+ {{- $data := .Files.Get "files/prometheus-operator-chart.cloud.yaml" -}}
9+ # Pre-process variables
10+ {{- $data = $data | replace "${CR_GF_SERVER_DOMAIN}" .Values.gf_server_domain | replace "${CR_GF_SERVER_ROOT_URL}" .Values.gf_server_root_url | replace "${CR_GF_CSRF_TRUSTED_ORIGINS}" .Values.gf_csrf_trusted_origins | replace "${CR_GF_SMTP_ENABLED}" .Values.gf_smtp_enabled | replace "${CR_GF_SMTP_HOST}" .Values.gf_smtp_host | replace "${CR_GF_SMTP_USER}" .Values.gf_smtp_user | replace "${CR_GF_SMTP_PASSWORD}" .Values.gf_smtp_password | replace "${CR_GF_SMTP_FROM_ADDRESS}" .Values.gf_smtp_from_address | replace "${CR_GF_SMTP_FROM_NAME}" .Values.gf_smtp_from_name | replace "${CR_GF_SMTP_SKIP_VERIFY}" .Values.gf_smtp_skip_verify | replace "${CR_GF_INGRESS_AUTH_URL}" .Values.gf_ingress_auth_url | replace "${CR_GF_INGRESS_AUTH_SIGNIN}" .Values.gf_ingress_auth_signin | replace "${CR_GF_INGRESS_ERROR_PAGE_403}" .Values.gf_ingress_error_page_403 | replace "${CR_PROM_INGRESS_AUTH_URL}" .Values.prom_ingress_auth_url | replace "${CR_PROM_INGRESS_AUTH_SIGNIN}" .Values.prom_ingress_auth_signin | replace "${CR_PROM_INGRESS_ERROR_PAGE_403}" .Values.prom_ingress_error_page_403 | replace "HELM-NAMESPACE" .Release.Namespace | replace "${LIMITS_MEMORY}" .Values.limits.memory | replace "${LIMITS_CPU}" .Values.limits.cpu | replace "${REQUESTS_STORAGE}" .Values.requests.storage | replace "${RETENTION_TIME}" .Values.retention.time | replace "${RETENTION_SIZE}" .Values.retention.size | replace "${EXTERNAL_URL}" .Values.prom_external_url | replace "${CLOUD_ROBOTICS_DOMAIN}" .Values.domain | replace "${GCP_PROJECT_ID}" .Values.project -}}
11+
12+ # Inject the nodeSelector as a pre-formatted YAML block to allow users to define multiple selectors in a dict within values-cloud.yaml while maintaining valid indentation in the output.
13+ {{- $prometheusNodeSelectorMap := .Values.prometheus.prometheusSpec.nodeSelector -}}
14+ {{- if $prometheusNodeSelectorMap }}
15+ {{- $prometheusNodeSelectorRawYaml := toYaml $prometheusNodeSelectorMap -}}
16+ {{- $formattedPrometheusNodeSelectorObject := $prometheusNodeSelectorRawYaml | nindent 6 -}}
17+ {{- $data = $data | replace "${CR_PROMETHEUS_NODE_SELECTOR_OBJECT}" $formattedPrometheusNodeSelectorObject -}}
18+ {{- else }}
19+ {{- $data = $data | replace "${CR_PROMETHEUS_NODE_SELECTOR_OBJECT}" " {}" -}}
20+ {{- end }}
21+
22+ # Inject the tolerations as a pre-formatted YAML block to support multiple key-value pairs in a list within values-cloud.yaml
23+ {{- $prometheusTolerationsList := .Values.prometheus.prometheusSpec.tolerations -}}
24+ {{- if $prometheusTolerationsList }}
25+ {{- $prometheusTolerationsRawYaml := toYaml $prometheusTolerationsList -}}
26+ {{- $formattedTolerationsObject := $prometheusTolerationsRawYaml | nindent 6 -}}
27+ {{- $data = $data | replace "${CR_PROMETHEUS_TOLERATIONS_OBJECT}" $formattedTolerationsObject -}}
28+ {{- else }}
29+ {{- $data = $data | replace "${CR_PROMETHEUS_TOLERATIONS_OBJECT}" " []" -}}
30+ {{- end }}
31+
32+ {{ $data }}
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ prometheus:
6363 retention : " ${RETENTION_TIME}"
6464 retentionSize : " ${RETENTION_SIZE}"
6565 walCompression : true
66+ nodeSelector : " ${CR_PROMETHEUS_NODE_SELECTOR_OBJECT}"
67+ tolerations : " ${CR_PROMETHEUS_TOLERATIONS_OBJECT}"
6668 resources :
6769 requests :
6870 cpu : " ${LIMITS_CPU}"
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ retention:
3333
3434# MetricRelabelConfigs to apply to samples after scraping, but before ingestion.
3535prometheus :
36+ prometheusSpec :
37+ nodeSelector : {}
38+ tolerations : []
3639 serviceMonitor :
3740 metricRelabelings : []
3841
You can’t perform that action at this time.
0 commit comments