Skip to content

Commit d31219e

Browse files
authored
[release-1.15] ci: add hosted OVN central e2e coverage (#7126)
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
1 parent bc32c3b commit d31219e

6 files changed

Lines changed: 1259 additions & 148 deletions

File tree

.github/workflows/build-x86-image.yaml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,185 @@ jobs:
17361736
if: ${{ success() || (failure() && (steps.install.conclusion == 'failure' || steps.e2e.conclusion == 'failure')) }}
17371737
run: make check-kube-ovn-pod-restarts
17381738

1739+
kube-ovn-hosted-ovn-central-e2e:
1740+
name: Kube-OVN Hosted OVN Central E2E (${{ matrix.ip-family }}, ${{ matrix.tenant-control-plane }} control-plane)
1741+
needs:
1742+
- build-kube-ovn
1743+
- build-e2e-binaries
1744+
runs-on: ubuntu-24.04
1745+
timeout-minutes: 60
1746+
strategy:
1747+
fail-fast: false
1748+
matrix:
1749+
include:
1750+
- ip-family: ipv4
1751+
tenant-control-plane: single
1752+
tenant-control-plane-replicas: 1
1753+
- ip-family: ipv6
1754+
tenant-control-plane: single
1755+
tenant-control-plane-replicas: 1
1756+
- ip-family: dual
1757+
tenant-control-plane: single
1758+
tenant-control-plane-replicas: 1
1759+
- ip-family: ipv4
1760+
tenant-control-plane: ha
1761+
tenant-control-plane-replicas: 3
1762+
- ip-family: ipv6
1763+
tenant-control-plane: ha
1764+
tenant-control-plane-replicas: 3
1765+
- ip-family: dual
1766+
tenant-control-plane: ha
1767+
tenant-control-plane-replicas: 3
1768+
steps:
1769+
- uses: jlumbroso/free-disk-space@v1.3.1
1770+
with:
1771+
android: true
1772+
dotnet: true
1773+
haskell: true
1774+
docker-images: false
1775+
large-packages: false
1776+
tool-cache: false
1777+
swap-storage: false
1778+
1779+
- uses: actions/checkout@v7
1780+
1781+
- name: Create the default branch directory
1782+
if: (github.base_ref || github.ref_name) != github.event.repository.default_branch
1783+
run: mkdir -p test/e2e/source
1784+
1785+
- name: Check out the default branch
1786+
if: (github.base_ref || github.ref_name) != github.event.repository.default_branch
1787+
uses: actions/checkout@v7
1788+
with:
1789+
ref: ${{ github.event.repository.default_branch }}
1790+
fetch-depth: 1
1791+
path: test/e2e/source
1792+
1793+
- name: Export E2E directory
1794+
run: |
1795+
if [ '${{ github.base_ref || github.ref_name }}' = '${{ github.event.repository.default_branch }}' ]; then
1796+
echo "E2E_DIR=." >> "$GITHUB_ENV"
1797+
else
1798+
echo "E2E_DIR=test/e2e/source" >> "$GITHUB_ENV"
1799+
fi
1800+
1801+
- name: Remove DNS search domain
1802+
run: |
1803+
sudo sed -i '/^search/d' /etc/resolv.conf
1804+
sudo systemctl restart docker
1805+
1806+
- uses: actions/setup-go@v7
1807+
id: setup-go
1808+
with:
1809+
go-version-file: ${{ env.E2E_DIR }}/go.mod
1810+
check-latest: true
1811+
cache: false
1812+
1813+
- name: Export Go full version
1814+
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV"
1815+
1816+
- name: Go cache
1817+
uses: actions/cache/restore@v6
1818+
with:
1819+
path: |
1820+
~/.cache/go-build
1821+
~/go/pkg/mod
1822+
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ github.ref_name }}-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }}
1823+
restore-keys: |
1824+
${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ github.ref_name }}-
1825+
${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ github.base_ref }}-
1826+
1827+
- name: Install kind
1828+
uses: helm/kind-action@v1.14.0
1829+
with:
1830+
version: ${{ env.KIND_VERSION }}
1831+
install_only: true
1832+
1833+
- name: Download image
1834+
uses: actions/download-artifact@v8
1835+
with:
1836+
name: kube-ovn
1837+
1838+
- name: Load image
1839+
run: |
1840+
docker load --input kube-ovn.tar
1841+
docker tag "kubeovn/kube-ovn:$(cat VERSION)" kubeovn/kube-ovn:dev
1842+
1843+
- name: Verify hosted OVN central values
1844+
run: E2E_SOURCE_DIR="$GITHUB_WORKSPACE/$E2E_DIR" bash hack/kamaji-e2e-test.sh
1845+
1846+
- name: Create hosted OVN central environment
1847+
id: install
1848+
env:
1849+
E2E_IP_FAMILY: ${{ matrix.ip-family }}
1850+
TENANT_CONTROL_PLANE_REPLICAS: ${{ matrix.tenant-control-plane-replicas }}
1851+
run: make kind-install-kamaji
1852+
1853+
- name: Run hosted OVN central E2E
1854+
id: e2e
1855+
working-directory: ${{ env.E2E_DIR }}
1856+
env:
1857+
# HCP was explicitly backported, so run the default-branch suite
1858+
# instead of triggering its pre-1.18 availability skip.
1859+
E2E_BRANCH: master
1860+
E2E_IP_FAMILY: ${{ matrix.ip-family }}
1861+
E2E_NETWORK_MODE: overlay
1862+
run: make kube-ovn-kamaji-e2e
1863+
1864+
- name: Collect k8s events
1865+
if: failure() && (steps.install.conclusion == 'failure' || steps.e2e.conclusion == 'failure')
1866+
run: |
1867+
kubectl --context kind-mgmt get events -A -o yaml > hcp-e2e-mgmt-events.yaml || true
1868+
tenant_kubeconfig="$(./hack/kamaji-e2e.sh kubeconfig)"
1869+
if [ -s "$tenant_kubeconfig" ]; then
1870+
KUBECONFIG="$tenant_kubeconfig" kubectl get events -A -o yaml > hcp-e2e-tenant-events.yaml || true
1871+
fi
1872+
tar zcf hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-events.tar.gz hcp-e2e-*-events.yaml
1873+
1874+
- name: Upload k8s events
1875+
uses: actions/upload-artifact@v7
1876+
if: failure() && (steps.install.conclusion == 'failure' || steps.e2e.conclusion == 'failure')
1877+
with:
1878+
name: hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-events
1879+
path: hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-events.tar.gz
1880+
1881+
- name: Collect hosted OVN central diagnostics
1882+
if: failure() && (steps.install.conclusion == 'failure' || steps.e2e.conclusion == 'failure')
1883+
run: |
1884+
job_dir="${JOB_DIR:-/tmp/kamaji-e2e}"
1885+
if [ -d "$job_dir/diagnostics" ]; then
1886+
tar -C "$job_dir" -zcf hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-diagnostics.tar.gz diagnostics
1887+
fi
1888+
1889+
- name: Upload hosted OVN central diagnostics
1890+
uses: actions/upload-artifact@v7
1891+
if: failure() && (steps.install.conclusion == 'failure' || steps.e2e.conclusion == 'failure')
1892+
with:
1893+
name: hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-diagnostics
1894+
path: hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-diagnostics.tar.gz
1895+
if-no-files-found: ignore
1896+
1897+
- name: kubectl ko log
1898+
if: failure() && (steps.install.conclusion == 'failure' || steps.e2e.conclusion == 'failure')
1899+
run: |
1900+
tenant_kubeconfig="$(./hack/kamaji-e2e.sh kubeconfig)"
1901+
if [ -s "$tenant_kubeconfig" ]; then
1902+
KUBECONFIG="$tenant_kubeconfig" make kubectl-ko-log
1903+
mv kubectl-ko-log.tar.gz hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-ko-log.tar.gz
1904+
fi
1905+
1906+
- name: upload kubectl ko log
1907+
uses: actions/upload-artifact@v7
1908+
if: failure() && (steps.install.conclusion == 'failure' || steps.e2e.conclusion == 'failure')
1909+
with:
1910+
name: hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-ko-log
1911+
path: hcp-e2e-${{ matrix.ip-family }}-${{ matrix.tenant-control-plane }}-ko-log.tar.gz
1912+
if-no-files-found: ignore
1913+
1914+
- name: Clean hosted OVN central environment
1915+
if: always()
1916+
run: make kind-clean-kamaji
1917+
17391918
chart-test:
17401919
name: Chart Installation/Uninstallation Test
17411920
needs: build-kube-ovn
@@ -4080,6 +4259,7 @@ jobs:
40804259
- kube-ovn-underlay-metallb-e2e
40814260
- multus-conformance-e2e
40824261
- non-primary-cni-e2e
4262+
- kube-ovn-hosted-ovn-central-e2e
40834263
- vpc-egress-gateway-e2e
40844264
- ovn-vpc-nat-gw-conformance-e2e
40854265
- iptables-vpc-nat-gw-conformance-e2e

charts/kube-ovn/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ TLS arguments for kube-ovn components that expose HTTPS endpoints.
139139

140140
{{/*
141141
Replica count for the kube-ovn-controller Deployment.
142-
dataPlaneOnly runs against external HCP ovn-central, so cap controller
142+
dataPlaneOnly runs against a hosted ovn-central, so cap controller
143143
replicas at two while allowing single-node clusters to run one.
144144
*/}}
145145
{{- define "kubeovn.controllerReplicas" -}}
@@ -275,7 +275,7 @@ Render gate for components that only make sense in a single-cluster install:
275275
- pre-upgrade-ovs-ovn / upgrade-ovs-ovn hooks (upgrade-ovs.sh waits on a local
276276
deploy/ovn-central, so it fails on tenant-only installs)
277277
Use `kubeovn.renderFullOnly` when the resource is not yet ready for the
278-
Kamaji-style split deployments.
278+
split-cluster hosted ovn-central deployment.
279279
*/}}
280280
{{- define "kubeovn.renderFullOnly" -}}
281281
{{- if eq .Values.installMode "full" -}}

charts/kube-ovn/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ OVN_CENTRAL_MODE: "cluster"
3030
# installMode controls which slice of the chart this Helm release renders.
3131
# full: all components in one cluster (default, classic install).
3232
# controlPlaneOnly: only ovn-central + ovn-nb/ovn-sb/ovn-northd Services and
33-
# their RBAC. Use on the management cluster of a Kamaji-
34-
# style split deployment.
33+
# their RBAC. Use on the management cluster of a
34+
# split-cluster deployment that hosts ovn-central.
3535
# dataPlaneOnly: CRDs + kube-ovn-controller + kube-ovn-cni + ovs-ovn +
3636
# pinger and their RBAC. Use on tenant data-plane
3737
# clusters that connect back to an external ovn-central via
@@ -233,7 +233,7 @@ ovn-central:
233233
# Service exposure for ovn-nb / ovn-sb / ovn-northd. Default ClusterIP is
234234
# only reachable from inside the cluster. Switch to LoadBalancer (or
235235
# NodePort) to expose the OVN DB to data-plane components running outside
236-
# the management cluster — for example a Kamaji-style topology where
236+
# the management cluster — for example a split-cluster topology where
237237
# ovn-controller / kube-ovn-cni / kube-ovn-controller run in a separate
238238
# tenant cluster and connect back over a stable VIP.
239239
service:

0 commit comments

Comments
 (0)