Skip to content

Commit 35ccc0d

Browse files
committed
Moved to knative charts.
1 parent dcaf3e4 commit 35ccc0d

File tree

8 files changed

+90
-95
lines changed

8 files changed

+90
-95
lines changed

.github/workflows/helm-tests.yml

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -67,48 +67,6 @@ jobs:
6767
6868
echo "✅ K3s is ready"
6969
70-
- name: Install Knative Serving
71-
run: |
72-
echo "=== Installing Knative Serving ==="
73-
# Install Knative Serving CRDs
74-
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-crds.yaml
75-
# Install Knative Serving core components
76-
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-core.yaml
77-
# Install Kourier networking layer for Knative
78-
kubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.17.0/kourier.yaml
79-
# Configure Knative to use Kourier
80-
kubectl patch configmap/config-network \
81-
--namespace knative-serving \
82-
--type merge \
83-
--patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}'
84-
# Wait for Knative Serving to be ready
85-
echo "Waiting for Knative Serving to be ready..."
86-
kubectl wait --for=condition=Ready pod -l app=controller -n knative-serving --timeout=300s
87-
kubectl wait --for=condition=Ready pod -l app=webhook -n knative-serving --timeout=300s
88-
kubectl wait --for=condition=Ready pod -l app=3scale-kourier-gateway -n kourier-system --timeout=300s
89-
90-
- name: Install Knative Eventing
91-
run: |
92-
echo "=== Installing Knative Eventing ==="
93-
# Install Knative Eventing CRDs (includes SinkBinding)
94-
kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.17.0/eventing-crds.yaml
95-
# Install Knative Eventing core components
96-
kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.17.0/eventing-core.yaml
97-
# Wait for Knative Eventing to be ready
98-
echo "Waiting for Knative Eventing to be ready..."
99-
kubectl wait --for=condition=Ready pod -l app=eventing-controller -n knative-eventing --timeout=300s
100-
kubectl wait --for=condition=Ready pod -l app=eventing-webhook -n knative-eventing --timeout=300s
101-
102-
- name: Deploy CloudEvents sink for eoapi-notifier
103-
run: |
104-
echo "=== Deploying CloudEvents sink ==="
105-
# Create the namespace first
106-
kubectl create namespace eoapi || true
107-
# Deploy the CloudEvents sink service
108-
kubectl apply -f charts/eoapi/samples/cloudevents-sink.yaml
109-
# Wait for the Knative service to be ready
110-
echo "Waiting for CloudEvents sink to be ready..."
111-
kubectl wait --for=condition=Ready ksvc/eoapi-cloudevents-sink -n eoapi --timeout=300s
11270
11371
- name: Wait for Traefik to be ready
11472
run: |

charts/eoapi/Chart.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ dependencies:
5757
version: 0.0.7
5858
repository: "oci://ghcr.io/developmentseed/charts"
5959
condition: eoapi-notifier.enabled
60+
- name: knative-operator
61+
version: 1.19.4
62+
repository: https://knative.github.io/operator
63+
condition: knative.enabled
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{{- if and (index .Values "eoapi-notifier").enabled .Values.knative.enabled }}
2+
{{- range (index .Values "eoapi-notifier").outputs }}
3+
{{- if eq .type "cloudevents" }}
4+
---
5+
apiVersion: serving.knative.dev/v1
6+
kind: Service
7+
metadata:
8+
name: eoapi-cloudevents-sink
9+
namespace: {{ $.Release.Namespace }}
10+
labels:
11+
{{- include "eoapi.labels" $ | nindent 4 }}
12+
app.kubernetes.io/component: cloudevents-sink
13+
spec:
14+
template:
15+
metadata:
16+
annotations:
17+
autoscaling.knative.dev/minScale: "1"
18+
autoscaling.knative.dev/maxScale: "1"
19+
labels:
20+
{{- include "eoapi.selectorLabels" $ | nindent 8 }}
21+
app.kubernetes.io/component: cloudevents-sink
22+
spec:
23+
containers:
24+
- name: cloudevents-sink
25+
image: {{ $.Values.knative.cloudEventsSink.image }}
26+
ports:
27+
- containerPort: 8080
28+
env:
29+
- name: TARGET
30+
value: "CloudEvents Sink"
31+
resources:
32+
{{- toYaml $.Values.knative.cloudEventsSink.resources | nindent 10 }}
33+
{{- break }}
34+
{{- end }}
35+
{{- end }}
36+
{{- end }}

charts/eoapi/test-helm-values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# this file is used with `helm-tests` job in CI
22

3+
knative:
4+
enabled: false
5+
36
ingress:
47
className: "nginx"
58
enabled: true

charts/eoapi/test-k3s-unittest-values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# used in GH Actions `.github/workflows/helm-tests.yml.jobs.integration-tests`
22
testing: true
3+
4+
knative:
5+
enabled: true
6+
37
ingress:
48
enabled: true
59
className: "traefik"

charts/eoapi/test-local-values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Based on test-k3s-unittest-values.yaml with minimal changes for local environment
33

44
testing: true
5+
6+
knative:
7+
enabled: true
8+
59
ingress:
610
enabled: true
711
className: "nginx" # Changed from "traefik" for minikube

charts/eoapi/values.yaml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,45 @@ eoapi-notifier:
520520
kind: Broker
521521
name: my-channel-1
522522
namespace: serverless
523-
# For HTTP endpoints, use: endpoint: https://webhook.example.com
523+
# For HTTP endpoints, use: endpoint: https://webhook.example.com
524524

525+
######################
526+
# KNATIVE
527+
######################
528+
# Optional Knative components for CloudEvents and serverless workloads
529+
knative:
530+
enabled: false
531+
version: "v1.19.6"
532+
# CloudEvents sink configuration (deployed when eoapi-notifier uses CloudEvents output)
533+
cloudEventsSink:
534+
enabled: true
535+
image: gcr.io/knative-samples/helloworld-go
536+
resources:
537+
requests:
538+
cpu: 100m
539+
memory: 128Mi
540+
limits:
541+
cpu: 200m
542+
memory: 256Mi
543+
544+
# Knative operator sub-chart configuration
545+
# These values are passed directly to the knative-operator sub-chart
546+
# The operator will be installed and can then deploy Knative Serving/Eventing via CRs
547+
knative-operator:
548+
knative_operator:
549+
knative_operator:
550+
tag: "v1.19.4"
551+
resources:
552+
requests:
553+
cpu: 100m
554+
memory: 100Mi
555+
limits:
556+
cpu: 500m
557+
memory: 500Mi
558+
559+
######################
560+
# VERSION MANAGEMENT
561+
######################
525562
# Version being upgraded from, used for migration purposes
526563
# Dont set the value in the values.yaml file
527564
# prefer to set it in the command line

scripts/deploy.sh

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -81,54 +81,9 @@ install_pgo() {
8181
kubectl get pods -l postgres-operator.crunchydata.com/control-plane=postgres-operator
8282
}
8383

84-
# Setup Knative for local development
85-
setup_knative() {
86-
log_info "Setting up Knative for local development..."
8784

88-
if kubectl get namespace knative-serving &>/dev/null && kubectl get namespace knative-eventing &>/dev/null; then
89-
log_info "Knative already installed, skipping installation"
90-
return 0
91-
fi
92-
93-
log_info "Installing Knative Serving..."
94-
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-crds.yaml
95-
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.17.0/serving-core.yaml
96-
kubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.17.0/kourier.yaml
97-
# Configure Knative to use Kourier
98-
kubectl patch configmap/config-network \
99-
--namespace knative-serving \
100-
--type merge \
101-
--patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}'
102-
103-
log_info "Installing Knative Eventing..."
104-
# Install Knative Eventing CRDs (includes SinkBinding)
105-
kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.17.0/eventing-crds.yaml
106-
# Install Knative Eventing core components
107-
kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.17.0/eventing-core.yaml
108-
109-
log_info "Waiting for Knative components to be ready..."
110-
kubectl wait --for=condition=Ready pod -l app=controller -n knative-serving --timeout=300s
111-
kubectl wait --for=condition=Ready pod -l app=webhook -n knative-serving --timeout=300s
112-
kubectl wait --for=condition=Ready pod -l app=3scale-kourier-gateway -n kourier-system --timeout=300s
113-
kubectl wait --for=condition=Ready pod -l app=eventing-controller -n knative-eventing --timeout=300s
114-
kubectl wait --for=condition=Ready pod -l app=eventing-webhook -n knative-eventing --timeout=300s
115-
116-
log_info "✅ Knative installation complete"
117-
}
11885

119-
deploy_cloudevents_sink() {
120-
log_info "Deploying CloudEvents sink for notifications..."
12186

122-
kubectl create namespace "$NAMESPACE" --dry-run=client -o yaml | kubectl apply -f -
123-
124-
if kubectl apply -f charts/eoapi/samples/cloudevents-sink.yaml; then
125-
log_info "Waiting for CloudEvents sink to be ready..."
126-
kubectl wait --for=condition=Ready ksvc/eoapi-cloudevents-sink -n "$NAMESPACE" --timeout=300s
127-
log_info "✅ CloudEvents sink deployed successfully"
128-
else
129-
log_warn "Failed to deploy CloudEvents sink, continuing without it"
130-
fi
131-
}
13287

13388
# Integrated Helm dependency setup
13489
setup_helm_dependencies() {
@@ -237,9 +192,7 @@ deploy_eoapi() {
237192
fi
238193
fi
239194

240-
if [ "$CI_MODE" != true ]; then
241-
deploy_cloudevents_sink
242-
fi
195+
243196

244197
# Verify deployment
245198
log_info "Verifying deployment..."
@@ -306,10 +259,6 @@ case $COMMAND in
306259
;;
307260
deploy)
308261
install_pgo
309-
310-
if [ "$CI_MODE" != true ]; then
311-
setup_knative
312-
fi
313262
setup_helm_dependencies
314263
deploy_eoapi
315264
;;

0 commit comments

Comments
 (0)