From e727ef3bbb8a7876bfb61bd435f17492e5898759 Mon Sep 17 00:00:00 2001 From: Felix Delattre Date: Mon, 17 Nov 2025 10:58:20 +0100 Subject: [PATCH] Restructured values in service profiles. --- CHANGELOG.md | 2 +- charts/eoapi/README.md | 44 ++- charts/eoapi/local-base-values.yaml | 102 ------ charts/eoapi/local-k3s-values.yaml | 76 ---- charts/eoapi/local-minikube-values.yaml | 72 ---- charts/eoapi/profiles/README.md | 107 ++++++ charts/eoapi/profiles/core.yaml | 217 +++++++++++ charts/eoapi/profiles/experimental.yaml | 425 ++++++++++++++++++++++ charts/eoapi/profiles/local/k3s.yaml | 48 +++ charts/eoapi/profiles/local/minikube.yaml | 49 +++ charts/eoapi/test-helm-values.yaml | 10 - scripts/deploy.sh | 26 +- scripts/test.sh | 8 +- 13 files changed, 905 insertions(+), 281 deletions(-) delete mode 100644 charts/eoapi/local-base-values.yaml delete mode 100644 charts/eoapi/local-k3s-values.yaml delete mode 100644 charts/eoapi/local-minikube-values.yaml create mode 100644 charts/eoapi/profiles/README.md create mode 100644 charts/eoapi/profiles/core.yaml create mode 100644 charts/eoapi/profiles/experimental.yaml create mode 100644 charts/eoapi/profiles/local/k3s.yaml create mode 100644 charts/eoapi/profiles/local/minikube.yaml delete mode 100644 charts/eoapi/test-helm-values.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index a6eb8479..255a9e7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Reorganized local development values files into structured profiles directory: - Refactors eoapi-support into core eoapi chart [#262](https://github.com/developmentseed/eoapi-k8s/pull/262) - Make integration tests fail properly - Temporarily skip VRT driver in GDALg to avoid https://github.com/OSGeo/gdal/issues/12645 @@ -34,7 +35,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add queryables configuration support using pypgstac load-queryables [#323](https://github.com/developmentseed/eoapi-k8s/pull/323) - Added local testing with k3s and minikube -- Base local development values file (`local-base-values.yaml`) - Unified local cluster management with `CLUSTER_TYPE` variable - Improved CI and local debugging; added debug-deployment.sh script - Added knative in CI to test eoapi-notifier. diff --git a/charts/eoapi/README.md b/charts/eoapi/README.md index f0f48236..7e5fb588 100644 --- a/charts/eoapi/README.md +++ b/charts/eoapi/README.md @@ -28,8 +28,11 @@ helm install --set disable_check_for_upgrades=true pgo \ oci://registry.developers.crunchydata.com/crunchydata/pgo \ --version 5.7.4 -# Install eoAPI -helm install eoapi eoapi/eoapi +# Install eoAPI with core profile (stable services only) +helm install eoapi eoapi/eoapi -f profiles/core.yaml + +# Or install with all features for development +helm install eoapi eoapi/eoapi -f profiles/experimental.yaml ``` ## Prerequisites @@ -39,7 +42,33 @@ helm install eoapi eoapi/eoapi - PV provisioner support - PostgreSQL operator -## Quick Start Configuration +## Quick Start with Profiles + +Use pre-configured profiles for common deployment scenarios: + +```bash +# Production deployment with stable services only +helm install eoapi eoapi/eoapi -f profiles/core.yaml + +# Development with all features enabled +helm install eoapi eoapi/eoapi -f profiles/experimental.yaml + +# Local k3s development +helm install eoapi eoapi/eoapi \ + -f profiles/experimental.yaml \ + -f profiles/local/k3s.yaml + +# Local minikube development +helm install eoapi eoapi/eoapi \ + -f profiles/experimental.yaml \ + -f profiles/local/minikube.yaml +``` + +See [profiles/README.md](./profiles/README.md) for detailed profile documentation. + +## Manual Configuration + +For custom deployments, configure values directly: ```yaml # Enable desired services @@ -69,6 +98,15 @@ pgstacBootstrap: ## Configuration Options +### Service Profile Presets + +| Profile | Use Case | Services | Features | +|---------|----------|----------|----------| +| `profiles/core.yaml` | Production | STAC, Raster, Vector | Stable, optimized resources | +| `profiles/experimental.yaml` | Development/Testing | All services | Includes experimental features, monitoring | +| `profiles/local/k3s.yaml` | Local k3s | Inherits from experimental | k3s-specific settings | +| `profiles/local/minikube.yaml` | Local minikube | Inherits from experimental | Minikube-specific settings | + ### Key Parameters | Parameter | Description | Default | diff --git a/charts/eoapi/local-base-values.yaml b/charts/eoapi/local-base-values.yaml deleted file mode 100644 index 3644ee7d..00000000 --- a/charts/eoapi/local-base-values.yaml +++ /dev/null @@ -1,102 +0,0 @@ -# Base local development values for eoAPI -# Common configuration shared between minikube and k3s -# Platform-specific values should override only what's different - -testing: false - -# Database configuration optimized for local development -database: - enabled: true - connectionPooling: - enabled: false # Simplify for local development - -# Enable pgstac bootstrap with sample data -pgstacBootstrap: - enabled: true - settings: - # Queryables configuration for testing - queryables: - - file: "initdb-data/queryables/test-queryables.json" - indexFields: ["platform", "instruments"] - deleteMissing: true - resources: - requests: - cpu: "256m" - memory: "1024Mi" - limits: - cpu: "512m" - memory: "1024Mi" - -# STAC API service -stac: - enabled: true - settings: - resources: - requests: - cpu: "512m" - memory: "1024Mi" - limits: - cpu: "1280m" - memory: "1536Mi" - envVars: - # Enable debug mode for development - STAC_FASTAPI_DEBUG: "True" - # Disable CORS for local development - STAC_FASTAPI_CORS_ORIGINS: "*" - -# Raster service (TiTiler) -raster: - enabled: true - settings: - resources: - requests: - cpu: "256m" - memory: "1024Mi" - limits: - cpu: "768m" - memory: "4096Mi" - envVars: - # Enable debug logging - TITILER_DEBUG: "True" - -# Vector service (TiPG) -vector: - enabled: true - settings: - resources: - requests: - cpu: "256m" - memory: "1024Mi" - limits: - cpu: "768m" - memory: "1536Mi" - envVars: - # Enable debug mode for integration tests - TIPG_DEBUG: "True" - -# STAC Browser -browser: - enabled: true - settings: - resources: - requests: - cpu: "50m" - memory: "64Mi" - limits: - cpu: "200m" - memory: "128Mi" - -monitoring: - metricsServer: - enabled: true - -autoscaling: - enabled: false - -# Simple ingress configuration (platform-specific parts overridden) -ingress: - enabled: true - pathType: "Prefix" - host: "localhost" - tls: - enabled: false # Simplify for local development diff --git a/charts/eoapi/local-k3s-values.yaml b/charts/eoapi/local-k3s-values.yaml deleted file mode 100644 index efda8237..00000000 --- a/charts/eoapi/local-k3s-values.yaml +++ /dev/null @@ -1,76 +0,0 @@ -# k3s development and testing values for eoAPI -# Inherits from local-base-values.yaml, only overrides k3s-specific settings -# Usage: helm install eoapi ./charts/eoapi -f local-base-values.yaml -f local-k3s-values.yaml - -# Ingress configuration for Traefik (k3s built-in) -ingress: - className: "traefik" - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web - -# Knative components for CloudEvents -knative: - enabled: true - cloudEventsSink: - enabled: true - -# eoapi-notifier configuration with CloudEvents output -eoapi-notifier: - enabled: true - waitForKnativeCRDs: false - config: - logLevel: DEBUG - sources: - - type: pgstac - config: - channel: pgstac_items_change - connection: - existingSecret: - name: "" # Set dynamically by deploy script - keys: - username: "user" - password: "password" - host: "host" - port: "port" - database: "dbname" - outputs: - - type: cloudevents - config: - source: /eoapi/pgstac - event_type: org.eoapi.stac.item - destination: - ref: - apiVersion: serving.knative.dev/v1 - kind: Service - name: eoapi-cloudevents-sink - resources: - requests: - cpu: "50m" - memory: "64Mi" - limits: - cpu: "200m" - memory: "128Mi" - -# Reduce PostgreSQL resources for local development -postgrescluster: - instances: - - name: "postgres" - replicas: 1 - dataVolumeClaimSpec: - accessModes: - - "ReadWriteOnce" - resources: - requests: - storage: "1Gi" - resources: - requests: - cpu: "100m" - memory: "512Mi" - limits: - cpu: "500m" - memory: "1Gi" - -# Disable metrics-server as k3s provides it built-in -monitoring: - metricsServer: - enabled: false diff --git a/charts/eoapi/local-minikube-values.yaml b/charts/eoapi/local-minikube-values.yaml deleted file mode 100644 index e6437292..00000000 --- a/charts/eoapi/local-minikube-values.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# Local minikube development values for eoAPI -# Inherits from local-base-values.yaml, only overrides minikube-specific settings -# Usage: helm install eoapi ./charts/eoapi -f local-base-values.yaml -f local-minikube-values.yaml - -# Ingress configuration for nginx (minikube default) -ingress: - className: "nginx" - annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/use-regex: "true" - -# Knative components for CloudEvents -knative: - enabled: true - cloudEventsSink: - enabled: true - -# eoapi-notifier configuration with CloudEvents output -eoapi-notifier: - enabled: true - waitForKnativeCRDs: false - config: - logLevel: DEBUG - sources: - - type: pgstac - config: - channel: pgstac_items_change - connection: - existingSecret: - name: "" # Set dynamically by deploy script - keys: - username: "user" - password: "password" - host: "host" - port: "port" - database: "dbname" - outputs: - - type: cloudevents - config: - source: /eoapi/pgstac - event_type: org.eoapi.stac.item - destination: - ref: - apiVersion: serving.knative.dev/v1 - kind: Service - name: eoapi-cloudevents-sink - resources: - requests: - cpu: "50m" - memory: "64Mi" - limits: - cpu: "200m" - memory: "128Mi" - -# Reduce PostgreSQL resources for local development -postgrescluster: - instances: - - name: "postgres" - replicas: 1 - dataVolumeClaimSpec: - accessModes: - - "ReadWriteOnce" - resources: - requests: - storage: "1Gi" - resources: - requests: - cpu: "100m" - memory: "512Mi" - limits: - cpu: "500m" - memory: "1Gi" diff --git a/charts/eoapi/profiles/README.md b/charts/eoapi/profiles/README.md new file mode 100644 index 00000000..d0f8fac6 --- /dev/null +++ b/charts/eoapi/profiles/README.md @@ -0,0 +1,107 @@ +# eoAPI Helm Chart Profiles + +This directory contains pre-configured values profiles for common eoAPI deployment scenarios. These profiles simplify deployment by providing sensible defaults for different use cases. + +## Overview + +Profiles are pre-configured values files that override the default `values.yaml` settings. They help you quickly deploy eoAPI for different scenarios without manually configuring dozens of parameters. + +## Available Profiles + +### Core Profile (`core.yaml`) +**Use Case:** Production deployments with stable, well-tested services only. + +**Includes:** +- PostgreSQL with PgSTAC +- STAC API +- Raster service (TiTiler) +- Vector service (TiPG) +- Documentation server + +**Excludes:** +- Experimental features +- Development tools +- Monitoring stack +- STAC Browser UI + +**Resources:** Production-optimized with higher resource allocations. + +### Experimental Profile (`experimental.yaml`) +**Use Case:** Development, testing, and evaluation of all eoAPI features. + +**Includes:** +- All core services +- Multidimensional service +- STAC Browser UI +- Notification system (eoapi-notifier) +- Knative integration for CloudEvents +- Complete monitoring stack (Prometheus, Grafana) +- Sample data loading +- Debug modes enabled + +**Resources:** Balanced for development environments. + +### Local Profiles + +#### k3s Profile (`local/k3s.yaml`) +**Use Case:** Local development on k3s clusters. + +**Requirements:** Must be used together with `experimental.yaml` + +**Overrides:** +- Traefik ingress configuration +- Reduced PostgreSQL resources (1Gi storage, minimal CPU/memory) +- Disabled metrics-server (k3s provides built-in) + +#### Minikube Profile (`local/minikube.yaml`) +**Use Case:** Local development on Minikube. + +**Requirements:** Must be used together with `experimental.yaml` + +**Overrides:** +- Nginx ingress configuration with regex support +- Reduced PostgreSQL resources (1Gi storage, minimal CPU/memory) +- Enabled metrics-server + +## Usage + +### Basic Usage + +Deploy with a single profile: +```bash +# Production deployment with core services only +helm install eoapi ./charts/eoapi -f profiles/core.yaml + +# Development deployment with all features +helm install eoapi ./charts/eoapi -f profiles/experimental.yaml +``` + +### Layered Profiles + +Combine profiles for specific environments: +```bash +# k3s local development +helm install eoapi ./charts/eoapi \ + -f profiles/experimental.yaml \ + -f profiles/local/k3s.yaml + +# Minikube local development +helm install eoapi ./charts/eoapi \ + -f profiles/experimental.yaml \ + -f profiles/local/minikube.yaml +``` + +### Custom Overrides + +Add your own overrides on top of profiles: +```bash +# Use core profile with custom domain +helm install eoapi ./charts/eoapi \ + -f profiles/core.yaml \ + --set ingress.host=api.example.com + +# Use experimental profile with external database +helm install eoapi ./charts/eoapi \ + -f profiles/experimental.yaml \ + -f my-custom-values.yaml +``` diff --git a/charts/eoapi/profiles/core.yaml b/charts/eoapi/profiles/core.yaml new file mode 100644 index 00000000..204de456 --- /dev/null +++ b/charts/eoapi/profiles/core.yaml @@ -0,0 +1,217 @@ +# eoAPI Core Profile +# Stable, production-ready services only +# Includes: PostgreSQL, PgSTAC, STAC API, Raster (TiTiler), Vector (TiPG) +# +# Usage: +# helm install eoapi ./charts/eoapi -f profiles/core.yaml +# helm upgrade eoapi ./charts/eoapi -f profiles/core.yaml + +# Core services only +testing: false + +###################### +# DATABASE +###################### +# PostgreSQL cluster configuration for production +postgresql: + type: "postgrescluster" + +postgrescluster: + enabled: true + postgresVersion: 16 + postGISVersion: "3.4" + pgBouncerReplicas: 1 + monitoring: false + instances: + - name: eoapi + replicas: 1 + dataVolumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "10Gi" + resources: + requests: + cpu: "1024m" + memory: "3048Mi" + limits: + cpu: "2048m" + memory: "4096Mi" + users: + - name: postgres + databases: + - eoapi + - postgres + options: "SUPERUSER" + - name: eoapi + databases: + - eoapi + - postgres + options: "CREATEDB CREATEROLE" + password: + type: AlphaNumeric + +###################### +# PGSTAC BOOTSTRAP +###################### +pgstacBootstrap: + enabled: true + settings: + # Disable sample data for production + loadSamples: false + + # Production-optimized PgSTAC settings + pgstacSettings: + queue_timeout: "10 minutes" + use_queue: "false" + update_collection_extent: "true" + context: "auto" + context_estimated_count: "100000" + context_estimated_cost: "100000" + context_stats_ttl: "1 day" + + resources: + requests: + cpu: "512m" + memory: "1024Mi" + limits: + cpu: "1024m" + memory: "2048Mi" + +###################### +# CORE API SERVICES +###################### +# Only stable, production-ready services +stac: + enabled: true + ingress: + enabled: true + path: "/stac" + autoscaling: + enabled: false + settings: + resources: + requests: + cpu: "512m" + memory: "1024Mi" + limits: + cpu: "1024m" + memory: "2048Mi" + envVars: + HOST: "0.0.0.0" + PORT: "8080" + WEB_CONCURRENCY: "4" + # Production settings + STAC_FASTAPI_DEBUG: "False" + STAC_FASTAPI_CORS_ORIGINS: '["*"]' + +raster: + enabled: true + ingress: + enabled: true + path: "/raster" + autoscaling: + enabled: false + settings: + resources: + requests: + cpu: "512m" + memory: "2048Mi" + limits: + cpu: "1024m" + memory: "4096Mi" + envVars: + # GDAL performance settings + GDAL_CACHEMAX: "200" + GDAL_DISABLE_READDIR_ON_OPEN: "EMPTY_DIR" + GDAL_INGESTED_BYTES_AT_OPEN: "32768" + GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: "YES" + GDAL_HTTP_MULTIPLEX: "YES" + GDAL_HTTP_VERSION: "2" + GDAL_SKIP: "VRT" + PYTHONWARNINGS: "ignore" + VSI_CACHE: "TRUE" + VSI_CACHE_SIZE: "5000000" + # Uvicorn settings + HOST: "0.0.0.0" + PORT: "8080" + WEB_CONCURRENCY: "4" + # Production settings + TITILER_DEBUG: "False" + +vector: + enabled: true + ingress: + enabled: true + path: "/vector" + autoscaling: + enabled: false + settings: + resources: + requests: + cpu: "256m" + memory: "512Mi" + limits: + cpu: "512m" + memory: "1024Mi" + envVars: + TIPG_CATALOG_TTL: "300" + TIPG_DEBUG: "False" + HOST: "0.0.0.0" + PORT: "8080" + WEB_CONCURRENCY: "4" + +###################### +# DISABLED SERVICES +###################### +# Experimental and optional services disabled +multidim: + enabled: false + +browser: + enabled: false + +docServer: + enabled: true + +eoapi-notifier: + enabled: false + +knative: + enabled: false + +monitoring: + metricsServer: + enabled: false + prometheus: + enabled: false + prometheusAdapter: + enabled: false + +observability: + grafana: + enabled: false + +###################### +# INGRESS +###################### +ingress: + enabled: true + className: "nginx" + pathType: "Prefix" + host: "" + tls: + enabled: false + secretName: eoapi-tls + +###################### +# SERVICE +###################### +service: + port: 8080 + +serviceAccount: + create: true + name: "" + automount: true diff --git a/charts/eoapi/profiles/experimental.yaml b/charts/eoapi/profiles/experimental.yaml new file mode 100644 index 00000000..c131b992 --- /dev/null +++ b/charts/eoapi/profiles/experimental.yaml @@ -0,0 +1,425 @@ +# eoAPI Experimental Profile +# All services and experimental features enabled +# Includes: All core services + Multidim, STAC Browser, Notifications, Knative, Monitoring +# WARNING: This profile is for development/testing. Not recommended for production. +# +# Usage: +# helm install eoapi ./charts/eoapi -f profiles/experimental.yaml +# helm upgrade eoapi ./charts/eoapi -f profiles/experimental.yaml + +# Enable testing mode for experimental features +testing: false + +###################### +# DATABASE +###################### +# Database configuration optimized for development +postgresql: + type: "postgrescluster" + +postgrescluster: + enabled: true + postgresVersion: 16 + postGISVersion: "3.4" + pgBouncerReplicas: 1 + monitoring: false + patroni: + dynamicConfiguration: + postgresql: + pg_hba: + - "host all all 0.0.0.0/0 md5" + parameters: + shared_preload_libraries: pg_stat_statements, auto_explain + databaseInitSQL: + key: initdb.sql + name: initdb + instances: + - name: eoapi + replicas: 1 + dataVolumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "5Gi" + resources: + requests: + cpu: "512m" + memory: "1024Mi" + limits: + cpu: "1024m" + memory: "2048Mi" + users: + - name: postgres + databases: + - eoapi + - postgres + options: "SUPERUSER" + - name: eoapi + databases: + - eoapi + - postgres + options: "CREATEDB CREATEROLE" + password: + type: AlphaNumeric + +###################### +# PGSTAC BOOTSTRAP +###################### +pgstacBootstrap: + enabled: true + settings: + # Enable sample data loading for testing + loadSamples: true + + # Queryables configuration for testing + queryables: + - file: "initdb-data/queryables/test-queryables.json" + indexFields: ["platform", "instruments"] + deleteMissing: true + + # PgSTAC settings optimized for development + pgstacSettings: + queue_timeout: "10 minutes" + use_queue: "false" + update_collection_extent: "true" + context: "auto" + context_estimated_count: "100000" + context_estimated_cost: "100000" + context_stats_ttl: "1 day" + + resources: + requests: + cpu: "256m" + memory: "1024Mi" + limits: + cpu: "512m" + memory: "1024Mi" + + envVars: + LOAD_FIXTURES: "true" + +###################### +# ALL API SERVICES +###################### +# Enable all available services +stac: + enabled: true + ingress: + enabled: true + path: "/stac" + autoscaling: + enabled: false + settings: + resources: + requests: + cpu: "512m" + memory: "1024Mi" + limits: + cpu: "1280m" + memory: "1536Mi" + envVars: + HOST: "0.0.0.0" + PORT: "8080" + WEB_CONCURRENCY: "5" + # Debug mode for development + STAC_FASTAPI_DEBUG: "True" + STAC_FASTAPI_CORS_ORIGINS: "*" + +raster: + enabled: true + ingress: + enabled: true + path: "/raster" + autoscaling: + enabled: false + settings: + resources: + requests: + cpu: "256m" + memory: "1024Mi" + limits: + cpu: "768m" + memory: "4096Mi" + envVars: + # GDAL performance settings + GDAL_CACHEMAX: "200" + GDAL_DISABLE_READDIR_ON_OPEN: "EMPTY_DIR" + GDAL_INGESTED_BYTES_AT_OPEN: "32768" + GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: "YES" + GDAL_HTTP_MULTIPLEX: "YES" + GDAL_HTTP_VERSION: "2" + GDAL_SKIP: "VRT" + PYTHONWARNINGS: "ignore" + VSI_CACHE: "TRUE" + VSI_CACHE_SIZE: "5000000" + # Uvicorn settings + HOST: "0.0.0.0" + PORT: "8080" + WEB_CONCURRENCY: "5" + # Debug mode for development + TITILER_DEBUG: "True" + +vector: + enabled: true + ingress: + enabled: true + path: "/vector" + autoscaling: + enabled: false + settings: + resources: + requests: + cpu: "256m" + memory: "1024Mi" + limits: + cpu: "768m" + memory: "1536Mi" + envVars: + TIPG_CATALOG_TTL: "300" + TIPG_DEBUG: "True" + HOST: "0.0.0.0" + PORT: "8080" + WEB_CONCURRENCY: "5" + +# Experimental: Multidimensional service +multidim: + enabled: true + ingress: + enabled: true + path: "/multidim" + autoscaling: + enabled: false + settings: + resources: + requests: + cpu: "256m" + memory: "1024Mi" + limits: + cpu: "768m" + memory: "4096Mi" + envVars: + GDAL_CACHEMAX: "200" + GDAL_DISABLE_READDIR_ON_OPEN: "EMPTY_DIR" + GDAL_INGESTED_BYTES_AT_OPEN: "32768" + GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: "YES" + GDAL_HTTP_MULTIPLEX: "YES" + GDAL_HTTP_VERSION: "2" + PYTHONWARNINGS: "ignore" + VSI_CACHE: "TRUE" + VSI_CACHE_SIZE: "5000000" + HOST: "0.0.0.0" + PORT: "8080" + WEB_CONCURRENCY: "5" + +###################### +# UI COMPONENTS +###################### +browser: + enabled: true + settings: + resources: + requests: + cpu: "50m" + memory: "64Mi" + limits: + cpu: "200m" + memory: "128Mi" + +docServer: + enabled: true + +###################### +# NOTIFICATIONS +###################### +eoapi-notifier: + enabled: true + waitForKnativeCRDs: false + config: + logLevel: DEBUG + sources: + - type: pgstac + config: + channel: pgstac_items_change + connection: + existingSecret: + name: "" # Set dynamically by deploy script + keys: + username: "user" + password: "password" + host: "host" + port: "port" + database: "dbname" + outputs: + - type: cloudevents + config: + source: /eoapi/pgstac + event_type: org.eoapi.stac.item + destination: + ref: + apiVersion: serving.knative.dev/v1 + kind: Service + name: eoapi-cloudevents-sink + resources: + requests: + cpu: "50m" + memory: "64Mi" + limits: + cpu: "200m" + memory: "128Mi" + +###################### +# KNATIVE +###################### +knative: + enabled: true + version: "1.17" + initTimeout: "600s" + cloudEventsSink: + enabled: true + resources: + requests: + cpu: "50m" + memory: "64Mi" + limits: + cpu: "100m" + memory: "128Mi" + +knative-operator: + tag: "v1.17.8" + resources: + requests: + cpu: "50m" + memory: "64Mi" + limits: + cpu: "200m" + memory: "256Mi" + +###################### +# MONITORING +###################### +monitoring: + metricsServer: + enabled: true + apiService: + create: true + + prometheus: + enabled: true + alertmanager: + enabled: false + prometheus-pushgateway: + enabled: false + kube-state-metrics: + enabled: true + prometheus-node-exporter: + enabled: true + resources: + limits: + cpu: "10m" + memory: "30Mi" + requests: + cpu: "10m" + memory: "30Mi" + server: + service: + type: ClusterIP + + prometheusAdapter: + enabled: true + prometheus: + url: http://eoapi-prometheus-server.eoapi.svc.cluster.local + port: 80 + path: "" + rules: + default: false + custom: + - seriesQuery: '{__name__=~"^nginx_ingress_controller_requests$",namespace!=""}' + seriesFilters: [] + resources: + template: <<.Resource>> + name: + matches: "" + as: "nginx_ingress_controller_requests_rate_vector_eoapi" + metricsQuery: round(sum(rate(<<.Series>>{service="vector",path=~"/vector.*",<<.LabelMatchers>>}[5m])) by (<<.GroupBy>>), 0.001) + + - seriesQuery: '{__name__=~"^nginx_ingress_controller_requests$",namespace!=""}' + seriesFilters: [] + resources: + template: <<.Resource>> + name: + matches: "" + as: "nginx_ingress_controller_requests_rate_raster_eoapi" + metricsQuery: round(sum(rate(<<.Series>>{service="raster",path=~"/raster.*",<<.LabelMatchers>>}[5m])) by (<<.GroupBy>>), 0.001) + + - seriesQuery: '{__name__=~"^nginx_ingress_controller_requests$",namespace!=""}' + seriesFilters: [] + resources: + template: <<.Resource>> + name: + matches: "" + as: "nginx_ingress_controller_requests_rate_stac_eoapi" + metricsQuery: round(sum(rate(<<.Series>>{service="stac",path=~"/stac.*",<<.LabelMatchers>>}[5m])) by (<<.GroupBy>>), 0.001) + +###################### +# OBSERVABILITY +###################### +observability: + grafana: + enabled: true + persistence: + enabled: false + service: + type: ClusterIP + resources: + limits: + cpu: "100m" + memory: "200Mi" + requests: + cpu: "50m" + memory: "100Mi" + datasources: + datasources.yaml: + apiVersion: 1 + datasources: + - name: Prometheus + type: prometheus + url: "http://{{ .Release.Name }}-prometheus-server" + access: proxy + isDefault: true + dashboardsConfigMaps: + default: "{{ .Release.Name }}-dashboards" + +###################### +# AUTOSCALING +###################### +autoscaling: + enabled: true + +###################### +# INGRESS +###################### +ingress: + enabled: true + className: "nginx" + pathType: "Prefix" + host: "localhost" + tls: + enabled: false + +###################### +# SERVICE +###################### +service: + port: 8080 + +serviceAccount: + create: true + name: "" + automount: true + +# Enable connection pooling for development +database: + enabled: true + connectionPooling: + enabled: false # Simplify for local development diff --git a/charts/eoapi/profiles/local/k3s.yaml b/charts/eoapi/profiles/local/k3s.yaml new file mode 100644 index 00000000..df4baf9c --- /dev/null +++ b/charts/eoapi/profiles/local/k3s.yaml @@ -0,0 +1,48 @@ +# eoAPI k3s Local Profile +# k3s-specific overrides for local development +# Must be used together with experimental.yaml profile +# +# Usage: +# helm install eoapi ./charts/eoapi -f profiles/experimental.yaml -f profiles/local/k3s.yaml +# helm upgrade eoapi ./charts/eoapi -f profiles/experimental.yaml -f profiles/local/k3s.yaml +# +# Note: This profile inherits all settings from experimental.yaml and only overrides k3s-specific values + +###################### +# K3S SPECIFIC INGRESS +###################### +# k3s uses Traefik as the default ingress controller +ingress: + className: "traefik" + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + +###################### +# POSTGRESQL RESOURCES +###################### +# Reduce PostgreSQL resources for local k3s development +postgrescluster: + instances: + - name: "postgres" + replicas: 1 + dataVolumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "1Gi" + resources: + requests: + cpu: "100m" + memory: "512Mi" + limits: + cpu: "500m" + memory: "1Gi" + +###################### +# MONITORING +###################### +# Disable metrics-server as k3s provides it built-in +monitoring: + metricsServer: + enabled: false diff --git a/charts/eoapi/profiles/local/minikube.yaml b/charts/eoapi/profiles/local/minikube.yaml new file mode 100644 index 00000000..4969ce58 --- /dev/null +++ b/charts/eoapi/profiles/local/minikube.yaml @@ -0,0 +1,49 @@ +# eoAPI Minikube Local Profile +# Minikube-specific overrides for local development +# Must be used together with experimental.yaml profile +# +# Usage: +# helm install eoapi ./charts/eoapi -f profiles/experimental.yaml -f profiles/local/minikube.yaml +# helm upgrade eoapi ./charts/eoapi -f profiles/experimental.yaml -f profiles/local/minikube.yaml +# +# Note: This profile inherits all settings from experimental.yaml and only overrides minikube-specific values + +###################### +# MINIKUBE SPECIFIC INGRESS +###################### +# Minikube uses nginx as the default ingress controller +ingress: + className: "nginx" + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/use-regex: "true" + +###################### +# POSTGRESQL RESOURCES +###################### +# Reduce PostgreSQL resources for local minikube development +postgrescluster: + instances: + - name: "postgres" + replicas: 1 + dataVolumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "1Gi" + resources: + requests: + cpu: "100m" + memory: "512Mi" + limits: + cpu: "500m" + memory: "1Gi" + +###################### +# MONITORING +###################### +# Keep metrics-server enabled as minikube may not provide it by default +monitoring: + metricsServer: + enabled: true diff --git a/charts/eoapi/test-helm-values.yaml b/charts/eoapi/test-helm-values.yaml deleted file mode 100644 index 371986da..00000000 --- a/charts/eoapi/test-helm-values.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# this file is used with `helm-tests` job in CI - -knative: - enabled: false - -ingress: - className: "nginx" - enabled: true - -gitSha: 'ABC123' diff --git a/scripts/deploy.sh b/scripts/deploy.sh index dcb2a81f..c6bf6b22 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -400,12 +400,12 @@ deploy_eoapi() { HELM_CMD="$HELM_CMD -f ./eoapi/values.yaml" fi - # Add local base configuration for development environments - if [ -f "./eoapi/local-base-values.yaml" ]; then + # Add experimental profile for development environments + if [ -f "./eoapi/profiles/experimental.yaml" ]; then case "$(kubectl config current-context 2>/dev/null || echo "unknown")" in *"minikube"*|*"k3d"*|"default") - log_info "Using local base configuration..." - HELM_CMD="$HELM_CMD -f ./eoapi/local-base-values.yaml" + log_info "Using experimental profile configuration..." + HELM_CMD="$HELM_CMD -f ./eoapi/profiles/experimental.yaml" ;; esac fi @@ -413,12 +413,12 @@ deploy_eoapi() { # Environment-specific configuration if [ "$CI_MODE" = true ]; then log_info "Applying CI-specific overrides..." - # Use base + k3s values, then override for CI - if [ -f "./eoapi/local-base-values.yaml" ]; then - HELM_CMD="$HELM_CMD -f ./eoapi/local-base-values.yaml" + # Use experimental + k3s profiles, then override for CI + if [ -f "./eoapi/profiles/experimental.yaml" ]; then + HELM_CMD="$HELM_CMD -f ./eoapi/profiles/experimental.yaml" fi - if [ -f "./eoapi/local-k3s-values.yaml" ]; then - HELM_CMD="$HELM_CMD -f ./eoapi/local-k3s-values.yaml" + if [ -f "./eoapi/profiles/local/k3s.yaml" ]; then + HELM_CMD="$HELM_CMD -f ./eoapi/profiles/local/k3s.yaml" fi HELM_CMD="$HELM_CMD --set testing=true" HELM_CMD="$HELM_CMD --set ingress.host=eoapi.local" @@ -469,15 +469,15 @@ deploy_eoapi() { case "$current_context" in *"k3d"*) - if [ -f "./eoapi/local-k3s-values.yaml" ]; then + if [ -f "./eoapi/profiles/local/k3s.yaml" ]; then log_info "Adding k3s-specific overrides..." - HELM_CMD="$HELM_CMD -f ./eoapi/local-k3s-values.yaml" + HELM_CMD="$HELM_CMD -f ./eoapi/profiles/local/k3s.yaml" fi ;; "minikube") - if [ -f "./eoapi/local-minikube-values.yaml" ]; then + if [ -f "./eoapi/profiles/local/minikube.yaml" ]; then log_info "Adding minikube-specific overrides..." - HELM_CMD="$HELM_CMD -f ./eoapi/local-minikube-values.yaml" + HELM_CMD="$HELM_CMD -f ./eoapi/profiles/local/minikube.yaml" fi ;; esac diff --git a/scripts/test.sh b/scripts/test.sh index 5be94eb2..1577c2b4 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -170,10 +170,10 @@ run_helm_tests() { exit 1 fi - # Use test values for eoapi chart if available - if [ "$chart_name" = "eoapi" ] && [ -f "$chart_dir/test-helm-values.yaml" ]; then - if ! helm template test "$chart_dir" -f "$chart_dir/test-helm-values.yaml" >/dev/null; then - log_error "Helm template failed for $chart_name with test values" + # Use experimental profile for comprehensive eoapi chart testing + if [ "$chart_name" = "eoapi" ] && [ -f "$chart_dir/profiles/experimental.yaml" ]; then + if ! helm template test "$chart_dir" -f "$chart_dir/profiles/experimental.yaml" >/dev/null; then + log_error "Helm template failed for $chart_name with experimental profile" exit 1 fi elif ! helm template test "$chart_dir" >/dev/null; then