Skip to content

Conversation

@emmanuelmathot
Copy link
Contributor

@emmanuelmathot emmanuelmathot commented May 28, 2025

Overview

This PR adds support for configurable routing paths in the eoAPI stack, allowing operators to customize the base paths for each service (e.g., serving STAC under /api instead of /stac). This is particularly useful for integrations where specific path prefixes are required.

Changes

  • Added path configuration support in values.yaml for each service
  • Updated ingress template to use configurable paths
  • Added unit tests for path configuration
  • Enhanced STAC API tests to verify correct link generation with custom paths

Example Usage

# values.yaml
stac:
  ingress:
    path: "/api"  # Instead of default /stac
raster:
  ingress:
    path: "/titiler"  # Instead of default /raster

Testing

  • Added Helm unit tests to verify ingress configuration
  • Added integration tests to verify STAC API generates correct links when using custom paths
  • Tested with both nginx and traefik ingress controllers
  • Verified backward compatibility with default paths

Notes

  • Path handling is managed at the ingress level through forwarded headers
  • No changes required to application containers
  • Default paths (/stac, /raster, /vector, /multidim) are maintained if not explicitly configured

Closes #230

@emmanuelmathot emmanuelmathot changed the title Adding support for configurable API paths in EOAPI stack Adding support for configurable API paths May 28, 2025
@emmanuelmathot emmanuelmathot requested review from pantierra and sunu May 28, 2025 12:51
@ividito
Copy link
Contributor

ividito commented May 28, 2025

I think we also need to update the container start commands with the correct root path if these values are set (ex. https://github.com/developmentseed/eoapi-k8s/blob/services-prefixes/helm-chart/eoapi/templates/services/raster/deployment.yaml#L43). Running locally, I was able to change the ingress paths, but the STAC api was still pointing me back to /stac

@j08lue
Copy link
Member

j08lue commented Jun 3, 2025

@emmanuelmathot - just to coordinate - is this on you to take further?

…le values for raster, stac, vector, and multidim services
@emmanuelmathot
Copy link
Contributor Author

The issue was that multiple files throughout the Helm chart had hardcoded path values that didn't respect the configurable ingress path settings:

I updated all six files to use the configurable ingress path values from the Helm values:

1. Service Deployment Files

helm-chart/eoapi/templates/services/stac/deployment.yaml:

  • Changed --root-path=/stac to --root-path={{ .Values.stac.ingress.path }}

helm-chart/eoapi/templates/services/raster/deployment.yaml:

  • Changed --root-path=/raster to --root-path={{ .Values.raster.ingress.path }}

helm-chart/eoapi/templates/services/vector/deployment.yaml:

  • Changed --root-path=/vector to --root-path={{ .Values.vector.ingress.path }}

helm-chart/eoapi/templates/services/multidim/deployment.yaml:

  • Changed --root-path=/multidim to --root-path={{ .Values.multidim.ingress.path }}

2. Traefik Middleware Configuration

helm-chart/eoapi/templates/services/traefik-middleware.yaml:

  • Changed hardcoded prefixes:
    • /raster{{ .Values.raster.ingress.path }}
    • /stac{{ .Values.stac.ingress.path }}
    • /vector{{ .Values.vector.ingress.path }}
    • /multidim{{ .Values.multidim.ingress.path }}

3. STAC Browser Configuration

helm-chart/eoapi/templates/services/browser/deployment.yaml:

  • Changed SB_catalogUrl environment variable from /stac to {{ .Values.stac.ingress.path }}

@ividito Could you please make another test on your side?

@emmanuelmathot emmanuelmathot requested a review from ividito June 13, 2025 08:28
Copy link
Contributor

@ividito ividito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good on a local cluster, thanks @emmanuelmathot !

Copy link
Contributor

@pantierra pantierra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thumbs up from my side as well.

Copy link
Member

@sunu sunu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me as well!

@emmanuelmathot emmanuelmathot merged commit 327b911 into main Jun 16, 2025
2 checks passed
@emmanuelmathot emmanuelmathot deleted the services-prefixes branch June 16, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configurable base path for STAC and other EOAPI components

6 participants