From a70b14966d01a46511a5499dbf8c188fbd6e2703 Mon Sep 17 00:00:00 2001 From: Kevin Cottier Date: Wed, 8 Feb 2023 21:51:39 +0100 Subject: [PATCH 1/8] fix(signalilo): incorrect scope for include in ingress template --- appuio/signalilo/templates/ingress.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appuio/signalilo/templates/ingress.yaml b/appuio/signalilo/templates/ingress.yaml index 8052a3dd..df2cedab 100644 --- a/appuio/signalilo/templates/ingress.yaml +++ b/appuio/signalilo/templates/ingress.yaml @@ -1,8 +1,9 @@ {{- if .Values.ingress.enabled -}} +{{- $fullName := include "signalilo.fullname" . -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "signalilo.fullname" }} + name: {{ $fullName }} labels: app.kubernetes.io/name: {{ include "signalilo.name" . }} helm.sh/chart: {{ include "signalilo.chart" . }} @@ -21,7 +22,7 @@ spec: - path: / backend: service: - name: {{ include "signalilo.fullname" }} + name: {{ $fullName }} port: number: 80 {{- end }} From 6d649b15c5cc1bd10ca1cd196fbc3538f5b81612 Mon Sep 17 00:00:00 2001 From: Kevin Cottier Date: Wed, 8 Feb 2023 22:01:27 +0100 Subject: [PATCH 2/8] feat(signalilo): add support for ingress class (k8s >=1.18) --- appuio/signalilo/templates/ingress.yaml | 12 +++++++++++- appuio/signalilo/values.yaml | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/appuio/signalilo/templates/ingress.yaml b/appuio/signalilo/templates/ingress.yaml index df2cedab..2d94789d 100644 --- a/appuio/signalilo/templates/ingress.yaml +++ b/appuio/signalilo/templates/ingress.yaml @@ -1,5 +1,10 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "signalilo.fullname" . -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -14,12 +19,17 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} rules: {{- range .Values.ingress.hosts }} - host: {{ .host | quote }} http: paths: - - path: / + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} backend: service: name: {{ $fullName }} diff --git a/appuio/signalilo/values.yaml b/appuio/signalilo/values.yaml index ea4f611b..2e6240d4 100644 --- a/appuio/signalilo/values.yaml +++ b/appuio/signalilo/values.yaml @@ -72,7 +72,7 @@ resources: ingress: # -- enable ingress enabled: false - # -- ingress annotations + className: "" annotations: {} # cert-manager.io/cluster-issuer: letsencrypt-prod # -- ingress hostnames From f9a9f8c10baad52949e8745af6d90d9f620e8fdd Mon Sep 17 00:00:00 2001 From: Kevin Cottier Date: Wed, 8 Feb 2023 22:01:39 +0100 Subject: [PATCH 3/8] feat(signalilo): support previous apiVersion for ingress resource --- appuio/signalilo/templates/ingress.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appuio/signalilo/templates/ingress.yaml b/appuio/signalilo/templates/ingress.yaml index 2d94789d..d8ee29b9 100644 --- a/appuio/signalilo/templates/ingress.yaml +++ b/appuio/signalilo/templates/ingress.yaml @@ -5,7 +5,13 @@ {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} {{- end }} {{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} kind: Ingress metadata: name: {{ $fullName }} From 3ba7f62cc45dbea04129550685662d932ba02284 Mon Sep 17 00:00:00 2001 From: Kevin Cottier Date: Wed, 8 Feb 2023 22:02:00 +0100 Subject: [PATCH 4/8] feat(signalilo): support previous backend syntax for ingress resource --- appuio/signalilo/templates/ingress.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appuio/signalilo/templates/ingress.yaml b/appuio/signalilo/templates/ingress.yaml index d8ee29b9..3fe31769 100644 --- a/appuio/signalilo/templates/ingress.yaml +++ b/appuio/signalilo/templates/ingress.yaml @@ -37,10 +37,16 @@ spec: pathType: {{ .pathType }} {{- end }} backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: name: {{ $fullName }} port: number: 80 + {{- else }} + serviceName: {{ $fullName }} + servicePort: 80 + {{- end }} + {{- end }} {{- end }} {{- if .Values.ingress.tls }} tls: From fbf351ed5c75a119d9d5cd346287b7f2edf87115 Mon Sep 17 00:00:00 2001 From: Kevin Cottier Date: Wed, 8 Feb 2023 22:03:06 +0100 Subject: [PATCH 5/8] feat(signalilo): add structure in ingress.hosts value --- appuio/signalilo/templates/ingress.yaml | 2 ++ appuio/signalilo/values.yaml | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/appuio/signalilo/templates/ingress.yaml b/appuio/signalilo/templates/ingress.yaml index 3fe31769..cb0b153c 100644 --- a/appuio/signalilo/templates/ingress.yaml +++ b/appuio/signalilo/templates/ingress.yaml @@ -33,6 +33,8 @@ spec: - host: {{ .host | quote }} http: paths: + {{- range .paths }} + - path: {{ .path }} {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} pathType: {{ .pathType }} {{- end }} diff --git a/appuio/signalilo/values.yaml b/appuio/signalilo/values.yaml index 2e6240d4..4f275a56 100644 --- a/appuio/signalilo/values.yaml +++ b/appuio/signalilo/values.yaml @@ -74,10 +74,11 @@ ingress: enabled: false className: "" annotations: {} - # cert-manager.io/cluster-issuer: letsencrypt-prod - # -- ingress hostnames - hosts: ["signalilo.local"] - # -- ingress TLS configuration + hosts: + - host: signalilo.local + paths: + - path: / + pathType: ImplementationSpecific tls: [] # - secretName: signalilo-tls # hosts: From 58f50b3f79ce64807b76135a5f151ffb142728ae Mon Sep 17 00:00:00 2001 From: Kevin Cottier Date: Wed, 8 Feb 2023 22:04:08 +0100 Subject: [PATCH 6/8] style(signalilo): change example annotations for ingress --- appuio/signalilo/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appuio/signalilo/values.yaml b/appuio/signalilo/values.yaml index 4f275a56..5f45036e 100644 --- a/appuio/signalilo/values.yaml +++ b/appuio/signalilo/values.yaml @@ -70,10 +70,11 @@ resources: # It is recommended to only use Signalilo inside the same cluster/network as the alertmanager instance sending the alerts. # Running Signalilo on a different network as the connected alertmanager is untested. ingress: - # -- enable ingress enabled: false className: "" annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" hosts: - host: signalilo.local paths: From f2cf1e51c526d8958aa3248d0831dd30b87c72fb Mon Sep 17 00:00:00 2001 From: Kevin Cottier Date: Wed, 8 Feb 2023 22:04:42 +0100 Subject: [PATCH 7/8] feat(signalilo): bump version to 0.10.1 --- README.md | 2 +- appuio/signalilo/Chart.yaml | 2 +- appuio/signalilo/README.md | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c338a917..759c2769 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ helm repo add appuio https://charts.appuio.ch | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/prometheus-blackbox-exporter-0.3.1/total)](https://github.com/appuio/charts/releases/tag/prometheus-blackbox-exporter-0.3.1) | [prometheus-blackbox-exporter](appuio/prometheus-blackbox-exporter/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/redis-1.3.5/total)](https://github.com/appuio/charts/releases/tag/redis-1.3.5) | [redis](appuio/redis/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/secret-1.1.0/total)](https://github.com/appuio/charts/releases/tag/secret-1.1.0) | [secret](appuio/secret/README.md) | -| [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/signalilo-0.10.0/total)](https://github.com/appuio/charts/releases/tag/signalilo-0.10.0) | [signalilo](appuio/signalilo/README.md) | +| [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/signalilo-0.10.1/total)](https://github.com/appuio/charts/releases/tag/signalilo-0.10.1) | [signalilo](appuio/signalilo/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/snappass-0.2.15/total)](https://github.com/appuio/charts/releases/tag/snappass-0.2.15) | [snappass](appuio/snappass/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/stardog-0.15.0/total)](https://github.com/appuio/charts/releases/tag/stardog-0.15.0) | [stardog](appuio/stardog/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/stardog-userrole-operator-0.1.1/total)](https://github.com/appuio/charts/releases/tag/stardog-userrole-operator-0.1.1) | [stardog-userrole-operator](appuio/stardog-userrole-operator/README.md) | diff --git a/appuio/signalilo/Chart.yaml b/appuio/signalilo/Chart.yaml index 22975d90..39d2757e 100644 --- a/appuio/signalilo/Chart.yaml +++ b/appuio/signalilo/Chart.yaml @@ -7,7 +7,7 @@ keywords: - alertmanager - webhook - icinga2 -version: 0.10.0 +version: 0.10.1 appVersion: v0.12.0 sources: - https://git.vshn.net/vshn/signalilo diff --git a/appuio/signalilo/README.md b/appuio/signalilo/README.md index 47276675..9c33f661 100644 --- a/appuio/signalilo/README.md +++ b/appuio/signalilo/README.md @@ -1,6 +1,6 @@ # signalilo -![Version: 0.10.0](https://img.shields.io/badge/Version-0.10.0-informational?style=flat-square) ![AppVersion: v0.12.0](https://img.shields.io/badge/AppVersion-v0.12.0-informational?style=flat-square) +![Version: 0.10.1](https://img.shields.io/badge/Version-0.10.1-informational?style=flat-square) ![AppVersion: v0.12.0](https://img.shields.io/badge/AppVersion-v0.12.0-informational?style=flat-square) Alertmanager to Icinga2 bridge @@ -54,6 +54,7 @@ Parameter | Description | Default `securityContext.fsGroup` | fs group to use for the pod | `999` `resources` | Pod resource requests and limits | `{}` `ingress.enabled` | Enable ingress | `false` +`ingress.className` | Ingress className | `""` `ingress.annotations` | Ingress annotations | `{}` `ingress.hosts` | Ingress hostnames | `["signalilo.local"]` `ingress.tls` | Ingress TLS configuration | `[]` From 1cf484889fe5823f398a97cb785717522ec08d36 Mon Sep 17 00:00:00 2001 From: Kevin Cottier Date: Wed, 8 Feb 2023 22:07:02 +0100 Subject: [PATCH 8/8] docs(signalilo): add ingress.className in go template. run --- Generating Chart READMEs --- appuio/signalilo/README.gotmpl.md | 1 + 1 file changed, 1 insertion(+) diff --git a/appuio/signalilo/README.gotmpl.md b/appuio/signalilo/README.gotmpl.md index 12bcfa7f..812f8e0e 100644 --- a/appuio/signalilo/README.gotmpl.md +++ b/appuio/signalilo/README.gotmpl.md @@ -40,6 +40,7 @@ Parameter | Description | Default `securityContext.fsGroup` | fs group to use for the pod | `999` `resources` | Pod resource requests and limits | `{}` `ingress.enabled` | Enable ingress | `false` +`ingress.className` | Ingress className | `""` `ingress.annotations` | Ingress annotations | `{}` `ingress.hosts` | Ingress hostnames | `["signalilo.local"]` `ingress.tls` | Ingress TLS configuration | `[]`