-
Notifications
You must be signed in to change notification settings - Fork 12
Unified Ingress Implementation - Fixes #205 #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8e52252
Refactor PostgreSQL configuration and remove deprecated database setup
emmanuelmathot 637dc91
Add PostgreSQL host reader and writer environment variables, and incl…
emmanuelmathot 9b6b092
Merge remote-tracking branch 'origin/main' into unified_pg
emmanuelmathot 5f45f50
Merge branch 'main' into unified_pg
emmanuelmathot ee41f4b
Added a clarifying comment in values.yaml to explain that values in t…
emmanuelmathot e6e0fed
Refactor: Implement unified ingress configuration for nginx and traef…
emmanuelmathot b091f48
Remove deprecated ingress backup template from helm chart
emmanuelmathot d6abec2
Enhance ingress configuration in test values for Traefik with path tr…
emmanuelmathot d4b5309
Add Traefik middleware for path rewriting and update ingress annotations
emmanuelmathot 6ff372d
Refactor: Update Traefik ingress annotations to use middleware for pa…
emmanuelmathot 149490d
Remove Traefik ingress annotations for entrypoints and middlewares in…
emmanuelmathot b303394
Add init container for pgstac migration and loading samples in deploy…
emmanuelmathot 0486843
Add command to retrieve and describe Traefik middleware in CI workflow
emmanuelmathot 9e4cb32
Refactor ingress configuration for Traefik and NGINX; add host for TL…
emmanuelmathot 127eb8c
Add Traefik middleware annotation for ingress tests
emmanuelmathot 193334e
Add Traefik entrypoint annotation to ingress configuration
emmanuelmathot c88a9ab
Add temporary annotation for Traefik to support ASGI prefix handling
emmanuelmathot 6784c9c
Merge branch 'main' into unified_ingress
emmanuelmathot 93cfb90
Remove testing condition from doc-server ConfigMap template
emmanuelmathot e7c3037
Update Traefik service IP address to use local endpoint in helm-tests…
emmanuelmathot bca644b
Merge branch 'main' into unified_ingress
emmanuelmathot 91c5fe9
Remove hardcoded service account name from deployment template
emmanuelmathot bc9e46c
Add comments to clarify proxy settings and ingress pathType requirements
emmanuelmathot c183b43
Clarify versioning details in unified ingress documentation
emmanuelmathot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # Unified Ingress Configuration | ||
|
|
||
| This document describes the unified ingress approach implemented in the eoAPI Helm chart. | ||
|
|
||
| ## Overview | ||
|
|
||
| eoAPI now uses a consolidated, controller-agnostic ingress configuration. This approach: | ||
|
|
||
| - Eliminates code duplication between different ingress controller implementations | ||
| - Provides consistent behavior across controllers | ||
| - Simplifies testing and maintainability | ||
| - Removes artificial restrictions on using certain ingress controllers in specific environments | ||
| - Makes it easier to add support for additional ingress controllers in the future | ||
|
|
||
| ## Configuration | ||
|
|
||
| The ingress configuration has been streamlined and generalized in the `values.yaml` file: | ||
|
|
||
| ```yaml | ||
| ingress: | ||
| # Unified ingress configuration for both nginx and traefik | ||
| enabled: true | ||
| # ingressClassName: "nginx" or "traefik" | ||
| className: "nginx" | ||
| # Path configuration | ||
| pathType: "Prefix" # Can be "Prefix" or "ImplementationSpecific" based on controller | ||
| pathSuffix: "" # Add a suffix to service paths (e.g. "(/|$)(.*)" for nginx regex) | ||
| rootPath: "" # Root path for doc server | ||
| # Host configuration | ||
| host: "" | ||
| # Custom annotations to add to the ingress | ||
| annotations: {} | ||
| # TLS configuration | ||
| tls: | ||
| enabled: false | ||
| secretName: eoapi-tls | ||
| certManager: false | ||
| certManagerIssuer: letsencrypt-prod | ||
| certManagerEmail: "" | ||
| ``` | ||
| ## Controller-Specific Configurations | ||
| ### NGINX Ingress Controller | ||
| For NGINX, use the following configuration: | ||
| ```yaml | ||
| ingress: | ||
| enabled: true | ||
| className: "nginx" | ||
| pathType: "Prefix" | ||
| annotations: | ||
| nginx.ingress.kubernetes.io/use-regex: "true" | ||
| nginx.ingress.kubernetes.io/enable-cors: "true" | ||
| nginx.ingress.kubernetes.io/enable-access-log: "true" | ||
| ``` | ||
| ### Traefik Ingress Controller | ||
| When using Traefik, the system automatically includes the Traefik middleware to strip prefixes (e.g., `/stac`, `/raster`) from requests before forwarding them to services. This is handled by the `traefik-middleware.yaml` template. | ||
|
|
||
| For basic Traefik configuration: | ||
|
|
||
| ```yaml | ||
| ingress: | ||
| enabled: true | ||
| className: "traefik" | ||
| pathType: "Prefix" | ||
| # When using TLS, setting host is required to avoid "No domain found" warnings | ||
| host: "example.domain.com" # Required to work properly with TLS | ||
| annotations: | ||
| traefik.ingress.kubernetes.io/router.entrypoints: web | ||
| ``` | ||
|
|
||
| For Traefik with TLS: | ||
|
|
||
| ```yaml | ||
| ingress: | ||
| enabled: true | ||
| className: "traefik" | ||
| pathType: "Prefix" | ||
| # Host is required when using TLS with Traefik | ||
| host: "example.domain.com" | ||
| annotations: | ||
| traefik.ingress.kubernetes.io/router.entrypoints: websecure | ||
| tls: | ||
| enabled: true | ||
| secretName: eoapi-tls | ||
| ``` | ||
|
|
||
| ## Migration | ||
|
|
||
| If you're migrating from a previous version, follow these guidelines: | ||
emmanuelmathot marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 1. Update your values to use the new unified configuration | ||
| 2. Ensure your ingress controller-specific annotations are set correctly | ||
| 3. Set the appropriate `pathType` for your controller | ||
| 4. Test the configuration before deploying to production | ||
|
|
||
| ## Note for Traefik Users | ||
|
|
||
| Traefik is now fully supported in all environments, including production. The previous restriction limiting Traefik to testing environments has been removed. | ||
|
|
||
| ## Document Server | ||
|
|
||
| The document server implementation has also been unified. It now works with both NGINX and Traefik controllers using the same configuration. | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {{- define "eoapi.pgstacInitContainer" -}} | ||
| {{- if .Values.pgstacBootstrap.enabled }} | ||
| - name: wait-for-pgstac-migrate | ||
| image: bitnami/kubectl:latest | ||
| command: | ||
| - /bin/sh | ||
| - -c | ||
| - | | ||
| echo "Waiting for pgstac-migrate job to complete..." | ||
| until kubectl get job pgstac-migrate -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}' | grep -q "True"; do | ||
| echo "pgstac-migrate job not complete yet, waiting..." | ||
| sleep 5 | ||
| done | ||
| echo "pgstac-migrate job completed successfully." | ||
| {{- if .Values.pgstacBootstrap.settings.loadSamples }} | ||
| - name: wait-for-pgstac-load-samples | ||
| image: bitnami/kubectl:latest | ||
| command: | ||
| - /bin/sh | ||
| - -c | ||
| - | | ||
| echo "Waiting for pgstac-load-samples job to complete..." | ||
| until kubectl get job pgstac-load-samples -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}' | grep -q "True"; do | ||
| echo "pgstac-load-samples job not complete yet, waiting..." | ||
| sleep 5 | ||
| done | ||
| echo "pgstac-load-samples job completed successfully." | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end -}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.