-
Notifications
You must be signed in to change notification settings - Fork 2.3k
OPNET-803: installer: add BGP VIP coexistence lanes (OVN-K route advertisements, day-2 MetalLB) #82912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mkowalski
wants to merge
12
commits into
openshift:main
Choose a base branch
from
mkowalski:bgp-vip-ovn-bgp-lane
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
OPNET-803: installer: add BGP VIP coexistence lanes (OVN-K route advertisements, day-2 MetalLB) #82912
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9532220
OPNET-803: installer: add e2e-metal-ipi-bgp-vip-ovn-bgp coexistence lane
mkowalski 0edc822
ovn/bgp: wait for RouteAdvertisements CRD before applying CRs
mkowalski 51d03a9
bgp-vip/ovn-bgp: address review findings
mkowalski cb89779
bgp-vip/ovn-bgp: document security justification in workflow docs
mkowalski 510141d
bgp-vip/metallb: add day-2 MetalLB install pre step
mkowalski d8ae4f1
bgp-vip/metallb: add coexistence verify step
mkowalski 0a73976
installer: add e2e-metal-ipi-bgp-vip-metallb day-2 coexistence lane
mkowalski 0e23322
installer: add e2e-metal-ipi-bgp-vip-ovn-bgp-metallb three-producer lane
mkowalski 98a7aa6
bgp-vip/metallb: source the fallback manifests from openshift/metallb…
mkowalski a8b7143
bgp-vip: address review findings across the coexistence lanes
mkowalski bd39688
bgp-vip: convert the coexistence lanes to dual-stack
mkowalski 77820c9
bgp-vip/metallb: reference OCPBUGS-105394/-105395 on the env workarounds
mkowalski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
ci-operator/step-registry/baremetalds/e2e/bgp-vip/ovn-bgp/OWNERS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| approvers: | ||
| - mkowalski | ||
| - cybertron | ||
| reviewers: | ||
| - mkowalski | ||
| - cybertron |
13 changes: 13 additions & 0 deletions
13
...ry/baremetalds/e2e/bgp-vip/ovn-bgp/baremetalds-e2e-bgp-vip-ovn-bgp-workflow.metadata.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "path": "baremetalds/e2e/bgp-vip/ovn-bgp/baremetalds-e2e-bgp-vip-ovn-bgp-workflow.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "mkowalski", | ||
| "cybertron" | ||
| ], | ||
| "reviewers": [ | ||
| "mkowalski", | ||
| "cybertron" | ||
| ] | ||
| } | ||
| } |
40 changes: 40 additions & 0 deletions
40
...ep-registry/baremetalds/e2e/bgp-vip/ovn-bgp/baremetalds-e2e-bgp-vip-ovn-bgp-workflow.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| workflow: | ||
| as: baremetalds-e2e-bgp-vip-ovn-bgp | ||
| steps: | ||
| cluster_profile: equinix-ocp-metal | ||
| env: | ||
| DEVSCRIPTS_CONFIG: | | ||
| IP_STACK=v4 | ||
| NUM_WORKERS=2 | ||
| ENABLE_BGP_TOR=true | ||
| BGP_VIP_MANAGEMENT=true | ||
| FEATURE_SET: DevPreviewNoUpgrade | ||
| EXTRA_MG_ARGS: --host-network | ||
| TEST_SKIPS: Services should fallback to local terminating endpoints when there | ||
| are no ready endpoints with externalTrafficPolicy=Local\| CPU Partitioning | ||
| cluster platform workloads should be annotated correctly for Deployments | ||
| pre: | ||
| - ref: baremetalds-devscripts-conf-featureset | ||
| - chain: baremetalds-ofcir-pre | ||
| - ref: baremetalds-e2e-ovn-bgp-pre | ||
| test: | ||
| - ref: baremetalds-e2e-bgp-vip-verify | ||
| - ref: baremetalds-e2e-bgp-vip-ovn-bgp-verify | ||
| - chain: baremetalds-ipi-test | ||
| post: | ||
| - chain: baremetalds-ofcir-post | ||
| documentation: |- | ||
| Coexistence lane for BGP-based VIP management (enhancement 1982) and | ||
| OVN-Kubernetes BGP route advertisements. Installs a baremetal IPI cluster | ||
| via dev-scripts with BGP_VIP_MANAGEMENT=true (API/ingress VIPs advertised | ||
| to a top-of-rack FRR speaker by kube-vip + frr-k8s static pods instead of | ||
| keepalived), then runs the OVN BGP pre step: an external FRR route | ||
| reflector on the baremetal bridge, routeAdvertisements enabled on the | ||
| cluster network operator, and FRRConfiguration/RouteAdvertisements CRs for | ||
| the default pod network. The verification steps assert that both BGP | ||
| consumers work simultaneously: the VIP acceptance criteria still hold, the | ||
| RouteAdvertisements-generated FRRConfiguration is merged by the frr-k8s | ||
| static pods on the control plane (where the frr-k8s DaemonSet does not | ||
| run), every node establishes a session to the route reflector, and pod | ||
| network prefixes arrive at the reflector; the conformance suite then runs | ||
| against the combined configuration. |
6 changes: 6 additions & 0 deletions
6
ci-operator/step-registry/baremetalds/e2e/bgp-vip/ovn-bgp/verify/OWNERS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| approvers: | ||
| - mkowalski | ||
| - cybertron | ||
| reviewers: | ||
| - mkowalski | ||
| - cybertron |
110 changes: 110 additions & 0 deletions
110
...baremetalds/e2e/bgp-vip/ovn-bgp/verify/baremetalds-e2e-bgp-vip-ovn-bgp-verify-commands.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| #!/bin/bash | ||
| set -o nounset | ||
| set -o errexit | ||
| set -o pipefail | ||
|
|
||
| echo "************ baremetalds bgp-vip ovn-bgp coexistence verify command ************" | ||
|
|
||
| # Fetch packet basic configuration | ||
| # shellcheck source=/dev/null | ||
| source "${SHARED_DIR}/packet-conf.sh" | ||
|
|
||
| ssh "${SSHOPTS[@]}" "root@${IP}" bash -x - << 'EOF' | ||
| #!/bin/bash | ||
| set -o nounset | ||
| set -o errexit | ||
| set -o pipefail | ||
| set -x | ||
|
|
||
| export KUBECONFIG=/root/dev-scripts/ocp/ostest/auth/kubeconfig | ||
|
|
||
| CLI="podman" | ||
| if ! command -v podman &>/dev/null; then | ||
| CLI="docker" | ||
| fi | ||
|
|
||
| FAILURES=0 | ||
| fail() { | ||
| echo "FAIL: $*" | ||
| FAILURES=$((FAILURES + 1)) | ||
| } | ||
|
|
||
| # poll <deadline-seconds> <function> — re-evaluate until success or timeout, | ||
| # allowing normal CR/BGP reconciliation to converge before asserting state | ||
| poll() { | ||
| local deadline=$((SECONDS + $1)); shift | ||
| until "$@"; do | ||
| if (( SECONDS >= deadline )); then | ||
| return 1 | ||
| fi | ||
| sleep 10 | ||
| done | ||
| } | ||
|
|
||
| nodes="$(oc get nodes -o name | wc -l)" | ||
|
|
||
| echo "[1/4] both BGP consumers own FRRConfiguration CRs in openshift-frr-k8s" | ||
| check_crs() { | ||
| oc get frrconfiguration -n openshift-frr-k8s bgp-vip receive-filtered &>/dev/null | ||
| } | ||
| if ! poll 120 check_crs; then | ||
| oc get frrconfiguration -n openshift-frr-k8s || true | ||
| fail "FRRConfigurations 'bgp-vip' and 'receive-filtered' not both present in openshift-frr-k8s" | ||
| fi | ||
|
|
||
| echo "[2/4] every node has an Established BGP session to the route reflector" | ||
| # The route reflector (external 'frr' container, 192.168.111.3) peers with | ||
| # every node. On the control plane the RouteAdvertisements-generated | ||
| # FRRConfiguration must be merged by the frr-k8s *static pods* (the frr-k8s | ||
| # DaemonSet does not run there), so established master sessions prove the | ||
| # static-pod CR merge works alongside the VIP configuration. | ||
| check_sessions() { | ||
| local established | ||
| established="$(${CLI} exec frr vtysh -c 'show bgp ipv4 unicast summary json' \ | ||
| | jq '[.peers[] | select(.state=="Established")] | length')" | ||
| [[ "${established:-0}" -eq "${nodes}" ]] | ||
| } | ||
| if ! poll 300 check_sessions; then | ||
| ${CLI} exec frr vtysh -c 'show bgp ipv4 unicast summary' || true | ||
| fail "route reflector does not have ${nodes} Established sessions (one per node)" | ||
| fi | ||
|
|
||
| echo "[3/4] every node's pod subnet is advertised to the route reflector" | ||
| # assert the exact per-node OVN subnets, not a route count: the reflector's | ||
| # table also carries unrelated prefixes (e.g. the agnhost network) | ||
| check_pod_subnets() { | ||
| local rr_routes subnet missing=0 | ||
| rr_routes="$(${CLI} exec frr vtysh -c 'show bgp ipv4 unicast json' | jq -r '.routes | keys[]')" | ||
| for subnet in $(oc get nodes -o jsonpath='{.items[*].metadata.annotations.k8s\.ovn\.org/node-subnets}' \ | ||
| | jq -r -s '.[].default[]' | grep -F . ); do | ||
| if ! grep -qx "${subnet}" <<< "${rr_routes}"; then | ||
| echo "pod subnet ${subnet} not (yet) at the route reflector" | ||
| missing=1 | ||
| fi | ||
| done | ||
| [[ "${missing}" -eq 0 ]] | ||
| } | ||
| if ! poll 300 check_pod_subnets; then | ||
| ${CLI} exec frr vtysh -c 'show bgp ipv4 unicast' || true | ||
| fail "not every node's pod subnet is advertised to the route reflector" | ||
| fi | ||
|
coderabbitai[bot] marked this conversation as resolved.
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| echo "[4/4] pod-network datapath over BGP: pod reaches the external agnhost" | ||
| # 172.20.0.100 lives behind the route reflector (agnhost macvlan network); | ||
| # the cluster imports it via the receive-filtered FRRConfiguration. A pod | ||
| # reaching it proves the RA datapath works on a BGP-VIP-managed cluster. | ||
| oc delete pod bgp-ra-datapath-check --ignore-not-found | ||
| if oc run bgp-ra-datapath-check --restart=Never --attach --rm --pod-running-timeout=5m \ | ||
| --image=registry.k8s.io/e2e-test-images/agnhost:2.53 --command -- \ | ||
| curl --max-time 20 -s --fail --show-error http://172.20.0.100:8000/hostname; then | ||
| echo "agnhost reachable from pod network" | ||
| else | ||
| fail "pod could not reach agnhost 172.20.0.100:8000 over the BGP-imported route" | ||
| fi | ||
|
|
||
| if [[ "${FAILURES}" -ne 0 ]]; then | ||
| echo "BGP VIP + OVN-K route advertisements coexistence verification failed with ${FAILURES} error(s)" | ||
| exit 1 | ||
| fi | ||
| echo "BGP VIP + OVN-K route advertisements coexistence verification passed" | ||
| EOF | ||
13 changes: 13 additions & 0 deletions
13
...talds/e2e/bgp-vip/ovn-bgp/verify/baremetalds-e2e-bgp-vip-ovn-bgp-verify-ref.metadata.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "path": "baremetalds/e2e/bgp-vip/ovn-bgp/verify/baremetalds-e2e-bgp-vip-ovn-bgp-verify-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "mkowalski", | ||
| "cybertron" | ||
| ], | ||
| "reviewers": [ | ||
| "mkowalski", | ||
| "cybertron" | ||
| ] | ||
| } | ||
| } |
17 changes: 17 additions & 0 deletions
17
...ry/baremetalds/e2e/bgp-vip/ovn-bgp/verify/baremetalds-e2e-bgp-vip-ovn-bgp-verify-ref.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ref: | ||
| as: baremetalds-e2e-bgp-vip-ovn-bgp-verify | ||
| from: dev-scripts | ||
| commands: baremetalds-e2e-bgp-vip-ovn-bgp-verify-commands.sh | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 100Mi | ||
| grace_period: 10m | ||
| documentation: |- | ||
| Verifies coexistence of BGP-based VIP management (enhancement 1982) and | ||
| OVN-Kubernetes BGP route advertisements on the same cluster: both | ||
| consumers' FRRConfiguration CRs exist, every node (including control | ||
| plane nodes served by frr-k8s static pods rather than the DaemonSet) | ||
| establishes a BGP session to the external route reflector, per-node pod | ||
| subnets are advertised to the reflector, and a pod reaches an external | ||
| endpoint over a BGP-imported route. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.