From 35d5376c9a16a53bd2774ab0084531dc2311d28e Mon Sep 17 00:00:00 2001 From: benoit Date: Mon, 3 Mar 2025 14:45:23 +0100 Subject: [PATCH 01/14] fix: add missing psycopg dependency --- dockerfiles/Dockerfile.stac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile.stac b/dockerfiles/Dockerfile.stac index 423c31b..17a1195 100644 --- a/dockerfiles/Dockerfile.stac +++ b/dockerfiles/Dockerfile.stac @@ -7,7 +7,7 @@ ENV CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt RUN apt update && apt install git -y COPY runtimes/eoapi/stac /tmp/stac -RUN python -m pip install /tmp/stac[server,telemetry,redis] +RUN python -m pip install /tmp/stac[server,telemetry,redis] pypgstac[psycopg] RUN rm -rf /tmp/stac ENV MODULE_NAME eoapi.stac.app From 0a2fd9e1de9dfc0e49a8c58832a91895a9eb084c Mon Sep 17 00:00:00 2001 From: benoit Date: Mon, 3 Mar 2025 14:46:41 +0100 Subject: [PATCH 02/14] feat: change priority order db --- deploy/helm/eocatalog/templates/stac/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/helm/eocatalog/templates/stac/deployment.yaml b/deploy/helm/eocatalog/templates/stac/deployment.yaml index 8708ea1..4e491a0 100644 --- a/deploy/helm/eocatalog/templates/stac/deployment.yaml +++ b/deploy/helm/eocatalog/templates/stac/deployment.yaml @@ -122,6 +122,8 @@ spec: - | set -xe pypgstac pgready && pypgstac migrate + psql -U postgres -c 'GRANT pgstac_admin to "eo-catalogue";' + psql -U postgres -c 'ALTER DATABASE postgis SET search_path TO pgstac, public;' env: - name: PGUSER value: postgres From 1cb3e643971927f25e74a2f9fb4c374e55897de8 Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Tue, 4 Mar 2025 15:10:30 +0100 Subject: [PATCH 03/14] chore: replace catalogue->catalog occurences --- README.md | 2 +- deploy/helm/eocatalog/Chart.yaml | 8 +- deploy/helm/eocatalog/README.md | 4 +- deploy/helm/eocatalog/templates/_helpers.tpl | 80 +++++++++--------- .../eocatalog/templates/stac/deployment.yaml | 60 ++++++------- deploy/helm/eocatalog/templates/stac/hpa.yaml | 4 +- .../eocatalog/templates/stac/ingress.yaml | 6 +- .../eocatalog/templates/stac/service.yaml | 2 +- .../templates/stac/serviceaccount.yaml | 2 +- deploy/helm/eocatalog/values.yaml | 4 +- ...go-1080.webp => eo-catalog-logo-1080.webp} | Bin 11 files changed, 86 insertions(+), 86 deletions(-) rename docs/static/{eo-catalogue-logo-1080.webp => eo-catalog-logo-1080.webp} (100%) diff --git a/README.md b/README.md index 6065574..2e74868 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -EO Catalog logo +EO Catalog logo --- EO Catalog, a eoAPI customization. diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index 91d0b6a..6fefeda 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -14,10 +14,10 @@ dependencies: - bitnami-common version: 2.x description: A CS Group Earth Observation solution. -home: https://github.com/csgroup-oss/eo-catalogue -icon: https://github.com/csgroup-oss/eo-catalogue/-/blob/main/docs/static/eo-catalogue-logo-1080.webp -name: eo-catalogue +home: https://github.com/csgroup-oss/eo-catalog +icon: https://github.com/csgroup-oss/eo-catalog/-/blob/main/docs/static/eo-catalog-logo-1080.webp +name: eo-catalog sources: - - https://github.com/csgroup-oss/eo-catalogue + - https://github.com/csgroup-oss/eo-catalog type: application version: 0.10.0 diff --git a/deploy/helm/eocatalog/README.md b/deploy/helm/eocatalog/README.md index 9436ed6..ba50ec1 100644 --- a/deploy/helm/eocatalog/README.md +++ b/deploy/helm/eocatalog/README.md @@ -193,7 +193,7 @@ All components are removed except the PrivateVolumeClaim if you use a persistent | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -------------- | | `postgresql.enabled` | Switch to enable or disable the PostgreSQL helm chart | `true` | | `postgresql.auth.postgresPassword` | Password for the "postgres" admin user. Ignored if `auth.existingSecret` with key `postgres-password` is provided | `""` | -| `postgresql.auth.username` | Name for a custom user to create | `eo-catalogue` | +| `postgresql.auth.username` | Name for a custom user to create | `eo-catalog` | | `postgresql.auth.password` | Password for the custom user to create | `""` | | `postgresql.auth.database` | Name for a custom database to create | `postgis` | | `postgresql.auth.existingSecret` | Name of existing secret to use for PostgreSQL credentials | `""` | @@ -220,7 +220,7 @@ All components are removed except the PrivateVolumeClaim if you use a persistent | `externalDatabase.host` | Database host | `""` | | `externalDatabase.hostWriter` | Database host for write operations. Default to externalDatabase.host. Needed when externalDatabase.host is readonly | `""` | | `externalDatabase.port` | Database port number | `5432` | -| `externalDatabase.user` | Non-root username for EO Catalog STAC API | `eo-catalogue` | +| `externalDatabase.user` | Non-root username for EO Catalog STAC API | `eo-catalog` | | `externalDatabase.password` | Password for the non-root username for EO Catalog STAC API | `""` | | `externalDatabase.postgresPassword` | Password for the root username for EO Catalog STAC API | `""` | | `externalDatabase.database` | EO Catalog STAC API database name | `postgis` | diff --git a/deploy/helm/eocatalog/templates/_helpers.tpl b/deploy/helm/eocatalog/templates/_helpers.tpl index 1d9ef6e..1745e74 100644 --- a/deploy/helm/eocatalog/templates/_helpers.tpl +++ b/deploy/helm/eocatalog/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Create the name of the service account to use for the STAC API */}} -{{- define "eocatalogue.stac.serviceAccountName" -}} +{{- define "eocatalog.stac.serviceAccountName" -}} {{- if .Values.stac.serviceAccount.create -}} {{ default (printf "%s-stac-api" (include "common.names.fullname" .)) .Values.stac.serviceAccount.name | trunc 63 | trimSuffix "-" }} {{- else -}} @@ -12,15 +12,15 @@ Create the name of the service account to use for the STAC API {{/* Return the proper Docker Image Registry Secret Names */}} -{{- define "eocatalogue.imagePullSecrets" -}} +{{- define "eocatalog.imagePullSecrets" -}} {{- include "common.images.pullSecrets" (dict "images" (list .Values.stac.image) "global" .Values.global) -}} {{- end -}} {{/* -Return the proper service name for EO Catalogue STAC API +Return the proper service name for EO catalog STAC API We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} -{{- define "eocatalogue.stac" -}} +{{- define "eocatalog.stac" -}} {{- printf "%s-stac-api" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -28,43 +28,43 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this Create a default fully qualified app name for PostgreSQL We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} -{{- define "eocatalogue.postgresql.fullname" -}} +{{- define "eocatalog.postgresql.fullname" -}} {{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Return the Database hostname */}} -{{- define "eocatalogue.databaseHost" -}} +{{- define "eocatalog.databaseHost" -}} {{- if eq .Values.postgresql.architecture "replication" -}} -{{- ternary (include "eocatalogue.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled -}}-primary +{{- ternary (include "eocatalog.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled -}}-primary {{- else -}} -{{- ternary (include "eocatalogue.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled -}} +{{- ternary (include "eocatalog.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled -}} {{- end -}} {{- end -}} {{/* Return the Database hostname */}} -{{- define "eocatalogue.databaseHostWriter" -}} +{{- define "eocatalog.databaseHostWriter" -}} {{- if and (not .Values.postgresql.enabled) .Values.externalDatabase.hostWriter -}} {{ .Values.externalDatabase.hostWriter }} {{- else -}} - {{ (include "eocatalogue.databaseHost" .)}} + {{ (include "eocatalog.databaseHost" .)}} {{- end -}} {{- end -}} {{/* Return the Database port */}} -{{- define "eocatalogue.databasePort" -}} +{{- define "eocatalog.databasePort" -}} {{- ternary "5432" .Values.externalDatabase.port .Values.postgresql.enabled | quote -}} {{- end -}} {{/* Return the Database database name */}} -{{- define "eocatalogue.databaseName" -}} +{{- define "eocatalog.databaseName" -}} {{- if .Values.postgresql.enabled -}} {{- if .Values.global.postgresql -}} {{- if .Values.global.postgresql.auth -}} @@ -83,7 +83,7 @@ Return the Database database name {{/* Return the Database user */}} -{{- define "eocatalogue.databaseUser" -}} +{{- define "eocatalog.databaseUser" -}} {{- if .Values.postgresql.enabled -}} {{- if .Values.global.postgresql -}} {{- if .Values.global.postgresql.auth -}} @@ -102,20 +102,20 @@ Return the Database user {{/* Return the Database encrypted password */}} -{{- define "eocatalogue.databaseSecretName" -}} +{{- define "eocatalog.databaseSecretName" -}} {{- if .Values.postgresql.enabled -}} {{- if .Values.global.postgresql -}} {{- if .Values.global.postgresql.auth -}} {{- if .Values.global.postgresql.auth.existingSecret -}} {{- tpl .Values.global.postgresql.auth.existingSecret $ -}} {{- else -}} - {{- default (include "eocatalogue.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} + {{- default (include "eocatalog.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} {{- end -}} {{- else -}} - {{- default (include "eocatalogue.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} + {{- default (include "eocatalog.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} {{- end -}} {{- else -}} - {{- default (include "eocatalogue.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} + {{- default (include "eocatalog.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} {{- end -}} {{- else -}} {{- default (printf "%s-externaldb" .Release.Name) (tpl .Values.externalDatabase.existingSecret $) -}} @@ -125,7 +125,7 @@ Return the Database encrypted password {{/* Add environment variables to configure database values */}} -{{- define "eocatalogue.databaseSecretKey" -}} +{{- define "eocatalog.databaseSecretKey" -}} {{- if .Values.postgresql.enabled -}} {{- print "password" -}} {{- else -}} @@ -141,7 +141,7 @@ Add environment variables to configure database values {{- end -}} {{- end -}} -{{- define "eocatalogue.databaseSecretPostgresKey" -}} +{{- define "eocatalog.databaseSecretPostgresKey" -}} {{- if .Values.postgresql.enabled -}} {{- print "postgres-password" -}} {{- else -}} @@ -161,31 +161,31 @@ Add environment variables to configure database values Create a default fully qualified redis name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} -{{- define "eocatalogue.redis.fullname" -}} +{{- define "eocatalog.redis.fullname" -}} {{- include "common.names.dependency.fullname" (dict "chartName" "redis" "chartValues" .Values.redis "context" $) -}} {{- end -}} {{/* Return the Redis® secret name */}} -{{- define "eocatalogue.redis.secretName" -}} +{{- define "eocatalog.redis.secretName" -}} {{- if .Values.redis.enabled }} {{- if .Values.redis.auth.existingSecret }} {{- printf "%s" .Values.redis.auth.existingSecret -}} {{- else -}} - {{- printf "%s" (include "eocatalogue.redis.fullname" .) }} + {{- printf "%s" (include "eocatalog.redis.fullname" .) }} {{- end -}} {{- else if .Values.externalRedis.existingSecret }} {{- printf "%s" .Values.externalRedis.existingSecret -}} {{- else -}} - {{- printf "%s-redis" (include "eocatalogue.redis.fullname" .) -}} + {{- printf "%s-redis" (include "eocatalog.redis.fullname" .) -}} {{- end -}} {{- end -}} {{/* Return the Redis® secret key */}} -{{- define "eocatalogue.redis.secretPasswordKey" -}} +{{- define "eocatalog.redis.secretPasswordKey" -}} {{- if and .Values.redis.enabled .Values.redis.auth.existingSecret }} {{- .Values.redis.auth.existingSecretPasswordKey | printf "%s" }} {{- else if and (not .Values.redis.enabled) .Values.externalRedis.existingSecret }} @@ -198,7 +198,7 @@ Return the Redis® secret key {{/* Return whether Redis® uses password authentication or not */}} -{{- define "eocatalogue.redis.auth.enabled" -}} +{{- define "eocatalog.redis.auth.enabled" -}} {{- if or (and .Values.redis.enabled .Values.redis.auth.enabled) (and (not .Values.redis.enabled) (or .Values.externalRedis.password .Values.externalRedis.existingSecret)) }} {{- true -}} {{- end -}} @@ -207,7 +207,7 @@ Return whether Redis® uses password authentication or not {{/* Return whether Redis® uses password authentication or not */}} -{{- define "eocatalogue.redis.tlsEnabled" -}} +{{- define "eocatalog.redis.tlsEnabled" -}} {{- if or (and .Values.redis.enabled .Values.redis.tls.enabled) (and (not .Values.redis.enabled) (or .Values.externalRedis.tlsEnabled)) }} {{- "true" | quote -}} {{- else -}} @@ -218,9 +218,9 @@ Return whether Redis® uses password authentication or not {{/* Return the Redis® hostname */}} -{{- define "eocatalogue.redisHost" -}} +{{- define "eocatalog.redisHost" -}} {{- if .Values.redis.enabled }} - {{- printf "%s-master" (include "eocatalogue.redis.fullname" .) -}} + {{- printf "%s-master" (include "eocatalog.redis.fullname" .) -}} {{- else -}} {{- required "If the redis dependency is disabled you need to add an external redis host" .Values.externalRedis.host -}} {{- end -}} @@ -229,7 +229,7 @@ Return the Redis® hostname {{/* Return the Redis® port */}} -{{- define "eocatalogue.redisPort" -}} +{{- define "eocatalog.redisPort" -}} {{- if .Values.redis.enabled }} {{- .Values.redis.service.port -}} {{- else -}} @@ -240,18 +240,18 @@ Return the Redis® port {{/* Get the client secret for the STAC API OpenID Connect authentication. */}} -{{- define "eocatalogue.stac.clientSecretName" -}} +{{- define "eocatalog.stac.clientSecretName" -}} {{- if .Values.stac.oidc.existingSecret.name }} {{- printf "%s" (tpl .Values.stac.oidc.existingSecret.name $) -}} {{- else -}} - {{- printf "%s-oidc" (include "eocatalogue.stac" .) -}} + {{- printf "%s-oidc" (include "eocatalog.stac" .) -}} {{- end -}} {{- end -}} {{/* Get the client secret key for the STAC API OpenID Connect authentication. */}} -{{- define "eocatalogue.stac.clientSecretKey" -}} +{{- define "eocatalog.stac.clientSecretKey" -}} {{- if .Values.stac.oidc.existingSecret.key }} {{- printf "%s" (tpl .Values.stac.oidc.existingSecret.key $) -}} {{- else -}} @@ -261,9 +261,9 @@ Get the client secret key for the STAC API OpenID Connect authentication. {{/* Validate values of EO API - database */}} -{{- define "eocatalogue.validateValues.database" -}} +{{- define "eocatalog.validateValues.database" -}} {{- if and (not .Values.postgresql.enabled) (not .Values.externalDatabase.host) (and (not .Values.externalDatabase.password) (not .Values.externalDatabase.existingSecret)) -}} -eocatalogue: database +eocatalog: database You disabled the PostgreSQL sub-chart but did not specify an external PostgreSQL host. Either deploy the PostgreSQL sub-chart (--set postgresql.enabled=true), or set a value for the external database host (--set externalDatabase.host=FOO) @@ -275,7 +275,7 @@ eocatalogue: database {{/* Validate Redis config */}} -{{- define "eocatalogue.validateValues.redis" -}} +{{- define "eocatalog.validateValues.redis" -}} {{- if and .Values.redis.enabled .Values.redis.auth.existingSecret }} {{- if not .Values.redis.auth.existingSecretPasswordKey -}} EO Catalog: You need to provide existingSecretPasswordKey when an existingSecret is specified in redis dependency @@ -290,7 +290,7 @@ EO Catalog: You need to provide existingSecretPasswordKey when an existingSecret {{/* Validate external Redis config */}} -{{- define "eocatalogue.validateValues.externalRedis" -}} +{{- define "eocatalog.validateValues.externalRedis" -}} {{- if not .Values.redis.enabled -}} EO Catalog: If the redis dependency is disabled you need to add an external redis port {{- end -}} @@ -299,11 +299,11 @@ EO Catalog: If the redis dependency is disabled you need to add an external redi {{/* Compile all warnings into a single message. */}} -{{- define "eocatalogue.validateValues" -}} +{{- define "eocatalog.validateValues" -}} {{- $messages := list -}} -{{- $messages := append $messages (include "eocatalogue.validateValues.database" .) -}} -{{- $messages := append $messages (include "eocatalogue.validateValues.externalRedis" .) -}} -{{- $messages := append $messages (include "eocatalogue.validateValues.redis" .) -}} +{{- $messages := append $messages (include "eocatalog.validateValues.database" .) -}} +{{- $messages := append $messages (include "eocatalog.validateValues.externalRedis" .) -}} +{{- $messages := append $messages (include "eocatalog.validateValues.redis" .) -}} {{- $messages := without $messages "" -}} {{- $message := join "\n" $messages -}} {{- end -}} diff --git a/deploy/helm/eocatalog/templates/stac/deployment.yaml b/deploy/helm/eocatalog/templates/stac/deployment.yaml index 4e491a0..35d7223 100644 --- a/deploy/helm/eocatalog/templates/stac/deployment.yaml +++ b/deploy/helm/eocatalog/templates/stac/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "eocatalogue.stac" . }} + name: {{ include "eocatalog.stac" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} app.kubernetes.io/component: stac-api @@ -31,8 +31,8 @@ spec: annotations: {{- include "common.tplvalues.render" (dict "value" .Values.stac.podAnnotations "context" $) | nindent 8 }} {{- end }} spec: - serviceAccountName: {{ include "eocatalogue.stac.serviceAccountName" . }} - {{- include "eocatalogue.imagePullSecrets" . | nindent 6 }} + serviceAccountName: {{ include "eocatalog.stac.serviceAccountName" . }} + {{- include "eocatalog.imagePullSecrets" . | nindent 6 }} {{- if .Values.stac.hostAliases }} hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.stac.hostAliases "context" $) | nindent 8 }} {{- end }} @@ -91,7 +91,7 @@ spec: . /opt/bitnami/scripts/libos.sh . /opt/bitnami/scripts/liblog.sh check_redis_connection() { - local result="$(redis-cli -h {{ include "eocatalogue.redisHost" . }} -p {{ include "eocatalogue.redisPort" . }} {{ .Values.stac.redisWait.extraArgs }} PING)" + local result="$(redis-cli -h {{ include "eocatalog.redisHost" . }} -p {{ include "eocatalog.redisPort" . }} {{ .Values.stac.redisWait.extraArgs }} PING)" if [[ "$result" != "PONG" ]]; then false fi @@ -103,13 +103,13 @@ spec: else info "Connected to the Redis instance" fi - {{- if include "eocatalogue.redis.auth.enabled" . }} + {{- if include "eocatalog.redis.auth.enabled" . }} env: - name: REDISCLI_AUTH valueFrom: secretKeyRef: - name: {{ include "eocatalogue.redis.secretName" . }} - key: {{ include "eocatalogue.redis.secretPasswordKey" . }} + name: {{ include "eocatalog.redis.secretName" . }} + key: {{ include "eocatalog.redis.secretPasswordKey" . }} {{- end }} {{- end }} {{- if .Values.stac.initDb }} @@ -130,29 +130,29 @@ spec: - name: PGPASSWORD valueFrom: secretKeyRef: - name: {{ include "eocatalogue.databaseSecretName" . }} - key: {{ include "eocatalogue.databaseSecretPostgresKey" . }} + name: {{ include "eocatalog.databaseSecretName" . }} + key: {{ include "eocatalog.databaseSecretPostgresKey" . }} - name: PGDATABASE - value: {{ include "eocatalogue.databaseName" . }} + value: {{ include "eocatalog.databaseName" . }} - name: PGPORT - value: {{ include "eocatalogue.databasePort" . }} + value: {{ include "eocatalog.databasePort" . }} - name: PGHOST - value: {{ include "eocatalogue.databaseHost" . }} + value: {{ include "eocatalog.databaseHost" . }} - name: POSTGRES_USER value: postgres - name: POSTGRES_PASS valueFrom: secretKeyRef: - name: {{ include "eocatalogue.databaseSecretName" . }} - key: {{ include "eocatalogue.databaseSecretPostgresKey" . }} + name: {{ include "eocatalog.databaseSecretName" . }} + key: {{ include "eocatalog.databaseSecretPostgresKey" . }} - name: POSTGRES_HOST_READER - value: {{ include "eocatalogue.databaseHost" . }} + value: {{ include "eocatalog.databaseHost" . }} - name: POSTGRES_HOST_WRITER - value: {{ include "eocatalogue.databaseHost" . }} + value: {{ include "eocatalog.databaseHost" . }} - name: POSTGRES_PORT - value: {{ include "eocatalogue.databasePort" . }} + value: {{ include "eocatalog.databasePort" . }} - name: POSTGRES_DBNAME - value: {{ include "eocatalogue.databaseName" . }} + value: {{ include "eocatalog.databaseName" . }} {{- end }} containers: - name: stac-api @@ -233,20 +233,20 @@ spec: - name: REQUEST_TIMEOUT value: {{ .Values.stac.requestTimeout | quote }} - name: POSTGRES_USER - value: {{ include "eocatalogue.databaseUser" . }} + value: {{ include "eocatalog.databaseUser" . }} - name: POSTGRES_PASS valueFrom: secretKeyRef: - name: {{ include "eocatalogue.databaseSecretName" . }} - key: {{ include "eocatalogue.databaseSecretKey" . }} + name: {{ include "eocatalog.databaseSecretName" . }} + key: {{ include "eocatalog.databaseSecretKey" . }} - name: POSTGRES_HOST_READER - value: {{ include "eocatalogue.databaseHost" . }} + value: {{ include "eocatalog.databaseHost" . }} - name: POSTGRES_HOST_WRITER - value: {{ include "eocatalogue.databaseHostWriter" . }} + value: {{ include "eocatalog.databaseHostWriter" . }} - name: POSTGRES_PORT - value: {{ include "eocatalogue.databasePort" . }} + value: {{ include "eocatalog.databasePort" . }} - name: POSTGRES_DBNAME - value: {{ include "eocatalogue.databaseName" . }} + value: {{ include "eocatalog.databaseName" . }} - name: DB_MIN_CONN_SIZE value: {{ .Values.stac.dbConnectionSize.min | quote }} - name: DB_MAX_CONN_SIZE @@ -256,16 +256,16 @@ spec: - name: REDIS_CLUSTER value: {{ .Values.stac.redisCluster | quote }} - name: REDIS_HOSTNAME - value: {{ include "eocatalogue.redisHost" . }} + value: {{ include "eocatalog.redisHost" . }} - name: REDIS_PASSWORD valueFrom: secretKeyRef: - name: {{ include "eocatalogue.redis.secretName" . }} - key: {{ include "eocatalogue.redis.secretPasswordKey" . }} + name: {{ include "eocatalog.redis.secretName" . }} + key: {{ include "eocatalog.redis.secretPasswordKey" . }} - name: REDIS_PORT - value: {{ include "eocatalogue.redisPort" . | quote }} + value: {{ include "eocatalog.redisPort" . | quote }} - name: REDIS_SSL - value: {{ include "eocatalogue.redis.tlsEnabled" . }} + value: {{ include "eocatalog.redis.tlsEnabled" . }} - name: REDIS_TTL value: {{ .Values.stac.redisTTL | quote }} - name: OTEL_ENABLED diff --git a/deploy/helm/eocatalog/templates/stac/hpa.yaml b/deploy/helm/eocatalog/templates/stac/hpa.yaml index 0c7f48d..899d09b 100644 --- a/deploy/helm/eocatalog/templates/stac/hpa.yaml +++ b/deploy/helm/eocatalog/templates/stac/hpa.yaml @@ -5,7 +5,7 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "eocatalogue.stac" . }} + name: {{ include "eocatalog.stac" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} @@ -18,7 +18,7 @@ spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "eocatalogue.stac" . }} + name: {{ include "eocatalog.stac" . }} minReplicas: {{ .Values.stac.replicaCount }} maxReplicas: {{ .Values.stac.horizontalPodAutoscaler.maxReplicas }} metrics: diff --git a/deploy/helm/eocatalog/templates/stac/ingress.yaml b/deploy/helm/eocatalog/templates/stac/ingress.yaml index 11dd2ea..79147ce 100644 --- a/deploy/helm/eocatalog/templates/stac/ingress.yaml +++ b/deploy/helm/eocatalog/templates/stac/ingress.yaml @@ -2,7 +2,7 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} kind: Ingress metadata: - name: {{ include "eocatalogue.stac" . }} + name: {{ include "eocatalog.stac" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} app.kubernetes.io/component: stac-api @@ -34,7 +34,7 @@ spec: {{- if eq "true" (include "common.ingress.supportsPathType" .) }} pathType: {{ .Values.stac.ingress.pathType }} {{- end }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (include "eocatalogue.stac" .) "servicePort" "http" "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "eocatalog.stac" .) "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- range .Values.stac.ingress.extraHosts }} - host: {{ .name | quote }} @@ -44,7 +44,7 @@ spec: {{- if eq "true" (include "common.ingress.supportsPathType" $) }} pathType: {{ default "ImplementationSpecific" .pathType }} {{- end }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (include "eocatalogue.stac" $) "servicePort" "http" "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "eocatalog.stac" $) "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- if .Values.stac.ingress.extraRules }} {{- include "common.tplvalues.render" (dict "value" .Values.stac.ingress.extraRules "context" $) | nindent 4 }} diff --git a/deploy/helm/eocatalog/templates/stac/service.yaml b/deploy/helm/eocatalog/templates/stac/service.yaml index 9f123a4..4187ae9 100644 --- a/deploy/helm/eocatalog/templates/stac/service.yaml +++ b/deploy/helm/eocatalog/templates/stac/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "eocatalogue.stac" . }} + name: {{ include "eocatalog.stac" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} app.kubernetes.io/component: stac-api diff --git a/deploy/helm/eocatalog/templates/stac/serviceaccount.yaml b/deploy/helm/eocatalog/templates/stac/serviceaccount.yaml index aa8a8bf..c5d0380 100644 --- a/deploy/helm/eocatalog/templates/stac/serviceaccount.yaml +++ b/deploy/helm/eocatalog/templates/stac/serviceaccount.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount automountServiceAccountToken: {{ .Values.stac.serviceAccount.automountServiceAccountToken }} metadata: - name: {{ include "eocatalogue.stac.serviceAccountName" . }} + name: {{ include "eocatalog.stac.serviceAccountName" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} app.kubernetes.io/component: stac-api diff --git a/deploy/helm/eocatalog/values.yaml b/deploy/helm/eocatalog/values.yaml index 364f98c..cfcd5cb 100644 --- a/deploy/helm/eocatalog/values.yaml +++ b/deploy/helm/eocatalog/values.yaml @@ -618,7 +618,7 @@ postgresql: enabled: true auth: postgresPassword: "" - username: eo-catalogue + username: eo-catalog password: "" database: postgis existingSecret: "" @@ -692,7 +692,7 @@ externalDatabase: host: "" hostWriter: "" port: 5432 - user: eo-catalogue + user: eo-catalog database: postgis password: "" postgresPassword: "" diff --git a/docs/static/eo-catalogue-logo-1080.webp b/docs/static/eo-catalog-logo-1080.webp similarity index 100% rename from docs/static/eo-catalogue-logo-1080.webp rename to docs/static/eo-catalog-logo-1080.webp From 964fe794b7b3417df8d3d7874ecf076013c01c43 Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Tue, 4 Mar 2025 15:15:40 +0100 Subject: [PATCH 04/14] chore: bump helm chart version --- .gitignore | 1 + deploy/helm/eocatalog/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8a7afc1..67fcc22 100644 --- a/.gitignore +++ b/.gitignore @@ -176,3 +176,4 @@ node_modules/ # helm charts **/charts/ **/Chart.lock +*.tgz diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index 6fefeda..21db3aa 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -20,4 +20,4 @@ name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog type: application -version: 0.10.0 +version: 0.11.0 From e9e85fc44f6710fa996faad4d5fb6ca7a1af4dae Mon Sep 17 00:00:00 2001 From: Benjamin Date: Wed, 5 Mar 2025 12:48:51 +0100 Subject: [PATCH 05/14] fix(deploy): remove hard coded user --- deploy/helm/eocatalog/Chart.yaml | 2 +- deploy/helm/eocatalog/templates/stac/deployment.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index 21db3aa..bcc828a 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -20,4 +20,4 @@ name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog type: application -version: 0.11.0 +version: 0.2.0 diff --git a/deploy/helm/eocatalog/templates/stac/deployment.yaml b/deploy/helm/eocatalog/templates/stac/deployment.yaml index 35d7223..8ca1b0f 100644 --- a/deploy/helm/eocatalog/templates/stac/deployment.yaml +++ b/deploy/helm/eocatalog/templates/stac/deployment.yaml @@ -122,7 +122,6 @@ spec: - | set -xe pypgstac pgready && pypgstac migrate - psql -U postgres -c 'GRANT pgstac_admin to "eo-catalogue";' psql -U postgres -c 'ALTER DATABASE postgis SET search_path TO pgstac, public;' env: - name: PGUSER From 93d5347f0c7d13d6c24d3bade7f0ce7256c0e50b Mon Sep 17 00:00:00 2001 From: Benjamin Date: Wed, 5 Mar 2025 17:34:54 +0100 Subject: [PATCH 06/14] fix(initDb): update db host writer template --- deploy/helm/eocatalog/Chart.yaml | 2 +- deploy/helm/eocatalog/templates/stac/deployment.yaml | 7 +++++-- dockerfiles/Dockerfile.stac | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index bcc828a..13442c4 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -20,4 +20,4 @@ name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog type: application -version: 0.2.0 +version: 0.2.3 diff --git a/deploy/helm/eocatalog/templates/stac/deployment.yaml b/deploy/helm/eocatalog/templates/stac/deployment.yaml index 8ca1b0f..e1dc6b8 100644 --- a/deploy/helm/eocatalog/templates/stac/deployment.yaml +++ b/deploy/helm/eocatalog/templates/stac/deployment.yaml @@ -122,7 +122,8 @@ spec: - | set -xe pypgstac pgready && pypgstac migrate - psql -U postgres -c 'ALTER DATABASE postgis SET search_path TO pgstac, public;' + psql -U postgres -c "GRANT pgstac_admin to \"${POSTGRES_DBUSER}\";" + psql -U postgres -c "ALTER DATABASE \"${POSTGRES_DBNAME}\" SET search_path TO pgstac, public;" env: - name: PGUSER value: postgres @@ -147,11 +148,13 @@ spec: - name: POSTGRES_HOST_READER value: {{ include "eocatalog.databaseHost" . }} - name: POSTGRES_HOST_WRITER - value: {{ include "eocatalog.databaseHost" . }} + value: {{ include "eocatalog.databaseHostWriter" . }} - name: POSTGRES_PORT value: {{ include "eocatalog.databasePort" . }} - name: POSTGRES_DBNAME value: {{ include "eocatalog.databaseName" . }} + - name: POSTGRES_DBUSER + value: {{ include "eocatalog.databaseUser" . }} {{- end }} containers: - name: stac-api diff --git a/dockerfiles/Dockerfile.stac b/dockerfiles/Dockerfile.stac index 17a1195..265bb75 100644 --- a/dockerfiles/Dockerfile.stac +++ b/dockerfiles/Dockerfile.stac @@ -4,7 +4,7 @@ FROM python:${PYTHON_VERSION}-slim ENV CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt -RUN apt update && apt install git -y +RUN apt update && apt install git postgresql-client -y COPY runtimes/eoapi/stac /tmp/stac RUN python -m pip install /tmp/stac[server,telemetry,redis] pypgstac[psycopg] From 753f1a3229175a07f1d0176cd8952f8900cdbb16 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Mon, 17 Mar 2025 17:39:33 +0100 Subject: [PATCH 07/14] fix(deploy): add pgpassword to initdb commands --- deploy/helm/eocatalog/Chart.yaml | 2 +- deploy/helm/eocatalog/dedl-values.yaml | 71 +++++++++++++++++++ .../eocatalog/templates/stac/deployment.yaml | 6 +- 3 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 deploy/helm/eocatalog/dedl-values.yaml diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index 13442c4..2c277d2 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -20,4 +20,4 @@ name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog type: application -version: 0.2.3 +version: 0.2.4 diff --git a/deploy/helm/eocatalog/dedl-values.yaml b/deploy/helm/eocatalog/dedl-values.yaml new file mode 100644 index 0000000..b5bba18 --- /dev/null +++ b/deploy/helm/eocatalog/dedl-values.yaml @@ -0,0 +1,71 @@ +global: + imagePullSecrets: + - space-applications-registry + - dedl-registry + - cs-gitlab-registry + +stac: + debug: true + api: + description: Searchable spatiotemporal catalog describing datasets hosted by the Destination Earth Data Lake + landingPageId: dedl-stac + title: DEDL STAC API + + initDb: true + redisWait: + enabled: false + redisCluster: true + redisTTL: 600 + tableValueTTL: 600 + rateLimit: + collections: 2000 + backPressure: + collections: + reqPerSec: 1000 + incMs: 10 + + image: + registry: registry.gitlab.si.c-s.fr + repository: dedl/argo-cd/eo-catalog + tag: 0.2.0 + digest: "" + pullPolicy: Always + + ingress: + enabled: true + ingressClassName: nginx + hostname: eo-catalog.dedl.csgroup.space + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + tls: true + + livenessProbe: + enabled: false + initialDelaySeconds: 30 + readinessProbe: + enabled: false + + replicaCount: 1 + resources: + requests: + cpu: 100m + memory: 200Mi + ephemeral-storage: 50Mi + +postgresql: + enabled: false + +externalDatabase: + host: cnpg-postgis-ro + hostWriter: cnpg-postgis-rw + existingSecret: cnpg-postgis-credentials + existingSecretPasswordKey: password + existingSecretPostgresPasswordKey: postgres-password + user: eo-catalog + +redis: + enabled: false +externalRedis: + host: redis-cluster + existingSecret: redis-cluster + existingSecretPasswordKey: redis-password diff --git a/deploy/helm/eocatalog/templates/stac/deployment.yaml b/deploy/helm/eocatalog/templates/stac/deployment.yaml index e1dc6b8..b94294d 100644 --- a/deploy/helm/eocatalog/templates/stac/deployment.yaml +++ b/deploy/helm/eocatalog/templates/stac/deployment.yaml @@ -121,9 +121,9 @@ spec: - -c - | set -xe - pypgstac pgready && pypgstac migrate - psql -U postgres -c "GRANT pgstac_admin to \"${POSTGRES_DBUSER}\";" - psql -U postgres -c "ALTER DATABASE \"${POSTGRES_DBNAME}\" SET search_path TO pgstac, public;" + PGPASSWORD='${PGPASSWORD}' pypgstac pgready && PGPASSWORD='${PGPASSWORD}' pypgstac migrate + PGPASSWORD='${PGPASSWORD}' psql -U postgres -c "GRANT pgstac_admin to \"${POSTGRES_DBUSER}\";" + PGPASSWORD='${PGPASSWORD}' psql -U postgres -c "ALTER DATABASE \"${POSTGRES_DBNAME}\" SET search_path TO pgstac, public;" env: - name: PGUSER value: postgres From fb2ddd23271ce1d5380d51c55f088dcbb6c6aed9 Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Tue, 18 Mar 2025 16:03:47 +0100 Subject: [PATCH 08/14] feat(deploy): add postgre automount token --- deploy/helm/eocatalog/templates/stac/deployment.yaml | 6 +++--- deploy/helm/eocatalog/values.yaml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deploy/helm/eocatalog/templates/stac/deployment.yaml b/deploy/helm/eocatalog/templates/stac/deployment.yaml index b94294d..7e08a54 100644 --- a/deploy/helm/eocatalog/templates/stac/deployment.yaml +++ b/deploy/helm/eocatalog/templates/stac/deployment.yaml @@ -121,9 +121,9 @@ spec: - -c - | set -xe - PGPASSWORD='${PGPASSWORD}' pypgstac pgready && PGPASSWORD='${PGPASSWORD}' pypgstac migrate - PGPASSWORD='${PGPASSWORD}' psql -U postgres -c "GRANT pgstac_admin to \"${POSTGRES_DBUSER}\";" - PGPASSWORD='${PGPASSWORD}' psql -U postgres -c "ALTER DATABASE \"${POSTGRES_DBNAME}\" SET search_path TO pgstac, public;" + PGPASSWORD=${PGPASSWORD} pypgstac pgready && PGPASSWORD=${PGPASSWORD} pypgstac migrate + PGPASSWORD=${PGPASSWORD} psql -U postgres -c "GRANT pgstac_admin to \"${POSTGRES_DBUSER}\";" + PGPASSWORD=${PGPASSWORD} psql -U postgres -c "ALTER DATABASE \"${POSTGRES_DBNAME}\" SET search_path TO pgstac, public;" env: - name: PGUSER value: postgres diff --git a/deploy/helm/eocatalog/values.yaml b/deploy/helm/eocatalog/values.yaml index cfcd5cb..eae651c 100644 --- a/deploy/helm/eocatalog/values.yaml +++ b/deploy/helm/eocatalog/values.yaml @@ -624,6 +624,7 @@ postgresql: existingSecret: "" architecture: standalone primary: + automountServiceAccountToken: true initdb: scripts: init.sql: | From 2080f4dabed902b7680c79303f44f55ea95fe0b9 Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Tue, 20 May 2025 11:22:16 +0200 Subject: [PATCH 09/14] chore(helm): update psql dependency version --- deploy/helm/eocatalog/Chart.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index 2c277d2..d316a7e 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -1,9 +1,10 @@ apiVersion: v2 +type: application dependencies: - condition: postgresql.enabled name: postgresql repository: oci://registry-1.docker.io/bitnamicharts - version: 15.x.x + version: 16.7.4 - condition: redis.enabled name: redis repository: oci://registry-1.docker.io/bitnamicharts @@ -19,5 +20,4 @@ icon: https://github.com/csgroup-oss/eo-catalog/-/blob/main/docs/static/eo-catal name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog -type: application -version: 0.2.4 +version: 0.3.0 From 794e71c417f10b1477bdb442ee6fc6815b8df6ab Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Tue, 20 May 2025 15:25:39 +0200 Subject: [PATCH 10/14] chore(deploy): add free text search init script --- deploy/helm/eocatalog/Chart.yaml | 2 +- deploy/helm/eocatalog/templates/stac/deployment.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index d316a7e..f604866 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -20,4 +20,4 @@ icon: https://github.com/csgroup-oss/eo-catalog/-/blob/main/docs/static/eo-catal name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog -version: 0.3.0 +version: 0.3.1 diff --git a/deploy/helm/eocatalog/templates/stac/deployment.yaml b/deploy/helm/eocatalog/templates/stac/deployment.yaml index 7e08a54..8df444f 100644 --- a/deploy/helm/eocatalog/templates/stac/deployment.yaml +++ b/deploy/helm/eocatalog/templates/stac/deployment.yaml @@ -124,6 +124,7 @@ spec: PGPASSWORD=${PGPASSWORD} pypgstac pgready && PGPASSWORD=${PGPASSWORD} pypgstac migrate PGPASSWORD=${PGPASSWORD} psql -U postgres -c "GRANT pgstac_admin to \"${POSTGRES_DBUSER}\";" PGPASSWORD=${PGPASSWORD} psql -U postgres -c "ALTER DATABASE \"${POSTGRES_DBNAME}\" SET search_path TO pgstac, public;" + PGPASSWORD=${PGPASSWORD} psql -U postgres -c "ALTER DATABASE \"${POSTGRES_DBNAME}\" SET default_text_search_config TO english;" env: - name: PGUSER value: postgres From 74f04728ddcc09cb7b56d1c826524f7b2b04829b Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Thu, 22 May 2025 09:58:21 +0200 Subject: [PATCH 11/14] fix(charts): remove deprecated common dependencies --- deploy/helm/eocatalog/Chart.yaml | 2 +- deploy/helm/eocatalog/dedl-values.yaml | 71 ------------------- .../eocatalog/templates/stac/ingress.yaml | 25 ++----- 3 files changed, 8 insertions(+), 90 deletions(-) delete mode 100644 deploy/helm/eocatalog/dedl-values.yaml diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index f604866..b9948ba 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -20,4 +20,4 @@ icon: https://github.com/csgroup-oss/eo-catalog/-/blob/main/docs/static/eo-catal name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog -version: 0.3.1 +version: 0.3.3 diff --git a/deploy/helm/eocatalog/dedl-values.yaml b/deploy/helm/eocatalog/dedl-values.yaml deleted file mode 100644 index b5bba18..0000000 --- a/deploy/helm/eocatalog/dedl-values.yaml +++ /dev/null @@ -1,71 +0,0 @@ -global: - imagePullSecrets: - - space-applications-registry - - dedl-registry - - cs-gitlab-registry - -stac: - debug: true - api: - description: Searchable spatiotemporal catalog describing datasets hosted by the Destination Earth Data Lake - landingPageId: dedl-stac - title: DEDL STAC API - - initDb: true - redisWait: - enabled: false - redisCluster: true - redisTTL: 600 - tableValueTTL: 600 - rateLimit: - collections: 2000 - backPressure: - collections: - reqPerSec: 1000 - incMs: 10 - - image: - registry: registry.gitlab.si.c-s.fr - repository: dedl/argo-cd/eo-catalog - tag: 0.2.0 - digest: "" - pullPolicy: Always - - ingress: - enabled: true - ingressClassName: nginx - hostname: eo-catalog.dedl.csgroup.space - annotations: - cert-manager.io/cluster-issuer: letsencrypt-prod - tls: true - - livenessProbe: - enabled: false - initialDelaySeconds: 30 - readinessProbe: - enabled: false - - replicaCount: 1 - resources: - requests: - cpu: 100m - memory: 200Mi - ephemeral-storage: 50Mi - -postgresql: - enabled: false - -externalDatabase: - host: cnpg-postgis-ro - hostWriter: cnpg-postgis-rw - existingSecret: cnpg-postgis-credentials - existingSecretPasswordKey: password - existingSecretPostgresPasswordKey: postgres-password - user: eo-catalog - -redis: - enabled: false -externalRedis: - host: redis-cluster - existingSecret: redis-cluster - existingSecretPasswordKey: redis-password diff --git a/deploy/helm/eocatalog/templates/stac/ingress.yaml b/deploy/helm/eocatalog/templates/stac/ingress.yaml index 79147ce..27cefc2 100644 --- a/deploy/helm/eocatalog/templates/stac/ingress.yaml +++ b/deploy/helm/eocatalog/templates/stac/ingress.yaml @@ -4,22 +4,15 @@ kind: Ingress metadata: name: {{ include "eocatalog.stac" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: stac-api - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} - {{- end }} - {{- if or .Values.stac.ingress.annotations .Values.commonAnnotations }} annotations: - {{- if .Values.stac.ingress.annotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.stac.ingress.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- if or .Values.stac.ingress.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.stac.ingress.annotations .Values.commonAnnotations ) "context" . ) }} + {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} - {{- end }} spec: - {{- if and .Values.stac.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }} + {{- if .Values.stac.ingress.ingressClassName }} ingressClassName: {{ .Values.stac.ingress.ingressClassName | quote }} {{- end }} rules: @@ -31,19 +24,15 @@ spec: {{- toYaml .Values.stac.ingress.extraPaths | nindent 10 }} {{- end }} - path: {{ .Values.stac.ingress.path }} - {{- if eq "true" (include "common.ingress.supportsPathType" .) }} pathType: {{ .Values.stac.ingress.pathType }} - {{- end }} backend: {{- include "common.ingress.backend" (dict "serviceName" (include "eocatalog.stac" .) "servicePort" "http" "context" $) | nindent 14 }} - {{- end }} + {{- end }} {{- range .Values.stac.ingress.extraHosts }} - host: {{ .name | quote }} http: paths: - path: {{ default "/" .path }} - {{- if eq "true" (include "common.ingress.supportsPathType" $) }} pathType: {{ default "ImplementationSpecific" .pathType }} - {{- end }} backend: {{- include "common.ingress.backend" (dict "serviceName" (include "eocatalog.stac" $) "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- if .Values.stac.ingress.extraRules }} @@ -60,4 +49,4 @@ spec: {{- include "common.tplvalues.render" (dict "value" .Values.stac.ingress.extraTls "context" $) | nindent 4 }} {{- end }} {{- end }} -{{- end -}} +{{- end }} \ No newline at end of file From c9ddeabb2aae262100b431fefde9b1cabbe1221f Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Thu, 22 May 2025 15:54:56 +0200 Subject: [PATCH 12/14] chore(deploy): add extraDeploy feature --- deploy/helm/eocatalog/Chart.yaml | 2 +- deploy/helm/eocatalog/templates/stac/extra-list.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 deploy/helm/eocatalog/templates/stac/extra-list.yaml diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index b9948ba..875e273 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -20,4 +20,4 @@ icon: https://github.com/csgroup-oss/eo-catalog/-/blob/main/docs/static/eo-catal name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog -version: 0.3.3 +version: 0.3.4 diff --git a/deploy/helm/eocatalog/templates/stac/extra-list.yaml b/deploy/helm/eocatalog/templates/stac/extra-list.yaml new file mode 100644 index 0000000..9ac65f9 --- /dev/null +++ b/deploy/helm/eocatalog/templates/stac/extra-list.yaml @@ -0,0 +1,4 @@ +{{- range .Values.extraDeploy }} +--- +{{ include "common.tplvalues.render" (dict "value" . "context" $) }} +{{- end }} From 17b570ea8c9d8eb425231fa2d54a5d405705463b Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Wed, 2 Jul 2025 14:48:46 +0200 Subject: [PATCH 13/14] fix(cache): add key prefix to avoid collisions --- runtimes/eoapi/stac/eoapi/stac/config.py | 2 ++ runtimes/eoapi/stac/eoapi/stac/redis.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/runtimes/eoapi/stac/eoapi/stac/config.py b/runtimes/eoapi/stac/eoapi/stac/config.py index 39fde4b..23c1434 100644 --- a/runtimes/eoapi/stac/eoapi/stac/config.py +++ b/runtimes/eoapi/stac/eoapi/stac/config.py @@ -26,6 +26,8 @@ class Settings(BaseSettings): redis_port: int = 6379 redis_ssl: bool = True + stac_fastapi_landing_id: str = "eo-catalog-stac" + eoapi_auth_metadata_field: str = "scope" eoapi_auth_update_scope: str = "admin" diff --git a/runtimes/eoapi/stac/eoapi/stac/redis.py b/runtimes/eoapi/stac/eoapi/stac/redis.py index b2df3ed..878aadf 100644 --- a/runtimes/eoapi/stac/eoapi/stac/redis.py +++ b/runtimes/eoapi/stac/eoapi/stac/redis.py @@ -82,6 +82,9 @@ async def cached_result( settings: Settings = request.app.state.settings r: Redis + # Add a prefix to the cache key to avoid collisions between different instances + cache_key = f"{settings.stac_fastapi_landing_id}:{cache_key}" + # GET key from cache try: r = request.app.state.redis From b26cb37c9c4c8a97c116fdfa06d4ac40a764311b Mon Sep 17 00:00:00 2001 From: GIRAUDON Benjamin Date: Wed, 2 Jul 2025 14:53:14 +0200 Subject: [PATCH 14/14] chore(deploy): bump appVersion --- deploy/helm/eocatalog/Chart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/helm/eocatalog/Chart.yaml b/deploy/helm/eocatalog/Chart.yaml index 875e273..fc027b4 100644 --- a/deploy/helm/eocatalog/Chart.yaml +++ b/deploy/helm/eocatalog/Chart.yaml @@ -21,3 +21,4 @@ name: eo-catalog sources: - https://github.com/csgroup-oss/eo-catalog version: 0.3.4 +appVersion: 0.2.2