developmentseed / developmentseed/eoapi-k8s
Deploying using nginx ingress results in 404 for /browser
- Dominant language
- Python
- Stars
- 31
- Forks
- 17
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 24
Description
## Background
- Follow on from https://github.com/developmentseed/eoapi-k8s/pull/544 which fixes this for traefik. Related issue #545.
- For `templates/networking/ingress.yaml` we don't have the same `skipStripPrefix` param.
- Using nginx ingress, any browser path that isn't `/` gets the regex form and rewrite-target: `/$2`, meaning the prefix is always stripped, and we get a 404. I verified `browser.ingress.path=/browser` results in the same.
- It's possible to work around this by deploying a standalone Ingress for the browser, alongside the eoAPI chart.
## Goals
- Allow viewing /browser with nginx ingress and the default eoAPI chart.
## Possible solution
Mirror the Traefik behaviour, where the browser is excluded from strip-prefix and gets its own redirect middleware.
Two changes in `templates/networking/ingress.yaml`:
1. Honour `skipStripPrefix` in the nginx path helper as the Traefik template already does, so the browser renders as `pathType: Prefix`, `path: /browser`.
2. Render that path in a separate `{{ .Release.Name }}-browser-ingress` without `rewrite-target` / `use-regex`. Those are Ingress-scoped, so in the shared resource `/browser` is still rewritten to `/` (empty `$2`) even without the regex.
I would understand if this won't be accepted, as nginx ingress is deprecated. We should probably be targeting the Gateway API for future changes instead.
I'm happy to PR for this otherwise 👍
Contributor guide
Research direction
Start with templates/networking/ingress.yaml and compare the nginx path helper with the existing Traefik handling of skipStripPrefix. Render the Helm chart with nginx ingress and browser.ingress.path=/browser, then verify that /browser is emitted as a separate ingress without rewrite-target or use-regex and that the browser path no longer returns 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm, kubernetes, nginx
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100