Skip to content

Commit

Permalink
Fix servicemonitor relabeling
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Kubrinsky <akubrinsky@zetaglobal.com>
  • Loading branch information
akubrinsky-zetaglobal committed Jun 6, 2023
1 parent c5fad71 commit 0bd1bc1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

- name: Helm install
uses: Azure/setup-helm@v3

- name: Create k8s ${{ matrix.kubernetesVersion }} Kind Cluster
uses: helm/kind-action@main
with:
Expand All @@ -88,9 +88,9 @@ jobs:
image:
keda:
tag: main
metricsApiServer:
metricsApiServer:
tag: main
webhooks:
webhooks:
tag: main
podIdentity:
azureWorkload:
Expand All @@ -99,7 +99,7 @@ jobs:
clientId: ${{ matrix.clientId }}
podDisruptionBudget:
operator:
maxUnavailable: 1
maxUnavailable: 1
metricServer:
maxUnavailable: 1
webhooks:
Expand All @@ -109,10 +109,25 @@ jobs:
enabled: true
podMonitor:
enabled: true
serviceMonitor:
enabled: true
relabellings:
- regex: (go_.*)
action: drop
webhooks:
enabled: true
serviceMonitor:
enabled: true
relabellings:
- regex: (go_.*)
action: drop
metricServer:
enabled: true
serviceMonitor:
enabled: true
relabellings:
- regex: (go_.*)
action: drop
webhooks:
failurePolicy: Fail
certificates:
Expand Down
6 changes: 3 additions & 3 deletions keda/templates/manager/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ spec:
{{- end }}
{{- with .Values.prometheus.operator.serviceMonitor.targetLabels }}
targetLabels:
{{ toYaml . | indent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.prometheus.operator.serviceMonitor.podTargetLabels }}
podTargetLabels:
{{ toYaml . | indent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
endpoints:
- port: {{ .Values.prometheus.operator.serviceMonitor.port }}
Expand All @@ -40,7 +40,7 @@ spec:
{{- end }}
{{- with .Values.prometheus.operator.serviceMonitor.relabellings }}
relabelings:
{{ toYaml . | indent 6 }}
{{- toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
Expand Down
6 changes: 3 additions & 3 deletions keda/templates/metrics-server/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ spec:
{{- end }}
{{- with .Values.prometheus.metricServer.serviceMonitor.targetLabels }}
targetLabels:
{{ toYaml . | indent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.prometheus.metricServer.serviceMonitor.podTargetLabels }}
podTargetLabels:
{{ toYaml . | indent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
endpoints:
- port: {{ .Values.prometheus.metricServer.portName }}
Expand All @@ -40,7 +40,7 @@ spec:
{{- end }}
{{- with .Values.prometheus.metricServer.serviceMonitor.relabellings }}
relabelings:
{{ toYaml . | indent 6 }}
{{- toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
Expand Down
8 changes: 4 additions & 4 deletions keda/templates/webhooks/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ spec:
{{- end }}
{{- with .Values.prometheus.webhooks.serviceMonitor.targetLabels }}
targetLabels:
{{ toYaml . | indent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.prometheus.webhooks.serviceMonitor.podTargetLabels }}
podTargetLabels:
{{ toYaml . | indent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
endpoints:
- port: {{ .Values.prometheus.webhooks.serviceMonitor.port }}
Expand All @@ -41,7 +41,7 @@ spec:
{{- end }}
{{- with .Values.prometheus.webhooks.serviceMonitor.relabellings }}
relabelings:
{{ toYaml . | indent 6 }}
{{- toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
Expand All @@ -50,4 +50,4 @@ spec:
matchLabels:
app.kubernetes.io/name: {{ .Values.webhooks.name }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 0bd1bc1

Please sign in to comment.