Skip to content

Commit aa410e6

Browse files
committed
feat: add Knative integration for CloudEvents notifications
- Add knative-operator dependency and minimal configuration - Create CloudEvents sink, SinkBinding, and initialization job - Add minimal RBAC permissions for Knative resources - Update eoapi-notifier to 0.0.9 for Knative compatibility - Include test values file for Knative integration testing This minimal implementation introduces Knative functionality without extensive CI/deployment script changes.
1 parent 6e471e4 commit aa410e6

File tree

11 files changed

+568
-2
lines changed

11 files changed

+568
-2
lines changed

.github/workflows/helm-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ jobs:
4949

5050
- name: Deploy eoAPI
5151
id: deploy
52-
continue-on-error: true
5352
run: |
5453
echo "=== Starting eoAPI deployment ==="
5554
export RELEASE_NAME="$RELEASE_NAME"

CHANGELOG.md

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

1010
### Added
11+
- Added Knative integration for CloudEvents notifications
1112
- Added local testing with k3s and minikube
1213
- Base local development values file (`local-base-values.yaml`)
1314
- Unified local cluster management with `CLUSTER_TYPE` variable

charts/eoapi/Chart.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ dependencies:
5454
repository: "https://devseed.com/eoapi-k8s/"
5555
condition: postgrescluster.enabled
5656
- name: eoapi-notifier
57-
version: 0.0.8
57+
version: 0.0.9
5858
repository: "oci://ghcr.io/developmentseed/charts"
5959
condition: eoapi-notifier.enabled
60+
- name: knative-operator
61+
version: 1.17.8
62+
repository: https://knative.github.io/operator
63+
condition: knative.enabled

charts/eoapi/local-base-values.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,35 @@ ingress:
9595
host: "localhost"
9696
tls:
9797
enabled: false # Simplify for local development
98+
99+
eoapi-notifier:
100+
enabled: true
101+
serviceAccount:
102+
create: false
103+
name: ""
104+
sources:
105+
- type: pgstac
106+
config:
107+
connection:
108+
existingSecret:
109+
name: "eoapi-db-pguser-pgstac"
110+
keys:
111+
username: "user"
112+
password: "password"
113+
host: "host"
114+
port: "port"
115+
database: "dbname"
116+
outputs:
117+
- type: cloudevents
118+
config:
119+
source: "/eoapi/pgstac"
120+
event_type: "org.eoapi.stac.item"
121+
122+
knative:
123+
enabled: true
124+
version: "1.17"
125+
cloudEventsSink:
126+
enabled: true
127+
128+
knative-operator:
129+
tag: "v1.17.8"

charts/eoapi/local-k3s-values.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,65 @@ ingress:
77
className: "traefik"
88
annotations:
99
traefik.ingress.kubernetes.io/router.entrypoints: web
10+
11+
# Knative components for CloudEvents
12+
knative:
13+
enabled: true
14+
cloudEventsSink:
15+
enabled: true
16+
17+
# eoapi-notifier configuration with CloudEvents output
18+
eoapi-notifier:
19+
enabled: true
20+
waitForKnativeCRDs: false
21+
config:
22+
logLevel: DEBUG
23+
sources:
24+
- type: pgstac
25+
config:
26+
channel: pgstac_items_change
27+
connection:
28+
existingSecret:
29+
name: "" # Set dynamically by deploy script
30+
keys:
31+
username: "user"
32+
password: "password"
33+
host: "host"
34+
port: "port"
35+
database: "dbname"
36+
outputs:
37+
- type: cloudevents
38+
config:
39+
source: /eoapi/pgstac
40+
event_type: org.eoapi.stac.item
41+
destination:
42+
ref:
43+
apiVersion: serving.knative.dev/v1
44+
kind: Service
45+
name: eoapi-cloudevents-sink
46+
resources:
47+
requests:
48+
cpu: "50m"
49+
memory: "64Mi"
50+
limits:
51+
cpu: "200m"
52+
memory: "128Mi"
53+
54+
# Reduce PostgreSQL resources for local development
55+
postgrescluster:
56+
instances:
57+
- name: "postgres"
58+
replicas: 1
59+
dataVolumeClaimSpec:
60+
accessModes:
61+
- "ReadWriteOnce"
62+
resources:
63+
requests:
64+
storage: "1Gi"
65+
resources:
66+
requests:
67+
cpu: "100m"
68+
memory: "512Mi"
69+
limits:
70+
cpu: "500m"
71+
memory: "1Gi"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{{- $hasCloudEventsOutput := false }}
2+
{{- range (index .Values "eoapi-notifier").outputs }}
3+
{{- if eq .type "cloudevents" }}
4+
{{- $hasCloudEventsOutput = true }}
5+
{{- end }}
6+
{{- end }}
7+
{{- if and (index .Values "eoapi-notifier").enabled .Values.knative.enabled .Values.knative.cloudEventsSink.enabled $hasCloudEventsOutput }}
8+
---
9+
apiVersion: serving.knative.dev/v1
10+
kind: Service
11+
metadata:
12+
name: eoapi-cloudevents-sink
13+
namespace: {{ .Release.Namespace }}
14+
labels:
15+
{{- include "eoapi.labels" . | nindent 4 }}
16+
app.kubernetes.io/component: cloudevents-sink
17+
annotations:
18+
helm.sh/hook: "post-install,post-upgrade"
19+
helm.sh/hook-weight: "10"
20+
helm.sh/hook-delete-policy: "before-hook-creation"
21+
spec:
22+
template:
23+
metadata:
24+
annotations:
25+
autoscaling.knative.dev/minScale: "1"
26+
autoscaling.knative.dev/maxScale: "1"
27+
labels:
28+
{{- include "eoapi.selectorLabels" . | nindent 8 }}
29+
app.kubernetes.io/component: cloudevents-sink
30+
spec:
31+
containers:
32+
- name: cloudevents-sink
33+
image: gcr.io/knative-samples/helloworld-go:latest
34+
ports:
35+
- containerPort: 8080
36+
env:
37+
- name: TARGET
38+
value: "eoAPI CloudEvents Sink"
39+
readinessProbe:
40+
httpGet:
41+
path: /
42+
port: 8080
43+
initialDelaySeconds: 5
44+
periodSeconds: 10
45+
livenessProbe:
46+
httpGet:
47+
path: /
48+
port: 8080
49+
initialDelaySeconds: 15
50+
periodSeconds: 20
51+
52+
{{- end }}

0 commit comments

Comments
 (0)