Skip to content
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

Feat(eos_designs)!: Improve logic for BGP configuration of network services VRFs #4358

Conversation

ClausHolbechArista
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista commented Aug 13, 2024

Change Summary

Feat(eos_designs)!: Improve logic for BGP configuration of network services VRFs

Related issue(s)

Fixes #3052

Component(s) name

arista.avd.eos_designs

Proposed changes

New improve logic for BGP configuration of network services VRFs

AVD versions below 5.0.0 did not generate BGP configuration for VRFs unless the node type included evpn or mpls under default_address_families and the
VRF had the same evpn or mpls defined under address_families (default is ['evpn']).

AVD version 4.6.0 introduced the toggle new_network_services_bgp_vrf_config: <bool; default=false> to change this behavior by no longer requiring evpn
in the address-families, but instead it always configured BGP for all VRFs. This toggle has been removed in AVD 5.0.0 since this is now part of the default
behavior.

With AVD version 5.0.0, the logic of whether to configure BGP for a network services VRF has been improved with the following rules:

  • New: Honor the new optional bgp.enabled setting, to either always or never configure BGP for the VRF.
  • Existing: If the VRF is part of an overlay (evpn or mpls), BGP will be configured for the VRF.
  • New: If any BGP peers are configured under the VRF, BGP will be configured for the VRF. This is useful for L2LS designs with VRFs.
  • Improved: If uplink type is p2p-vrfs and the VRF is included in the uplink VRFs, BGP will be configured for the VRF.

It is possible to forcefully add or remove BGP configuration per VRF by setting:

<network_services_key e.g. tenants>:
  - name: mytenant
    vrfs:
      - name: myvrf
        bgp:
          enabled: <bool>  # <-- New optional setting to either always or never configure BGP for the VRF

How to test

Adjusted the exisisting tests to produce same outputs by exercising the new bgp.enabled knob

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@ClausHolbechArista ClausHolbechArista requested review from a team as code owners August 13, 2024 13:28
@github-actions github-actions bot added type: documentation Improvements or additions to documentation state: Documentation role Updated role: eos_designs issue related to eos_designs role labels Aug 13, 2024
Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4358
# Activate the virtual environment
source test-avd-pr-4358/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/ClausHolbechArista/avd.git@refactor/eos_designs/flip-default-of-new_network_services_bgp_vrf_config#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/ClausHolbechArista/avd.git#/ansible_collections/arista/avd/,refactor/eos_designs/flip-default-of-new_network_services_bgp_vrf_config --force
# Optional: Install AVD examples
cd test-avd-pr-4358
ansible-playbook arista.avd.install_examples

@ClausHolbechArista ClausHolbechArista force-pushed the refactor/eos_designs/flip-default-of-new_network_services_bgp_vrf_config branch from 7ba3c33 to 5e18583 Compare August 14, 2024 07:37
@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Aug 14, 2024
@ClausHolbechArista ClausHolbechArista changed the title Refactor(eos_designs): Flip default value of new_network_services_bgp_vrf_config to true Feat(eos_designs)!: Improve logic for BGP configuration of network services VRFs Aug 14, 2024
@github-actions github-actions bot added the state: conflict PR with conflict label Aug 16, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@laxmikantchintakindi
Copy link
Contributor

LGTM. Tested by setting 'bgp:false' on vrf NOT_WAN_VRF in ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml.

@ClausHolbechArista ClausHolbechArista force-pushed the refactor/eos_designs/flip-default-of-new_network_services_bgp_vrf_config branch from d967492 to 0c26f39 Compare August 20, 2024 05:59
@github-actions github-actions bot removed the state: conflict PR with conflict label Aug 20, 2024
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@ClausHolbechArista ClausHolbechArista added the one approval This PR has one approval and is only missing one more. label Aug 20, 2024
@ClausHolbechArista ClausHolbechArista added this to the v5.0.0 milestone Aug 21, 2024
@ClausHolbechArista ClausHolbechArista force-pushed the refactor/eos_designs/flip-default-of-new_network_services_bgp_vrf_config branch from 20fe937 to 82ec573 Compare August 23, 2024 08:16
@ClausHolbechArista ClausHolbechArista marked this pull request as draft August 26, 2024 07:06
@ClausHolbechArista
Copy link
Contributor Author

Moving to draft while fixing mlag

@ClausHolbechArista ClausHolbechArista marked this pull request as ready for review August 26, 2024 10:13
@ClausHolbechArista ClausHolbechArista removed the one approval This PR has one approval and is only missing one more. label Aug 27, 2024
@ClausHolbechArista ClausHolbechArista requested a review from a team August 27, 2024 07:36
@github-actions github-actions bot added the state: conflict PR with conflict label Aug 29, 2024
@ClausHolbechArista
Copy link
Contributor Author

does this fix #3052 completely?

It was confirmed by the submitter who tested this PR :)

@ClausHolbechArista ClausHolbechArista force-pushed the refactor/eos_designs/flip-default-of-new_network_services_bgp_vrf_config branch from f80a880 to 144cea0 Compare September 2, 2024 12:46
@github-actions github-actions bot removed the state: conflict PR with conflict label Sep 2, 2024
Copy link

github-actions bot commented Sep 2, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link

sonarqubecloud bot commented Sep 3, 2024

@ClausHolbechArista ClausHolbechArista merged commit 8eb7a5c into aristanetworks:devel Sep 3, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn: Feat(eos_designs)! role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated type: documentation Improvements or additions to documentation
Projects
None yet
4 participants