2525 - name : Run Helm unit tests
2626 run : make tests
2727
28- integration :
29- name : Integration Tests (K3s)
28+ k3s- integration-tests :
29+ name : K3s Integration Tests
3030 if : github.event.pull_request.head.repo.full_name == github.repository
3131 permissions :
3232 contents : ' read'
@@ -47,106 +47,128 @@ jobs:
4747 - name : Set release name
4848 run : echo "RELEASE_NAME=eoapi-$(echo "${{ github.sha }}" | cut -c1-8)" >> "$GITHUB_ENV"
4949
50- - name : Deploy eoAPI
51- id : deploy
52- continue-on-error : true
50+ - name : Wait for K3s to be fully ready
5351 run : |
54- echo "=== Starting eoAPI deployment ==="
55- export RELEASE_NAME="$RELEASE_NAME"
56- export PGO_VERSION="${{ env.PGO_VERSION }}"
57- export GITHUB_SHA="${{ github.sha }}"
58- ./scripts/deploy.sh --ci
52+ echo "=== Waiting for K3s to be fully ready ==="
5953
60- - name : Check deployment status
61- id : check
62- if : steps.deploy.outcome == 'success'
63- run : |
64- echo "=== Checking deployment status ==="
65- export RELEASE_NAME="$RELEASE_NAME"
66- ./scripts/test.sh check-deployment --debug
54+ # Wait for core K3s components to be ready
55+ echo "Waiting for kube-system pods to be ready..."
56+ kubectl wait --for=condition=Ready pod -l k8s-app=kube-dns -n kube-system --timeout=300s
57+ kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=traefik -n kube-system --timeout=300s
6758
68- - name : Debug pgstac jobs if deployment failed
69- if : steps.deploy.outcome == 'failure'
70- continue-on-error : true
71- run : |
72- echo "=== Debugging pgstac job failures ==="
73-
74- # Check pgstac-migrate job
75- echo "===== pgstac-migrate Job Status ====="
76- kubectl get jobs -l app.kubernetes.io/name=pgstac-migrate -o wide || echo "No pgstac-migrate jobs found"
77-
78- MIGRATE_PODS=$(kubectl get pods -l app.kubernetes.io/name=pgstac-migrate -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
79- if [ -n "$MIGRATE_PODS" ]; then
80- for POD in $MIGRATE_PODS; do
81- echo "--- Logs from migrate pod $POD ---"
82- kubectl logs "$POD" --tail=100 || true
83- echo "--- Description of migrate pod $POD ---"
84- kubectl describe pod "$POD"
85- done
86- fi
87-
88- # Check pgstac-load-samples job
89- echo "===== pgstac-load-samples Job Status ====="
90- kubectl get jobs -l app.kubernetes.io/name=pgstac-load-samples -o wide || echo "No pgstac-load-samples jobs found"
91-
92- SAMPLES_PODS=$(kubectl get pods -l app.kubernetes.io/name=pgstac-load-samples -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
93- if [ -n "$SAMPLES_PODS" ]; then
94- for POD in $SAMPLES_PODS; do
95- echo "--- Logs from samples pod $POD ---"
96- kubectl logs "$POD" --tail=100 || true
97- echo "--- Description of samples pod $POD ---"
98- kubectl describe pod "$POD"
99- done
100- fi
59+ # Wait for API server to be fully responsive
60+ echo "Checking API server responsiveness..."
61+ kubectl get nodes
62+ kubectl get pods --all-namespaces
10163
102- # Check database status
103- echo "===== Database Pod Status ====="
104- kubectl get pods -l postgres-operator.crunchydata.com/cluster -o wide
105- kubectl get postgrescluster -o wide
64+ # Give K3s a moment to initialize all CRDs
65+ echo "Waiting for K3s initialization to complete..."
66+ sleep 10
10667
107- # Check ConfigMaps
108- echo "===== Relevant ConfigMaps ====="
109- kubectl get configmaps | grep -E "initdb|pgstac" || echo "No relevant configmaps found"
68+ echo "✅ K3s is ready"
11069
111- # Check for any related events
112- echo "===== Related Kubernetes Events ====="
113- kubectl get events | grep -E "pgstac|initdb" || echo "No relevant events found"
11470
115- # Check notification system status
116- echo "===== Notification System Status ====="
117- kubectl get deployments -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier deployment found"
118- kubectl get ksvc -l app.kubernetes.io/component=cloudevents-sink -o wide || echo "No Knative CloudEvents sink found"
71+ - name : Wait for Traefik to be ready
72+ run : |
73+ echo "=== Waiting for Traefik to be ready ==="
74+
75+ # Wait for Traefik pods to be ready first
76+ echo "Waiting for Traefik controller to be ready..."
77+ kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=traefik -n kube-system --timeout=300s
78+
79+ # Wait for essential Traefik CRDs to be available
80+ echo "Checking for Traefik CRDs..."
81+ timeout=300
82+ counter=0
83+ required_crds=("middlewares.traefik.io" "ingressroutes.traefik.io")
84+
85+ for crd in "${required_crds[@]}"; do
86+ echo "Checking for CRD: $crd"
87+ counter=0
88+ while [ $counter -lt $timeout ]; do
89+ if kubectl get crd "$crd" &>/dev/null; then
90+ echo "✅ $crd is available"
91+ break
92+ fi
93+ echo "⏳ Waiting for $crd... ($counter/$timeout)"
94+ sleep 3
95+ counter=$((counter + 3))
96+ done
97+
98+ if [ $counter -ge $timeout ]; then
99+ echo "❌ Timeout waiting for $crd"
100+ echo "Available Traefik CRDs:"
101+ kubectl get crd | grep traefik || echo "No Traefik CRDs found"
102+ echo "All CRDs:"
103+ kubectl get crd
104+ exit 1
105+ fi
106+ done
107+
108+ echo "✅ All required Traefik CRDs are ready"
119109
120- exit 1
110+ - name : Deploy eoAPI
111+ id : deploy
112+ run : |
113+ echo "=== Starting eoAPI deployment ==="
114+ export RELEASE_NAME="$RELEASE_NAME"
115+ export PGO_VERSION="${{ env.PGO_VERSION }}"
116+ export GITHUB_SHA="${{ github.sha }}"
117+ ./scripts/deploy.sh --ci
121118
122119 - name : Run integration tests
123- if : steps.deploy.outcome == 'success'
124120 run : |
125121 echo "=== Running integration tests ==="
126122 export RELEASE_NAME="$RELEASE_NAME"
127123 ./scripts/test.sh integration --debug
128124
129- - name : Debug deployment status
130- if : always ()
125+ - name : Debug failed deployment
126+ if : failure ()
131127 run : |
132- echo "=== Final Deployment Status ==="
128+ echo "=== Deployment failed - collecting debug information ==="
133129 kubectl get pods -o wide
134130 kubectl get jobs -o wide
135131 kubectl get services -o wide
136- kubectl get ingress
132+ kubectl get events --sort-by='.lastTimestamp' | tail -20 || true
133+
134+ # Check Knative installation status
135+ echo "=== Knative Installation Status ==="
136+ kubectl get pods -n knative-serving -o wide || echo "Knative Serving not installed"
137+ kubectl get pods -n knative-eventing -o wide || echo "Knative Eventing not installed"
138+ kubectl get pods -n kourier-system -o wide || echo "Kourier not installed"
139+ # Check Knative CRDs
140+ echo "=== Knative CRDs Status ==="
141+ kubectl get crd | grep knative || echo "No Knative CRDs found"
142+ kubectl get crd sinkbindings.sources.knative.dev || echo "SinkBinding CRD not found"
143+
144+ # Check Traefik status
145+ echo "=== Traefik Status ==="
146+ kubectl get pods -n kube-system -l app.kubernetes.io/name=traefik -o wide || echo "No Traefik pods found"
147+ kubectl get crd | grep traefik || echo "No Traefik CRDs found"
148+ kubectl get crd middlewares.traefik.io || echo "Middleware CRD not found"
149+ kubectl get crd ingressroutes.traefik.io || echo "IngressRoute CRD not found"
137150
138151 # Check notification system final status
139152 echo "=== Notification System Final Status ==="
140153 kubectl get deployments -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier deployment"
141154 kubectl get pods -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier pods"
142- kubectl get ksvc -l app.kubernetes.io/component=cloudevents-sink -o wide || echo "No Knative CloudEvents sink"
143- kubectl get pods -l serving.knative.dev/service -o wide || echo "No Knative CloudEvents sink pods"
155+ kubectl get ksvc -n eoapi -o wide || echo "No Knative services in eoapi namespace"
156+ kubectl get ksvc eoapi-cloudevents-sink -n eoapi -o wide || echo "No eoapi-cloudevents-sink Knative service"
157+ kubectl get pods -l serving.knative.dev/service=eoapi-cloudevents-sink -n eoapi -o wide || echo "No CloudEvents sink pods"
158+ # Check SinkBinding resources
159+ echo "=== SinkBinding Resources ==="
160+ kubectl get sinkbindings -A -o wide || echo "No SinkBinding resources found"
144161
145162 # Show notification logs if they exist
146163 echo "=== eoapi-notifier Logs ==="
147164 kubectl logs -l app.kubernetes.io/name=eoapi-notifier --tail=20 || echo "No eoapi-notifier logs"
148165 echo "=== Knative CloudEvents Sink Logs ==="
149- kubectl logs -l serving.knative.dev/service --tail=20 || echo "No Knative CloudEvents sink logs"
166+ kubectl logs -l serving.knative.dev/service=eoapi-cloudevents-sink -n eoapi --tail=20 || echo "No CloudEvents sink logs"
167+ # Show Knative system logs if there are issues
168+ echo "=== Knative Serving Controller Logs ==="
169+ kubectl logs -n knative-serving -l app=controller --tail=20 || echo "No Knative Serving controller logs"
170+ echo "=== Knative Eventing Controller Logs ==="
171+ kubectl logs -n knative-eventing -l app=eventing-controller --tail=20 || echo "No Knative Eventing controller logs"
150172
151173
152174 - name : Cleanup
0 commit comments