|
52 | 52 | - name: Set release name |
53 | 53 | run: echo "RELEASE_NAME=eoapi-$(echo "${{ github.sha }}" | cut -c1-8)" >> "$GITHUB_ENV" |
54 | 54 |
|
| 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 | +
|
55 | 75 | - name: Install Knative Serving |
56 | 76 | run: | |
57 | 77 | echo "=== Installing Knative Serving ===" |
@@ -95,6 +115,45 @@ jobs: |
95 | 115 | echo "Waiting for CloudEvents sink to be ready..." |
96 | 116 | kubectl wait --for=condition=Ready ksvc/eoapi-cloudevents-sink -n eoapi --timeout=300s |
97 | 117 |
|
| 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 | +
|
98 | 157 | - name: Deploy eoAPI |
99 | 158 | id: deploy |
100 | 159 | run: | |
@@ -130,6 +189,13 @@ jobs: |
130 | 189 | kubectl get crd | grep knative || echo "No Knative CRDs found" |
131 | 190 | kubectl get crd sinkbindings.sources.knative.dev || echo "SinkBinding CRD not found" |
132 | 191 |
|
| 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 | +
|
133 | 199 | # Check notification system final status |
134 | 200 | echo "=== Notification System Final Status ===" |
135 | 201 | kubectl get deployments -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier deployment" |
|
0 commit comments