Skip to content

Commit 2dab3e4

Browse files
authored
fix(alerts): match prometheus root issuer (#658)
* fix(alerts): match prometheus root issuer Signed-off-by: Richard Tief <richard.tief@sap.com> * chore(alerts): align test on new certificate name Signed-off-by: Richard Tief <richard.tief@sap.com> * chore(alerts): more effective naming for cert-manager resources Signed-off-by: Richard Tief <richard.tief@sap.com> * chore(alerts): apply renaming Signed-off-by: Richard Tief <richard.tief@sap.com> --------- Signed-off-by: Richard Tief <richard.tief@sap.com>
1 parent bad8fad commit 2dab3e4

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

alerts/charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ maintainers:
88
name: alerts
99
sources:
1010
- https://github.com/cloudoperators/greenhouse-extensions
11-
version: 0.19.6
11+
version: 0.19.7
1212
keywords:
1313
- prometheus-alertmanager
1414
dependencies:

alerts/charts/templates/certmanager.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
apiVersion: cert-manager.io/v1
66
kind: Issuer
77
metadata:
8-
name: {{ .Release.Namespace }}-prometheus-issuer
8+
name: '{{ .Release.Namespace }}-alerts-issuer'
99
labels:
1010
{{- include "kube-prometheus-stack.labels" . | indent 4 }}
1111
spec:
@@ -15,44 +15,44 @@ spec:
1515
apiVersion: cert-manager.io/v1
1616
kind: Certificate
1717
metadata:
18-
name: {{ .Release.Namespace }}-prometheus-root-cert
18+
name: '{{ .Release.Namespace }}-alerts-root-cert'
1919
labels:
2020
{{- include "kube-prometheus-stack.labels" . | indent 4 }}
2121
spec:
22-
secretName: {{ .Release.Namespace }}-prometheus-root-cert
22+
secretName: tls-alerts-{{ .Release.Namespace }}-root
2323
duration: {{ .Values.alerts.certManager.rootCert.duration | default "43800h0m0s" | quote }}
2424
issuerRef:
25-
name: {{ .Release.Namespace }}-prometheus-issuer
25+
name: {{ .Release.Namespace }}-alerts-issuer
2626
commonName: "ca.prometheus.greenhouse"
2727
isCA: true
2828
---
2929
# Create an Issuer that uses the above generated CA certificate to issue certs
3030
apiVersion: cert-manager.io/v1
3131
kind: Issuer
3232
metadata:
33-
name: {{ .Release.Namespace }}-prometheus-root-issuer
33+
name: '{{ .Release.Namespace }}-alerts-root-issuer'
3434
labels:
3535
{{- include "kube-prometheus-stack.labels" . | indent 4 }}
3636
spec:
3737
ca:
38-
secretName: {{ .Release.Namespace }}-prometheus-root-cert
38+
secretName: tls-alerts-{{ .Release.Namespace }}-root-ca
3939
{{- end }}
4040
---
4141
# generate a server certificate for the alertmanager to use
4242
apiVersion: cert-manager.io/v1
4343
kind: Certificate
4444
metadata:
45-
name: {{ include "kube-prometheus-stack.fullname" . }}-cert
45+
name: alertmanager-{{ .Release.Namespace }}-cert
4646
labels:
4747
{{- include "kube-prometheus-stack.labels" . | indent 4 }}
4848
spec:
49-
secretName: tls-{{ include "kube-prometheus-stack.fullname" . }}-cert
49+
secretName: tls-alertmanager-{{ .Release.Namespace }}
5050
duration: {{ .Values.alerts.certManager.admissionCert.duration | default "8760h0m0s" | quote }}
5151
issuerRef:
5252
{{- if .Values.alerts.certManager.issuerRef }}
5353
{{- toYaml .Values.alerts.certManager.issuerRef | nindent 4 }}
5454
{{- else }}
55-
name: {{ .Release.Namespace }}-root-issuer
55+
name: {{ .Release.Namespace }}-alerts-root-issuer
5656
{{- end }}
5757
dnsNames:
5858
- {{ include "kube-prometheus-stack.fullname" . }}
@@ -76,7 +76,7 @@ spec:
7676
{{- if .Values.alerts.certManager.issuerRef }}
7777
{{- toYaml .Values.alerts.certManager.issuerRef | nindent 4 }}
7878
{{- else }}
79-
name: {{ .Release.Namespace }}-root-issuer
79+
name: {{ .Release.Namespace }}-alerts-root-issuer
8080
{{- end }}
8181
dnsNames:
8282
{{- if .Values.global.greenhouse.baseDomain }}

alerts/charts/templates/tests/test-alerts-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ data:
4848
4949
{{- if and .Values.alerts.alertmanager.ingress.enabled .Values.alerts.alertmanager.ingress.hosts .Values.alerts.certManager.enabled }}
5050
@test "Generated server certificate for the Prometheus Alertmanager to use" {
51-
verify "there is 1 issuer named '{{ .Release.Namespace }}-prometheus-issuer'"
52-
verify "there is 1 issuer named '{{ .Release.Namespace }}-prometheus-root-issuer'"
53-
verify "there is 1 certificate named '{{ .Release.Namespace }}-prometheus-root-cert'"
54-
verify "there is 1 certificate named '{{ include "kube-prometheus-stack.fullname" . }}-cert'"
51+
verify "there is 1 issuer named '{{ .Release.Namespace }}-alerts-issuer'"
52+
verify "there is 1 issuer named '{{ .Release.Namespace }}-alerts-root-issuer"
53+
verify "there is 1 certificate named '{{ .Release.Namespace }}-alerts-root-cert'"
54+
verify "there is 1 certificate named 'alertmanager-{{ .Release.Namespace }}-cert'"
5555
verify "there is 1 certificate named 'prometheus-{{ .Release.Namespace }}-cert'"
56-
verify "there is 1 secret named '{{ .Release.Namespace }}-prometheus-root-cert'"
57-
verify "there is 1 secret named 'tls-prometheus-{{ .Release.Namespace }}'"
56+
verify "there is 1 secret named 'tls-alertmanager-{{ .Release.Namespace }}'"
57+
verify "there is 1 secret named 'tls-prometheus-{{ .Release.Namespace }}"
5858
5959
url="https://{{ first .Values.alerts.alertmanager.ingress.hosts }}/-/healthy"
6060
run curl --cert /tls-assets/tls.crt --key /tls-assets/tls.key ${url}

alerts/plugindefinition.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ kind: PluginDefinition
66
metadata:
77
name: alerts
88
spec:
9-
version: 2.7.6
9+
version: 2.7.7
1010
weight: 0
1111
displayName: Alerts
1212
description: The Alerts Plugin consists of both Prometheus Alertmanager and Supernova, the holistic alert management UI
@@ -15,7 +15,7 @@ spec:
1515
helmChart:
1616
name: alerts
1717
repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts
18-
version: 0.19.6
18+
version: 0.19.7
1919
uiApplication:
2020
name: supernova
2121
version: "latest"

0 commit comments

Comments
 (0)