Skip to content

Commit 9538047

Browse files
committed
Moved to traefik for default ingress.
1 parent d0bbe96 commit 9538047

File tree

14 files changed

+139
-73
lines changed

14 files changed

+139
-73
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Added support for annotations on the PgSTAC bootstrap job via `pgstacBootstrap.jobAnnotations` in values.yaml [#381](https://github.com/developmentseed/eoapi-k8s/pull/381)
1313

14+
### Changed
15+
16+
- Moved to traefik for the default ingress solution [#384](https://github.com/developmentseed/eoapi-k8s/pull/384)
17+
1418
### Fixed
1519

1620
- Fixed Helm template to check queryables `file` field with schema validation [#380](https://github.com/developmentseed/eoapi-k8s/pull/380)

charts/eoapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ apiServices:
9898
# Configure ingress
9999
ingress:
100100
enabled: true
101-
className: "nginx" # or "traefik"
101+
className: "traefik" # Default, or "nginx" for legacy setups
102102
host: "your-domain.com" # Optional
103103

104104
# Database options

charts/eoapi/profiles/core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ observability:
167167
######################
168168
ingress:
169169
enabled: true
170-
className: "nginx"
170+
className: "traefik" # Traefik with nginx provider support
171171
pathType: "Prefix"
172172
host: ""
173173
tls:

charts/eoapi/profiles/experimental.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ autoscaling:
358358
######################
359359
ingress:
360360
enabled: true
361-
className: "nginx"
361+
className: "traefik" # Traefik with nginx provider support
362362
pathType: "Prefix"
363363
host: "localhost"
364364
tls:

charts/eoapi/profiles/production.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ knative:
343343
######################
344344
ingress:
345345
enabled: true
346-
className: "nginx"
346+
className: "traefik" # Traefik with nginx provider support
347347
pathType: "Prefix"
348348
host: "eoapi.example.com" # CHANGE THIS to your domain
349349
tls:

charts/eoapi/templates/networking/ingress-browser.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ metadata:
1717
{{ toYaml .Values.ingress.annotations | indent 4 }}
1818
{{- end }}
1919
{{- if eq .Values.ingress.className "nginx" }}
20+
# NGINX ingress annotations
2021
nginx.ingress.kubernetes.io/rewrite-target: /browser/$2
2122
nginx.ingress.kubernetes.io/use-regex: "true"
22-
{{- end }}
23-
# Temporary annotations for Traefik until uvicorn support real prefix in ASGI: https://github.com/encode/uvicorn/discussions/2490
24-
{{- if eq .Values.ingress.className "traefik" }}
23+
{{- else if eq .Values.ingress.className "traefik" }}
24+
# Traefik native annotations
2525
traefik.ingress.kubernetes.io/router.entrypoints: web
2626
traefik.ingress.kubernetes.io/router.middlewares: {{ $.Release.Namespace }}-{{ $.Release.Name }}-strip-prefix-middleware@kubernetescrd
2727
{{- end }}

charts/eoapi/templates/networking/ingress.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ metadata:
1313
app: {{ .Release.Name }}-ingress
1414
annotations:
1515
{{- if eq .Values.ingress.className "nginx" }}
16+
# NGINX ingress annotations
1617
nginx.ingress.kubernetes.io/rewrite-target: /$2
1718
nginx.ingress.kubernetes.io/use-regex: "true"
19+
{{- else if eq .Values.ingress.className "traefik" }}
20+
# Traefik native annotations (standard Traefik, not NGINX provider)
21+
traefik.ingress.kubernetes.io/router.entrypoints: web
22+
traefik.ingress.kubernetes.io/router.middlewares: {{ $.Release.Namespace }}-{{ $.Release.Name }}-strip-prefix-middleware@kubernetescrd
1823
{{- end }}
1924
{{- if .Values.ingress.annotations }}
2025
{{ toYaml .Values.ingress.annotations | indent 4 }}
2126
{{- end }}
22-
# Temporary annotations for Traefik until uvicorn support real prefix in ASGI: https://github.com/encode/uvicorn/discussions/2490
23-
{{- if eq .Values.ingress.className "traefik" }}
24-
traefik.ingress.kubernetes.io/router.entrypoints: web
25-
traefik.ingress.kubernetes.io/router.middlewares: {{ $.Release.Namespace }}-{{ $.Release.Name }}-strip-prefix-middleware@kubernetescrd
26-
{{- end }}
2727
spec:
2828
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
2929
ingressClassName: {{ .Values.ingress.className }}
@@ -45,8 +45,8 @@ spec:
4545
{{- end }}
4646

4747
{{- if and $.Values.stac.enabled (or (not (hasKey $.Values.stac "ingress")) $.Values.stac.ingress.enabled) }}
48-
- pathType: {{ if eq $.Values.ingress.className "nginx" }}ImplementationSpecific{{ else }}Prefix{{ end }}
49-
path: {{ $.Values.stac.ingress.path }}{{ if eq $.Values.ingress.className "nginx" }}(/|$)(.*){{ end }}
48+
- pathType: {{ if or (eq $.Values.ingress.className "nginx") (eq $.Values.ingress.className "traefik") }}ImplementationSpecific{{ else }}Prefix{{ end }}
49+
path: {{ $.Values.stac.ingress.path }}{{ if or (eq $.Values.ingress.className "nginx") (eq $.Values.ingress.className "traefik") }}(/|$)(.*){{ end }}
5050
backend:
5151
service:
5252
{{- if index $.Values "stac-auth-proxy" "enabled" }}
@@ -59,8 +59,8 @@ spec:
5959
{{- end }}
6060

6161
{{- if and $.Values.vector.enabled (or (not (hasKey $.Values.vector "ingress")) $.Values.vector.ingress.enabled) }}
62-
- pathType: {{ if eq $.Values.ingress.className "nginx" }}ImplementationSpecific{{ else }}Prefix{{ end }}
63-
path: {{ $.Values.vector.ingress.path }}{{ if eq $.Values.ingress.className "nginx" }}(/|$)(.*){{ end }}
62+
- pathType: {{ if or (eq $.Values.ingress.className "nginx") (eq $.Values.ingress.className "traefik") }}ImplementationSpecific{{ else }}Prefix{{ end }}
63+
path: {{ $.Values.vector.ingress.path }}{{ if or (eq $.Values.ingress.className "nginx") (eq $.Values.ingress.className "traefik") }}(/|$)(.*){{ end }}
6464
backend:
6565
service:
6666
name: {{ $.Release.Name }}-vector
@@ -69,8 +69,8 @@ spec:
6969
{{- end }}
7070

7171
{{- if and $.Values.multidim.enabled (or (not (hasKey $.Values.multidim "ingress")) $.Values.multidim.ingress.enabled) }}
72-
- pathType: {{ if eq $.Values.ingress.className "nginx" }}ImplementationSpecific{{ else }}Prefix{{ end }}
73-
path: {{ $.Values.multidim.ingress.path }}{{ if eq $.Values.ingress.className "nginx" }}(/|$)(.*){{ end }}
72+
- pathType: {{ if or (eq $.Values.ingress.className "nginx") (eq $.Values.ingress.className "traefik") }}ImplementationSpecific{{ else }}Prefix{{ end }}
73+
path: {{ $.Values.multidim.ingress.path }}{{ if or (eq $.Values.ingress.className "nginx") (eq $.Values.ingress.className "traefik") }}(/|$)(.*){{ end }}
7474
backend:
7575
service:
7676
name: {{ $.Release.Name }}-multidim
@@ -79,8 +79,8 @@ spec:
7979
{{- end }}
8080

8181
{{- if and $.Values.mockOidcServer.enabled $.Values.mockOidcServer.ingress.enabled }}
82-
- pathType: {{ if eq $.Values.ingress.className "nginx" }}ImplementationSpecific{{ else }}Prefix{{ end }}
83-
path: {{ $.Values.mockOidcServer.ingress.path }}{{ if eq $.Values.ingress.className "nginx" }}(/|$)(.*){{ end }}
82+
- pathType: {{ if or (eq $.Values.ingress.className "nginx") (eq $.Values.ingress.className "traefik") }}ImplementationSpecific{{ else }}Prefix{{ end }}
83+
path: {{ $.Values.mockOidcServer.ingress.path }}{{ if or (eq $.Values.ingress.className "nginx") (eq $.Values.ingress.className "traefik") }}(/|$)(.*){{ end }}
8484
backend:
8585
service:
8686
name: {{ $.Release.Name }}-mock-oidc-server
@@ -115,8 +115,8 @@ spec:
115115
{{- end }}
116116

117117
{{- if and .Values.stac.enabled (or (not (hasKey .Values.stac "ingress")) .Values.stac.ingress.enabled) }}
118-
- pathType: {{ if eq .Values.ingress.className "nginx" }}ImplementationSpecific{{ else }}Prefix{{ end }}
119-
path: {{ .Values.stac.ingress.path }}{{ if eq .Values.ingress.className "nginx" }}(/|$)(.*){{ end }}
118+
- pathType: {{ if or (eq .Values.ingress.className "nginx") (eq .Values.ingress.className "traefik") }}ImplementationSpecific{{ else }}Prefix{{ end }}
119+
path: {{ .Values.stac.ingress.path }}{{ if or (eq .Values.ingress.className "nginx") (eq .Values.ingress.className "traefik") }}(/|$)(.*){{ end }}
120120
backend:
121121
service:
122122
{{- if index .Values "stac-auth-proxy" "enabled" }}
@@ -129,8 +129,8 @@ spec:
129129
{{- end }}
130130

131131
{{- if and .Values.vector.enabled (or (not (hasKey .Values.vector "ingress")) .Values.vector.ingress.enabled) }}
132-
- pathType: {{ if eq .Values.ingress.className "nginx" }}ImplementationSpecific{{ else }}Prefix{{ end }}
133-
path: {{ .Values.vector.ingress.path }}{{ if eq .Values.ingress.className "nginx" }}(/|$)(.*){{ end }}
132+
- pathType: {{ if or (eq .Values.ingress.className "nginx") (eq .Values.ingress.className "traefik") }}ImplementationSpecific{{ else }}Prefix{{ end }}
133+
path: {{ .Values.vector.ingress.path }}{{ if or (eq .Values.ingress.className "nginx") (eq .Values.ingress.className "traefik") }}(/|$)(.*){{ end }}
134134
backend:
135135
service:
136136
name: {{ .Release.Name }}-vector
@@ -139,8 +139,8 @@ spec:
139139
{{- end }}
140140

141141
{{- if and .Values.multidim.enabled (or (not (hasKey .Values.multidim "ingress")) .Values.multidim.ingress.enabled) }}
142-
- pathType: {{ if eq .Values.ingress.className "nginx" }}ImplementationSpecific{{ else }}Prefix{{ end }}
143-
path: {{ .Values.multidim.ingress.path }}{{ if eq .Values.ingress.className "nginx" }}(/|$)(.*){{ end }}
142+
- pathType: {{ if or (eq .Values.ingress.className "nginx") (eq .Values.ingress.className "traefik") }}ImplementationSpecific{{ else }}Prefix{{ end }}
143+
path: {{ .Values.multidim.ingress.path }}{{ if or (eq .Values.ingress.className "nginx") (eq .Values.ingress.className "traefik") }}(/|$)(.*){{ end }}
144144
backend:
145145
service:
146146
name: {{ .Release.Name }}-multidim
@@ -149,8 +149,8 @@ spec:
149149
{{- end }}
150150

151151
{{- if and .Values.mockOidcServer.enabled .Values.mockOidcServer.ingress.enabled }}
152-
- pathType: {{ if eq .Values.ingress.className "nginx" }}ImplementationSpecific{{ else }}Prefix{{ end }}
153-
path: {{ .Values.mockOidcServer.ingress.path }}{{ if eq .Values.ingress.className "nginx" }}(/|$)(.*){{ end }}
152+
- pathType: {{ if or (eq .Values.ingress.className "nginx") (eq .Values.ingress.className "traefik") }}ImplementationSpecific{{ else }}Prefix{{ end }}
153+
path: {{ .Values.mockOidcServer.ingress.path }}{{ if or (eq .Values.ingress.className "nginx") (eq .Values.ingress.className "traefik") }}(/|$)(.*){{ end }}
154154
backend:
155155
service:
156156
name: {{ .Release.Name }}-mock-oidc-server

charts/eoapi/tests/ingress_tests.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ tests:
3333
path: spec.ingressClassName
3434
value: "nginx"
3535

36-
- it: "stac ingress with traefik controller"
36+
- it: "stac ingress with traefik controller (using nginx provider)"
3737
set:
3838
ingress.className: "traefik"
39-
ingress.pathType: "Prefix"
4039
ingress.host: "eoapi.local"
4140
raster.enabled: false
4241
stac.enabled: true
@@ -48,15 +47,15 @@ tests:
4847
of: Ingress
4948
- equal:
5049
path: spec.rules[0].http.paths[0].path
51-
value: "/stac"
50+
value: "/stac(/|$)(.*)"
5251
- equal:
5352
path: spec.rules[0].http.paths[0].pathType
54-
value: "Prefix"
53+
value: "ImplementationSpecific"
5554
- equal:
5655
path: metadata.annotations
5756
value:
58-
traefik.ingress.kubernetes.io/router.entrypoints: web
59-
traefik.ingress.kubernetes.io/router.middlewares: NAMESPACE-RELEASE-NAME-strip-prefix-middleware@kubernetescrd
57+
nginx.ingress.kubernetes.io/rewrite-target: /$2
58+
nginx.ingress.kubernetes.io/use-regex: "true"
6059
- equal:
6160
path: spec.ingressClassName
6261
value: "traefik"

charts/eoapi/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ service:
3232

3333
ingress:
3434
# Unified ingress configuration for both nginx and traefik
35+
# Traefik 3.5+ supports nginx annotations via the nginx provider
3536
enabled: true
3637
# ingressClassName: "nginx" or "traefik"
37-
className: "nginx"
38+
className: "traefik"
3839
rootPath: "" # Root path for doc server
3940
# Single host domain configuration (default)
4041
host: ""

docs/argocd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ spec:
136136
# Ingress setup
137137
ingress:
138138
enabled: true
139-
className: "nginx"
139+
className: "traefik" # Default, or "nginx" for legacy setups
140140
host: "eoapi.example.com"
141141
142142
destination:

0 commit comments

Comments
 (0)