Skip to content

Kubernetes Tests

Kubernetes Tests #6792

Workflow file for this run

name: Kubernetes Tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
types: [checks_requested]
env:
VERSION: 'v1.0.0-ci1'
GITHUB_TOKEN: ${{ github.token }}
GO_TEST_RETRIES: 2
ENVOYINIT_CACHE_REF: ghcr.io/${{ github.repository_owner }}/envoy-wrapper-cache
CONTROLLER_CACHE_REF: ghcr.io/${{ github.repository_owner }}/kgateway-cache
SDS_CACHE_REF: ghcr.io/${{ github.repository_owner }}/sds-cache
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build_e2e_images:
name: Build End-to-End Images
runs-on: ubuntu-22.04
timeout-minutes: 45
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Prep Go Runner
uses: ./.github/actions/prep-go-runner
- name: Setup Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- name: Restore envoyinit BuildKit cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: /tmp/.buildx-cache-envoyinit
key: ${{ runner.os }}-buildx-envoyinit-v1-${{ hashFiles('internal/envoy_modules/Cargo.lock', 'internal/envoy_modules/**/Cargo.toml', 'cmd/envoyinit/Dockerfile.tmpl', 'cmd/envoyinit/generate-dockerfile.sh') }}
restore-keys: |
${{ runner.os }}-buildx-envoyinit-v1-
- name: Build shared e2e images
env:
ENVOYINIT_LOCAL_CACHE_FROM: /tmp/.buildx-cache-envoyinit
ENVOYINIT_LOCAL_CACHE_TO: /tmp/.buildx-cache-envoyinit-new
run: |
mkdir -p /tmp/.buildx-cache-envoyinit
make save-e2e-shared-images
- name: Rotate envoyinit BuildKit cache
if: always()
run: |
if [ -d /tmp/.buildx-cache-envoyinit-new ]; then
rm -rf /tmp/.buildx-cache-envoyinit
mv /tmp/.buildx-cache-envoyinit-new /tmp/.buildx-cache-envoyinit
fi
- name: Upload shared e2e images
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: e2e-shared-images
path: _output/e2e-images/shared-images.tar
if-no-files-found: error
retention-days: 1
compression-level: 0
end_to_end_tests:
name: End-to-End (${{ matrix.test.cluster-name }})
needs: build_e2e_images
runs-on: ubuntu-22.04
timeout-minutes: 60
if: ${{ !github.event.pull_request.draft }}
strategy:
fail-fast: false
matrix:
# We intentionally set an upper threshold of 30 minutes for our End-to-End tests
# Our goal is to load balance tests in a way that allows quick iteration on PRs
# If tests are exceeding the 30-minute limit, please see:
# /test/e2e/load_balancing_tests.md
#
# Above each test below, we document the latest date/time for the GitHub action step `Run /./.github/actions/kubernetes-e2e-tests` to run
# NOTE: We use the GitHub action step time (as opposed to the `go test` time or the GitHub action job time), because it is easier to capture and fairly consistent
test:
# May 29, 2026: ~9 minutes
- cluster-name: 'cluster-one'
go-test-args: '-timeout=25m'
go-test-run-regex: '^TestKgateway$$/^BasicRouting$$|^TestKgateway$$/^PathMatching$$|^TestKgateway$$/^HTTPRouteServices$$|^TestKgateway$$/^TLSRouteServices$$|^TestKgateway$$/^GRPCRouteServices$$|^TestKgateway$$/^SessionPersistence$$'
localstack: 'false'
# May 29, 2026: ~13 minutes
- cluster-name: 'cluster-two'
go-test-args: '-timeout=25m'
go-test-run-regex: '^TestKgatewayWaypoint$$'
localstack: 'false'
# May 29, 2026: ~10 minutes
- cluster-name: 'cluster-three'
go-test-args: '-timeout=25m'
go-test-run-regex: '^TestKgateway$$/^DynamicForwardProxy$$|^TestKgateway$$/^Lambda$$|^TestKgateway$$/^EC2$$|^TestKgateway$$/^AccessLog$$|^TestKgateway$$/^LocalRateLimit$$|^TestKgateway$$/^Cors$$|^TestKgateway$$/^BackendConfigPolicy$$|^TestKgateway$$/^ListenerPolicy$$|^TestKgateway$$/^Tracing$$|^TestKgateway$$/^DirectResponse$$|^TestKgateway$$/^AdminServer$$|^TestKgateway$$/^FaultInjection$$'
localstack: 'true'
# May 29, 2026: ~8 minutes
- cluster-name: 'cluster-four'
go-test-args: '-timeout=25m'
go-test-run-regex: '^TestKgateway$$/^ExtProc$$|^TestKgateway$$/^ExtAuth$$|^TestKgateway$$/^PolicySelector$$|^TestKgateway$$/^Backends$$|^TestKgateway$$/^BackendTLSPolicies$$|^TestKgateway$$/^CSRF$$|^TestKgateway$$/^AutoHostRewrite$$|^TestKgateway$$/^LeaderElection$$|^TestKgateway$$/^Compression$$|^TestKgateway$$/^GlobalRateLimit$$|^TestKgateway$$/^InternalRedirect$$|^TestCustomGWP$$'
localstack: 'false'
# May 29, 2026: ~10 minutes
- cluster-name: 'cluster-five'
go-test-args: '-timeout=25m'
go-test-run-regex: '^TestKgateway$$/^TimeoutRetry$$|^TestKgateway$$/^HeaderModifiers$$|^TestKgateway$$/^RBAC$$|^TestKgateway$$/^HttpACL$$|^TestKgateway$$/^APIKeyAuth$$|^TestKgateway$$/^Deployer$$|^TestKgateway$$/^Transforms$$|^TestRouteReplacement$$|^TestKgateway$$/^RouteDelegation$$|^TestKgateway$$/^JWT$$|^TestKgateway$$/^BasicAuth$$|^TestKgateway$$/^WebSocket$$'
localstack: 'false'
# May 29, 2026: ~10 minutes
- cluster-name: 'cluster-six'
go-test-args: '-timeout=25m'
go-test-run-regex: '^TestListenerSet$$|^TestKgateway$$/^TCPRouteServices$$|^TestKgatewayIstioAutoMtls$$|^TestZeroDowntimeRollout$$'
localstack: 'false'
# May 29, 2026: ~4 minutes
- cluster-name: 'cluster-seven'
go-test-args: '-timeout=25m'
go-test-run-regex: '^TestAPIValidation$$|^TestKgateway$$/^OAuth$$|^TestKgateway$$/^TrafficPolicyStatus$$|^TestKgateway$$/^XdsStarvation$$'
localstack: 'false'
# May 29, 2026: ~5 minutes
- cluster-name: 'cluster-eight'
go-test-args: '-timeout=25m'
go-test-run-regex: '^TestKgatewayMetrics$$|^TestControlPlaneTLS$$|^TestKgateway$$/^FrontendTLS$$'
localstack: 'false'
# May 29, 2026: ~4 minutes
- cluster-name: 'cluster-multi-install'
go-test-args: '-timeout=5m'
go-test-run-regex: '^TestMultipleInstalls'
localstack: 'false'
# May 29, 2026: ~6 minutes
# Do NOT add tests to this cluster as it runs an older version of GWAPI which should be bumped to n-1 on an upgrade
- cluster-name: 'cluster-upgrade'
go-test-args: '-timeout=10m'
go-test-run-regex: '^TestUpgrade'
localstack: 'false'
gateway-api-version: 'v1.4.1'
# In our PR tests, we run the suite of tests using the upper ends of versions that we claim to support
# The versions should mirror: https://kgateway.dev/docs/reference/versions/
version-files:
- file: './.github/workflows/.env/pr-tests/versions.env'
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Prep Go Runner
uses: ./.github/actions/prep-go-runner
# The dotenv action is used to load key-value pairs from files.
# In this case, the file is specified in the matrix and will contain the versions of the tools to use
- name: Dotenv Action
uses: falti/dotenv-action@a33be0b8cf6a6e6f1b82cc9f3782061ab1022be5 # v1.1.4
id: dotenv
with:
path: ${{ matrix.version-files.file }}
log-variables: true
- name: Download shared e2e images
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: e2e-shared-images
path: _output/e2e-images
- name: Load shared e2e images
shell: bash
run: docker load --input _output/e2e-images/shared-images.tar
- id: setup-kind-cluster
name: Setup KinD Cluster
if: ${{ steps.dotenv.outputs.cluster_type != 'k3d' }}
uses: ./.github/actions/setup-kind-cluster
env:
SKIP_DOCKER: "true"
LOAD_DOCKER_IMAGES: "true"
with:
cluster-name: ${{ matrix.test.cluster-name }}
kind-node-version: ${{ steps.dotenv.outputs.node_version }}
kubectl-version: ${{ steps.dotenv.outputs.kubectl_version }}
istio-version: ${{ steps.dotenv.outputs.istio_version }}
localstack: ${{ matrix.test.localstack }}
gateway-api-version: ${{ matrix.test.gateway-api-version }}
- id: setup-k3d-cluster
name: Setup k3d Cluster
if: ${{ steps.dotenv.outputs.cluster_type == 'k3d' }}
uses: ./.github/actions/setup-k3d-cluster
env:
SKIP_DOCKER: "true"
LOAD_DOCKER_IMAGES: "true"
with:
cluster-name: ${{ matrix.test.cluster-name }}
node-version: ${{ steps.dotenv.outputs.node_version }}
kubectl-version: ${{ steps.dotenv.outputs.kubectl_version }}
istio-version: ${{ steps.dotenv.outputs.istio_version }}
localstack: ${{ matrix.test.localstack }}
github-token: ${{ github.token }}
- name: Load shared extproc server
shell: bash
env:
CLUSTER_NAME: ${{ matrix.test.cluster-name }}
CLUSTER_TYPE: ${{ steps.dotenv.outputs.cluster_type || 'kind' }}
run: make cluster-load-extproc-server
- id: run-tests
uses: ./.github/actions/kubernetes-e2e-tests
env:
SKIP_EXTPROC_SERVER_SETUP: "true"
with:
cluster-name: ${{ matrix.test.cluster-name }}
cluster-type: ${{ steps.dotenv.outputs.cluster_type || 'kind' }}
test-args: ${{ matrix.test.go-test-args }}
run-regex: ${{ matrix.test.go-test-run-regex }}
istio-version: ${{ steps.dotenv.outputs.istio_version }}
matrix-label: "pr"
- id: debug-space
shell: bash
run: |
echo "After job disk space:"
df -h