Skip to content

Commit

Permalink
config: add templating for enabling wc to sc probes
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-elastisys committed Oct 10, 2023
1 parent de2875d commit 13ba431
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions config/config/wc-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ global:
## Used in logs and metrics as to separate these from other clusters.
clusterName: ${CK8S_ENVIRONMENT_NAME}-wc

## If baseDomain for wc and sc are not the same, set the domain of the sc cluster.
scDomain: ""
scOpsDomain: ""

## User configuration.
user:
## This only controls if the namespaces should be created, user RBAC is always created.
Expand Down Expand Up @@ -238,6 +242,7 @@ prometheusBlackboxExporter:
targets:
gatekeeper: true
falco: true
sc: true

# Network policies for workload cluster
networkPolicies:
Expand Down
14 changes: 9 additions & 5 deletions helmfile/values/prometheus-blackbox-exporter-wc.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,36 @@ serviceMonitor:
module: http_2xx
{{- end }}

{{- if .Values.prometheusBlackboxExporter.targets.sc}}
{{- $scDomain := default .Values.global.baseDomain .Values.global.scDomain }}
{{- $scOpsDomain := default .Values.global.opsDomain .Values.global.scOpsDomain }}
- name: sc-dex
url: https://{{ .Values.dex.subdomain }}.{{ .Values.global.baseDomain }}/healthz
url: https://{{ .Values.dex.subdomain }}.{{ $scDomain }}/healthz
interval: 60s
scrapeTimeout: 30s
module: http_2xx
{{- if .Values.harbor.enabled }}
- name: sc-harbor
url: https://{{ .Values.harbor.subdomain }}.{{ .Values.global.baseDomain }}/api/v2.0/ping
url: https://{{ .Values.harbor.subdomain }}.{{ $scDomain }}/api/v2.0/ping
interval: 60s
scrapeTimeout: 30s
module: http_2xx
{{- end }}
- name: sc-user-grafana
url: https://{{ .Values.grafana.user.subdomain }}.{{ .Values.global.baseDomain }}/api/health
url: https://{{ .Values.grafana.user.subdomain }}.{{ $scDomain }}/api/health
interval: 60s
scrapeTimeout: 30s
module: http_2xx
- name: sc-opensearch-ops
url: https://{{ .Values.opensearch.subdomain }}.{{ .Values.global.opsDomain }}
url: https://{{ .Values.opensearch.subdomain }}.{{ $scOpsDomain }}
interval: 60s
scrapeTimeout: 30s
module: http_401
{{- if and .Values.thanos.enabled .Values.thanos.receiver.enabled }}
- name: sc-thanos-recv-ops
url: https://{{ .Values.thanos.receiver.subdomain }}.{{ .Values.global.opsDomain }}
url: https://{{ .Values.thanos.receiver.subdomain }}.{{ $scOpsDomain }}
interval: 60s
scrapeTimeout: 30s
module: http_401
{{- end }}
{{- end }}

0 comments on commit 13ba431

Please sign in to comment.