Skip to content

Commit 2aea65a

Browse files
committed
foo
1 parent 908d8a1 commit 2aea65a

File tree

5 files changed

+187
-5
lines changed

5 files changed

+187
-5
lines changed

.github/workflows/helm-tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ jobs:
5252
- name: Set release name
5353
run: echo "RELEASE_NAME=eoapi-$(echo "${{ github.sha }}" | cut -c1-8)" >> "$GITHUB_ENV"
5454

55+
- name: Wait for K3s to be fully ready
56+
run: |
57+
echo "=== Waiting for K3s to be fully ready ==="
58+
59+
# Wait for core K3s components to be ready
60+
echo "Waiting for kube-system pods to be ready..."
61+
kubectl wait --for=condition=Ready pod -l k8s-app=kube-dns -n kube-system --timeout=300s
62+
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=traefik -n kube-system --timeout=300s
63+
64+
# Wait for API server to be fully responsive
65+
echo "Checking API server responsiveness..."
66+
kubectl get nodes
67+
kubectl get pods --all-namespaces
68+
69+
# Give K3s a moment to initialize all CRDs
70+
echo "Waiting for K3s initialization to complete..."
71+
sleep 10
72+
73+
echo "✅ K3s is ready"
74+
5575
- name: Install Knative Serving
5676
run: |
5777
echo "=== Installing Knative Serving ==="
@@ -95,6 +115,45 @@ jobs:
95115
echo "Waiting for CloudEvents sink to be ready..."
96116
kubectl wait --for=condition=Ready ksvc/eoapi-cloudevents-sink -n eoapi --timeout=300s
97117
118+
- name: Wait for Traefik to be ready
119+
run: |
120+
echo "=== Waiting for Traefik to be ready ==="
121+
122+
# Wait for Traefik pods to be ready first
123+
echo "Waiting for Traefik controller to be ready..."
124+
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=traefik -n kube-system --timeout=300s
125+
126+
# Wait for essential Traefik CRDs to be available
127+
echo "Checking for Traefik CRDs..."
128+
timeout=300
129+
counter=0
130+
required_crds=("middlewares.traefik.io" "ingressroutes.traefik.io")
131+
132+
for crd in "${required_crds[@]}"; do
133+
echo "Checking for CRD: $crd"
134+
counter=0
135+
while [ $counter -lt $timeout ]; do
136+
if kubectl get crd "$crd" &>/dev/null; then
137+
echo "✅ $crd is available"
138+
break
139+
fi
140+
echo "⏳ Waiting for $crd... ($counter/$timeout)"
141+
sleep 3
142+
counter=$((counter + 3))
143+
done
144+
145+
if [ $counter -ge $timeout ]; then
146+
echo "❌ Timeout waiting for $crd"
147+
echo "Available Traefik CRDs:"
148+
kubectl get crd | grep traefik || echo "No Traefik CRDs found"
149+
echo "All CRDs:"
150+
kubectl get crd
151+
exit 1
152+
fi
153+
done
154+
155+
echo "✅ All required Traefik CRDs are ready"
156+
98157
- name: Deploy eoAPI
99158
id: deploy
100159
run: |
@@ -130,6 +189,13 @@ jobs:
130189
kubectl get crd | grep knative || echo "No Knative CRDs found"
131190
kubectl get crd sinkbindings.sources.knative.dev || echo "SinkBinding CRD not found"
132191
192+
# Check Traefik status
193+
echo "=== Traefik Status ==="
194+
kubectl get pods -n kube-system -l app.kubernetes.io/name=traefik -o wide || echo "No Traefik pods found"
195+
kubectl get crd | grep traefik || echo "No Traefik CRDs found"
196+
kubectl get crd middlewares.traefik.io || echo "Middleware CRD not found"
197+
kubectl get crd ingressroutes.traefik.io || echo "IngressRoute CRD not found"
198+
133199
# Check notification system final status
134200
echo "=== Notification System Final Status ==="
135201
kubectl get deployments -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier deployment"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ eoapi-notifier:
6262
channel: pgstac_items_change
6363
connection:
6464
existingSecret:
65-
name: "eoapi-test-pguser-eoapi"
65+
name: ""
6666
keys:
6767
username: "user"
6868
password: "password"
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: 8 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

scripts/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ install_test_deps() {
127127
python_cmd="python3"
128128
fi
129129

130-
if ! $python_cmd -m pip install --quiet pytest httpx >/dev/null 2>&1; then
131-
log_error "Failed to install test dependencies (pytest, httpx)"
132-
log_error "Please install manually: pip install pytest httpx"
130+
if ! $python_cmd -m pip install --quiet pytest httpx psycopg2-binary >/dev/null 2>&1; then
131+
log_error "Failed to install test dependencies (pytest, httpx, psycopg2-binary)"
132+
log_error "Please install manually: pip install pytest httpx psycopg2-binary"
133133
exit 1
134134
fi
135135

0 commit comments

Comments
 (0)