|
| 1 | +name: Federated E2E |
| 2 | + |
| 3 | +# Exercises the production-fidelity edge: two kind clusters (control plane + edge) |
| 4 | +# wired with real Karmada federation, the production Envoy Gateway version, the |
| 5 | +# Coraza WAF data plane, and the NSO extension server — then runs the edge e2e |
| 6 | +# scenarios against real traffic. This is the path the non-federated test/e2e |
| 7 | +# suite (test-e2e.yml) never covers. |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + paths: |
| 13 | + - 'Taskfile.test-infra.yml' |
| 14 | + - 'config/e2e-downstream/**' |
| 15 | + - 'config/federation/**' |
| 16 | + - 'config/tools/**' |
| 17 | + - 'config/extension-server/**' |
| 18 | + - 'internal/extensionserver/**' |
| 19 | + - 'cmd/**' |
| 20 | + - 'test/e2e-edge/**' |
| 21 | + - 'test/parity/**' |
| 22 | + - '.github/workflows/test-e2e-federated.yml' |
| 23 | + push: |
| 24 | + branches: |
| 25 | + - main |
| 26 | + workflow_dispatch: |
| 27 | + |
| 28 | +# One federated run per ref; a newer push cancels an in-flight one. |
| 29 | +concurrency: |
| 30 | + group: federated-e2e-${{ github.ref }} |
| 31 | + cancel-in-progress: true |
| 32 | + |
| 33 | +jobs: |
| 34 | + federated-e2e: |
| 35 | + name: Two-cluster federated edge (Karmada) |
| 36 | + runs-on: ubuntu-latest |
| 37 | + timeout-minutes: 60 |
| 38 | + env: |
| 39 | + TMPDIR: /tmp |
| 40 | + steps: |
| 41 | + - name: Clone the code |
| 42 | + uses: actions/checkout@v4 |
| 43 | + |
| 44 | + - name: Setup Go |
| 45 | + uses: actions/setup-go@v5 |
| 46 | + with: |
| 47 | + go-version: '~1.26' |
| 48 | + |
| 49 | + # Two kind clusters plus a full Karmada control plane and the edge data |
| 50 | + # plane need more room than the runner ships with. Reclaim disk from |
| 51 | + # toolchains this job never uses. |
| 52 | + - name: Free up disk space |
| 53 | + run: | |
| 54 | + sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /opt/hostedtoolcache/CodeQL |
| 55 | + docker system prune -af || true |
| 56 | + df -h / |
| 57 | +
|
| 58 | + # Karmada plus two clusters open a large number of file watches; the |
| 59 | + # default runner limits crashloop a component with "too many open files". |
| 60 | + - name: Raise inotify limits |
| 61 | + run: | |
| 62 | + sudo sysctl -w fs.inotify.max_user_instances=8192 |
| 63 | + sudo sysctl -w fs.inotify.max_user_watches=1048576 |
| 64 | +
|
| 65 | + - name: Install Task |
| 66 | + uses: arduino/setup-task@v2 |
| 67 | + with: |
| 68 | + version: 3.x |
| 69 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + |
| 71 | + - name: Install Helm |
| 72 | + uses: azure/setup-helm@v4 |
| 73 | + with: |
| 74 | + # kustomize v5.5.0 probes helm with `helm version -c`; the -c shorthand |
| 75 | + # was removed in helm 3.13, so pin to the last release that accepts it. |
| 76 | + version: v3.12.3 |
| 77 | + |
| 78 | + - name: Install pinned tools (kind, karmadactl, kustomize, cmctl, chainsaw) |
| 79 | + run: task test-infra:tools |
| 80 | + |
| 81 | + - name: Bring up the two-cluster prod-fidelity env |
| 82 | + run: task test-infra:up |
| 83 | + |
| 84 | + - name: Stand up Karmada federation |
| 85 | + run: task test-infra:karmada-up |
| 86 | + |
| 87 | + - name: Run edge e2e scenarios |
| 88 | + run: task test-infra:e2e |
| 89 | + |
| 90 | + # When something fails, capture enough cross-cluster state to diagnose it |
| 91 | + # from the logs alone — the runner is torn down immediately after. |
| 92 | + - name: Diagnostics on failure |
| 93 | + if: failure() |
| 94 | + run: | |
| 95 | + set +e |
| 96 | + echo "::group::upstream pods" |
| 97 | + kubectl --context kind-nso-upstream get pods -A -o wide |
| 98 | + echo "::endgroup::" |
| 99 | + echo "::group::downstream pods" |
| 100 | + kubectl --context kind-nso-downstream get pods -A -o wide |
| 101 | + echo "::endgroup::" |
| 102 | + echo "::group::not-ready pods — describe (both clusters)" |
| 103 | + for ctx in kind-nso-upstream kind-nso-downstream; do |
| 104 | + echo "### $ctx" |
| 105 | + kubectl --context "$ctx" get pods -A \ |
| 106 | + --field-selector=status.phase!=Running,status.phase!=Succeeded \ |
| 107 | + -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{"\n"}{end}' \ |
| 108 | + | while read -r ns name; do |
| 109 | + [ -n "$name" ] || continue |
| 110 | + kubectl --context "$ctx" -n "$ns" describe pod "$name" 2>/dev/null | tail -30 |
| 111 | + done |
| 112 | + done |
| 113 | + echo "::endgroup::" |
| 114 | + echo "::group::cert-manager health (upstream) — restarts + issuance" |
| 115 | + kubectl --context kind-nso-upstream -n cert-manager get pods -o wide |
| 116 | + kubectl --context kind-nso-upstream -n cert-manager \ |
| 117 | + logs -l app.kubernetes.io/name=cert-manager --tail=80 --previous 2>/dev/null || true |
| 118 | + kubectl --context kind-nso-upstream get certificate,certificaterequest,issuer,clusterissuer -A |
| 119 | + echo "::endgroup::" |
| 120 | + echo "::group::karmada member clusters" |
| 121 | + KCFG=/tmp/karmada-nso-upstream/karmada-apiserver.config |
| 122 | + kubectl --kubeconfig "$KCFG" --context karmada-apiserver get clusters -o wide |
| 123 | + kubectl --kubeconfig "$KCFG" --context karmada-apiserver get clusterpropagationpolicy,work -A |
| 124 | + echo "::endgroup::" |
| 125 | + echo "::group::NSO manager logs (upstream)" |
| 126 | + kubectl --context kind-nso-upstream -n network-services-operator-system \ |
| 127 | + logs deploy/network-services-operator-controller-manager --tail=200 |
| 128 | + echo "::endgroup::" |
| 129 | + echo "::group::extension server logs (downstream)" |
| 130 | + kubectl --context kind-nso-downstream -n network-services-operator-system \ |
| 131 | + logs deploy/network-services-operator-envoy-gateway-extension-server --tail=200 |
| 132 | + echo "::endgroup::" |
| 133 | + echo "::group::downstream Envoy Gateway logs" |
| 134 | + kubectl --context kind-nso-downstream -n datum-downstream-gateway \ |
| 135 | + logs deploy/envoy-gateway --tail=200 |
| 136 | + echo "::endgroup::" |
0 commit comments