Skip to content

Commit

Permalink
Merge pull request #456 from inisitijitty/fix/broken-ingress
Browse files Browse the repository at this point in the history
fix(signalilo): ingress support
  • Loading branch information
simu authored Feb 9, 2023
2 parents 07c1a37 + 1cf4848 commit 98c9e98
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
2 changes: 1 addition & 1 deletion appuio/signalilo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions appuio/signalilo/README.gotmpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `[]`
Expand Down
3 changes: 2 additions & 1 deletion appuio/signalilo/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 | `[]`
Expand Down
31 changes: 28 additions & 3 deletions appuio/signalilo/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{{- 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 }}
{{- 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: {{ include "signalilo.fullname" }}
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "signalilo.name" . }}
helm.sh/chart: {{ include "signalilo.chart" . }}
Expand All @@ -13,17 +25,30 @@ 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: /
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "signalilo.fullname" }}
name: {{ $fullName }}
port:
number: 80
{{- else }}
serviceName: {{ $fullName }}
servicePort: 80
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
Expand Down
14 changes: 8 additions & 6 deletions appuio/signalilo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ 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
# -- ingress annotations
className: ""
annotations: {}
# cert-manager.io/cluster-issuer: letsencrypt-prod
# -- ingress hostnames
hosts: ["signalilo.local"]
# -- ingress TLS configuration
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: signalilo.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: signalilo-tls
# hosts:
Expand Down

0 comments on commit 98c9e98

Please sign in to comment.