In order to help users check that they have implemented the newly-added
Multus host configuration prerequisites, add a check to the validation
tool to verify connectivity.
Because users who are already running clusters with Multus enabled, add
a flag that allows users to only check for host configuration
prerequisites. This mode will not start the large number of clients that
would normally be started because those clients could disrupt a running
Rook cluster negatively.
Host checking pods require host network access. Many Kubernetes
distributions have pod security features enabled. In order to allow
non-Vanilla distros to run this tool, allow specifying a service account
that pods will run as, which can be configured by the admin to allow
test pods.
Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
(cherry picked from commit 33f5407dd4)
# Conflicts:
# Documentation/CRDs/Cluster/network-providers.md
# deploy/examples/multus-validation.yaml
109 lines
3.8 KiB
YAML
109 lines
3.8 KiB
YAML
name: Multus integration tests
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
branches:
|
|
- master
|
|
- release-*
|
|
pull_request:
|
|
paths:
|
|
- cmd/rook/userfacing/**
|
|
- pkg/daemon/multus/**
|
|
- .github/workflows/multus.yaml
|
|
|
|
defaults:
|
|
run:
|
|
# reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
|
|
shell: bash --noprofile --norc -eo pipefail -x {0}
|
|
|
|
# cancel the in-progress workflow when PR is refreshed.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test-validation-tool:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: true
|
|
if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
|
|
env:
|
|
NUMBER_OF_COMPUTE_NODES: 5
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go version
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: Create KinD Cluster
|
|
uses: helm/kind-action@v1.9.0
|
|
with:
|
|
config: tests/scripts/multus/kind-config.yaml
|
|
cluster_name: kind
|
|
|
|
- name: consider debugging
|
|
uses: ./.github/workflows/tmate_debug
|
|
with:
|
|
use-tmate: ${{ secrets.USE_TMATE }}
|
|
|
|
- name: Setup multus
|
|
run: ./tests/scripts/multus/setup-multus.sh
|
|
|
|
- name: Set up multus prerequisite host routing
|
|
run: kubectl create -f tests/scripts/multus/host-cfg-ds.yaml
|
|
|
|
- name: Install public and cluster NADs in default namespace
|
|
run: kubectl create -f tests/scripts/multus/default-public-cluster-nads.yaml
|
|
|
|
- name: Quickly build Rook binary
|
|
id: build
|
|
run: go build -o rook cmd/rook/*.go
|
|
|
|
- name: Run CLI validation test
|
|
run: ./tests/scripts/multus/test-110-cli.sh
|
|
|
|
- name: Label kind nodes for stretch cluster tests
|
|
id: label
|
|
# tests that require labels are independent from previous tests
|
|
if: steps.build.outcome == 'success' && !cancelled()
|
|
run: ./tests/scripts/multus/test-200-stretch-label-nodes.sh
|
|
# nodes are purposefully not tainted yet for overlap test
|
|
|
|
- name: Run stretch cluster overlap test
|
|
id: overlap
|
|
# independent from other tests as long as nodes are labeled
|
|
if: steps.label.outcome == 'success' && !cancelled()
|
|
run: ./tests/scripts/multus/test-210-stretch-overlap.sh
|
|
|
|
- name: Run cleanup test
|
|
# cleanup relies on overlap test to be successful
|
|
if: steps.overlap.outcome == 'success' && !cancelled()
|
|
run: ./tests/scripts/multus/test-211-stretch-cleanup.sh
|
|
|
|
- name: Taint kind nodes for remaining stretch cluster tests
|
|
id: taint
|
|
# tests that require taints+labels are independent from previous tests
|
|
if: steps.label.outcome == 'success' && !cancelled()
|
|
run: ./tests/scripts/multus/test-200-stretch-taint-nodes.sh
|
|
|
|
- name: Run stretch cluster test with public and cluster networks
|
|
# independent from other tests as long as nodes are tainted and labeled
|
|
if: steps.taint.outcome == 'success' && !cancelled()
|
|
run: ./tests/scripts/multus/test-220-stretch-pub-and-cluster.sh
|
|
|
|
- name: Run stretch cluster test with public network only
|
|
# independent from other tests as long as nodes are tainted and labeled
|
|
if: steps.taint.outcome == 'success' && !cancelled()
|
|
run: ./tests/scripts/multus/test-230-stretch-pub-only.sh
|
|
|
|
- name: Run stretch cluster test with cluster network only
|
|
# independent from other tests as long as nodes are tainted and labeled
|
|
if: steps.taint.outcome == 'success' && !cancelled()
|
|
run: ./tests/scripts/multus/test-240-stretch-cluster-only.sh
|