Skip to content

Commit

Permalink
Merge pull request #192 from ethersphere/geth-swap-traefik
Browse files Browse the repository at this point in the history
chore: add support for traefik ingress for geth-swap
  • Loading branch information
vandot authored Oct 18, 2022
2 parents f7144a3 + 8ab4eb6 commit ac00a04
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/geth-swap/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.3.7
version: 0.3.8

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
26 changes: 26 additions & 0 deletions charts/geth-swap/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "geth-swap.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if eq .Values.ingress.class "traefik" -}}
{{- $namespace := .Release.Namespace -}}
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: {{ $fullName }}
namespace: {{ $namespace }}
spec:
routes:
{{- range .Values.ingress.hosts }}
{{- $ingressHost := $fullName -}}
{{- if .domain }}
{{- $ingressHost = printf "%s.%s" $fullName .domain -}}
{{- end }}
{{- range .paths }}
- kind: Rule
match: Host({{ $ingressHost | quote }}) && PathPrefix({{ . | quote }})
services:
- kind: Service
name: {{ $fullName }}
namespace: {{ $namespace }}
port: {{ $svcPort }}
{{- end }}
{{- end }}
{{- else -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
Expand Down Expand Up @@ -43,3 +68,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit ac00a04

Please sign in to comment.