Skip to content
Snippets Groups Projects
Verified Commit a96340dd authored by Vincent Sellier's avatar Vincent Sellier
Browse files

swh/webapp: Add webapp metrics scraping configuration

Limit the scraping to 1 pod as the metrics are the same for all pods

Related to swh/infra/sysadm-environment#5227
parent 6b72e826
No related branches found
No related tags found
3 merge requests!321Draft: swh/webapp: Add webapp metrics scraping configuration,!320v236: Release swh.vault v1.12.1,!319production/storage-rpc: Use tcp liveness probe
......@@ -20,6 +20,9 @@ kind: Ingress
metadata:
namespace: {{ $.Values.namespace }}
name: {{ $serviceType }}-ingress-{{ $endpoint_definition }}
labels:
app: {{ $serviceType }}
endpoint-definition: {{ $endpoint_definition }}
annotations:
{{- if or (not (hasKey $configuration.ingress "useEndpointsAsUpstream")) (eq $configuration.ingress.useEndpointsAsUpstream false) -}}
{{- /* undocumented swh's ingress option to configure the upstreams to use the service ip.
......
......@@ -8,6 +8,8 @@ kind: Service
metadata:
name: {{ .serviceType }}
namespace: {{ .Values.namespace }}
labels:
app: {{ .serviceType }}
spec:
type: ClusterIP
selector:
......
{{ if .Values.web.enabled -}}
{{ range $web_type, $web_config := .Values.web.deployments }}
{{- /* metricsScrapingEnabled defaults to true if not defined */ -}}
{{- if and (or (not (hasKey $web_config "enabled")) (get $web_config "enabled"))
(or (not (hasKey $web_config "metricsScrapingEnabled")) $web_config.metricsScrapingEnabled) -}}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: web-{{ $web_type }}-metrics
namespace: {{ $.Values.namespace }}
spec:
endpoints:
- path: /metrics/prometheus/
port: rpc
interval: 300s
scrapeTimeout: 60s
selector:
matchLabels:
app: web-{{ $web_type }}
namespaceSelector:
matchNames:
- {{ $.Values.namespace }}
{{- end -}}
{{ end -}}
{{- end -}}
......@@ -288,6 +288,7 @@ web:
logLevel: INFO
deployments:
cassandra:
metricsScrapingEnabled: false
requestedCpu: 500m
requestedMemory: 500Mi
autoScaling:
......
......@@ -1366,6 +1366,7 @@ web:
site_id: 59
# Test instance
app1:
metricsScrapingEnabled: false
requestedCpu: 500m
requestedMemory: 1024Mi
refreshSavecodenowStatus:
......
......@@ -262,6 +262,7 @@ postgresqlWebConfiguration:
web:
deployments:
cassandra:
metricsScrapingEnabled: false
replicas: 1
autoScaling:
minReplicaCount: 1
......
......@@ -785,6 +785,7 @@ web:
logLevel: INFO
deployments:
postgresql:
metricsScrapingEnabled: false
# small footprint because this webapp is almost not used, only for tests
replicas: 1
requestedCpu: 50m
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment