Skip to content

Commit 8528eba

Browse files
committed
feat: add Knative integration for notifications
- Add CloudEvents sink deployment for eoapi-notifier integration - Configure dynamic secret name for PostgreSQL connection - Add local development configuration with reduced resources - Support both CI and local test environments
1 parent 35a6adb commit 8528eba

File tree

3 files changed

+140
-1
lines changed

3 files changed

+140
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- Added knative in CI to test eoapi-notifier.
11+
1012
## [0.7.12] - 2025-10-17
1113

1214
- Bumped eoapi-notifier dependency version to 0.0.7
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Local test configuration for minikube/local development
2+
# Based on test-k3s-unittest-values.yaml with minimal changes for local environment
3+
4+
testing: true
5+
ingress:
6+
enabled: true
7+
className: "nginx" # Changed from "traefik" for minikube
8+
pathType: "Prefix"
9+
host: "eoapi.local"
10+
11+
pgstacBootstrap:
12+
enabled: true
13+
settings:
14+
resources:
15+
requests:
16+
cpu: "256m"
17+
memory: "1024Mi"
18+
limits:
19+
cpu: "512m"
20+
memory: "1024Mi"
21+
22+
raster:
23+
enabled: true
24+
settings:
25+
resources:
26+
limits:
27+
cpu: "768m"
28+
memory: "2048Mi" # Reduced from 4096Mi for local
29+
requests:
30+
cpu: "256m"
31+
memory: "1024Mi"
32+
33+
stac:
34+
enabled: true
35+
settings:
36+
resources:
37+
limits:
38+
cpu: "1280m"
39+
memory: "1536Mi"
40+
requests:
41+
cpu: "512m"
42+
memory: "1024Mi"
43+
44+
vector:
45+
enabled: true
46+
settings:
47+
resources:
48+
limits:
49+
cpu: "768m"
50+
memory: "1536Mi"
51+
requests:
52+
cpu: "256m"
53+
memory: "1024Mi"
54+
envVars:
55+
TIPG_DEBUG: "True"
56+
57+
eoapi-notifier:
58+
enabled: true
59+
config:
60+
logLevel: DEBUG
61+
sources:
62+
- type: pgstac
63+
config:
64+
channel: pgstac_items_change
65+
connection:
66+
existingSecret:
67+
name: "" # Set dynamically by deploy script
68+
keys:
69+
username: "user"
70+
password: "password"
71+
host: "host"
72+
port: "port"
73+
database: "dbname"
74+
outputs:
75+
- type: cloudevents
76+
config:
77+
source: /eoapi/pgstac
78+
event_type: org.eoapi.stac.item
79+
destination:
80+
ref:
81+
apiVersion: serving.knative.dev/v1
82+
kind: Service
83+
name: eoapi-cloudevents-sink
84+
resources:
85+
requests:
86+
cpu: "50m"
87+
memory: "64Mi"
88+
limits:
89+
cpu: "200m"
90+
memory: "128Mi"
91+
92+
# Reduce PostgreSQL resources for local development
93+
postgrescluster:
94+
instances:
95+
- name: "postgres"
96+
replicas: 1
97+
dataVolumeClaimSpec:
98+
accessModes:
99+
- "ReadWriteOnce"
100+
resources:
101+
requests:
102+
storage: "1Gi" # Reduced for local
103+
resources:
104+
requests:
105+
cpu: "100m" # Reduced for local
106+
memory: "512Mi" # Reduced for local
107+
limits:
108+
cpu: "500m" # Reduced for local
109+
memory: "1Gi" # Reduced for local

scripts/deploy.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,17 @@ deploy_eoapi() {
140140
HELM_CMD="$HELM_CMD -f ./eoapi/values.yaml"
141141
fi
142142

143-
# CI-specific configuration
143+
# Environment-specific configuration
144144
if [ "$CI_MODE" = true ] && [ -f "./eoapi/test-k3s-unittest-values.yaml" ]; then
145145
log_info "Using CI test configuration..."
146146
HELM_CMD="$HELM_CMD -f ./eoapi/test-k3s-unittest-values.yaml"
147+
# Fix eoapi-notifier secret name dynamically
148+
HELM_CMD="$HELM_CMD --set eoapi-notifier.config.sources[0].config.connection.existingSecret.name=$RELEASE_NAME-pguser-eoapi"
149+
elif [ -f "./eoapi/test-local-values.yaml" ]; then
150+
log_info "Using local test configuration..."
151+
HELM_CMD="$HELM_CMD -f ./eoapi/test-local-values.yaml"
152+
# Fix eoapi-notifier secret name dynamically for local mode too
153+
HELM_CMD="$HELM_CMD --set eoapi-notifier.config.sources[0].config.connection.existingSecret.name=$RELEASE_NAME-pguser-eoapi"
147154
fi
148155

149156
# Set git SHA if available
@@ -160,6 +167,27 @@ deploy_eoapi() {
160167

161168
cd .. || exit
162169

170+
# Wait for pgstac jobs to complete first
171+
if kubectl get job -n "$NAMESPACE" -l "app=$RELEASE_NAME-pgstac-migrate" >/dev/null 2>&1; then
172+
log_info "Waiting for pgstac-migrate job to complete..."
173+
if ! kubectl wait --for=condition=complete job -l "app=$RELEASE_NAME-pgstac-migrate" -n "$NAMESPACE" --timeout=600s; then
174+
log_error "pgstac-migrate job failed to complete"
175+
kubectl describe job -l "app=$RELEASE_NAME-pgstac-migrate" -n "$NAMESPACE"
176+
kubectl logs -l "app=$RELEASE_NAME-pgstac-migrate" -n "$NAMESPACE" --tail=50 || true
177+
exit 1
178+
fi
179+
fi
180+
181+
if kubectl get job -n "$NAMESPACE" -l "app=$RELEASE_NAME-pgstac-load-samples" >/dev/null 2>&1; then
182+
log_info "Waiting for pgstac-load-samples job to complete..."
183+
if ! kubectl wait --for=condition=complete job -l "app=$RELEASE_NAME-pgstac-load-samples" -n "$NAMESPACE" --timeout=600s; then
184+
log_error "pgstac-load-samples job failed to complete"
185+
kubectl describe job -l "app=$RELEASE_NAME-pgstac-load-samples" -n "$NAMESPACE"
186+
kubectl logs -l "app=$RELEASE_NAME-pgstac-load-samples" -n "$NAMESPACE" --tail=50 || true
187+
exit 1
188+
fi
189+
fi
190+
163191
# Verify deployment
164192
log_info "Verifying deployment..."
165193
kubectl get pods -n "$NAMESPACE" -o wide

0 commit comments

Comments
 (0)