-
Notifications
You must be signed in to change notification settings - Fork 125
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
Introducing Netalloc plugin + E2E tests #1452
Merged
Merged
Conversation
This file contains 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
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milenco@cisco.com>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
ondrej-fabry
reviewed
Sep 4, 2019
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
ondrej-fabry
reviewed
Sep 5, 2019
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
ondrej-fabry
approved these changes
Sep 5, 2019
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
VladoLavor
approved these changes
Sep 6, 2019
VladoLavor
pushed a commit
to VladoLavor/vpp-agent
that referenced
this pull request
Oct 4, 2019
* Linux interface plugin enhancements Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * vpp ifplugin: exclude DHCP-assigned IPs from InterfaceAddressDescriptor Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Distinguish localclient from other kvdb data sources Signed-off-by: Milan Lenco <milenco@cisco.com> * Fix resync of EXISTING linux interfaces. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Netalloc plugin model and skeleton. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Netalloc descriptor. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Finalize Netalloc plugin. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Enable Netalloc features in VPP ifplugin Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Prepare mock netalloc plugin for unit testing. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Enable Netalloc features in Linux ifplugin. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Example demonstrating netalloc plugin Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Fix netalloc documentation. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Refactor netalloc plugin. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Allow to use netalloc'd IP addresses in Linux ARPs Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Allow to use netalloc'd IP addresses in Linux Routes. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Agent E2E tests Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Attempt to fix travis e2e tests. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Fix netalloc documentation. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Update cn-infra Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Integrate netalloc with vpp routes. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * E2E tests: run agent in a separate process Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Fix E2E tests. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * E2E tests: use REST API to wait for agent to initialize Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Address review comments. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech> * Add function to Linux ifidx to get interface by hostname. Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The ability to separate addresses from the rest of the network configuration is especially useful in scenarios where address allocations are provided externally, for example by another control-plane agent, IPAM tool or by CNI in containerized environments.
But for now, only netalloc model for IP addresses has been implemented. To allocate a new IP address, an instance of the proto message
IPAllocation
should be submitted into the vpp-agent through one of the supported NB transports (etcd, GRPC, ...) under the corresponding key. Network object which references (to-be or already) allocated IP address (e.g interface) will have a dependency on the corresponding key-value instance ofIPAllocation
and will read and apply the address only once it is available. Possible ways of how to referenceIPAllocation
from another model are listed here.The IP address allocation of netalloc plugin has been already integrated into all of the Linux models and into VPP interfaces. Note that the existing APIs have not been affected - IP addresses were and still are represented in models as strings. But apart from fixed IP addresses, they are now also allowed to symbolically reference addresses from netalloc model instances.
For example:
For more info, see api/models/netalloc/netalloc.proto
There is also a full example under examples/kvscheduler/netalloc
And also included in this PR are end-to-end tests (see 2. below), which also contain netalloc-targeted tests in tests/e2e/020_netalloc_test.go
This plugin, however, is a very fresh idea and very much open for further discussion and suggestions. The first application would be for Contiv-VPP to allocate IP addresses for ligato-based CNFs to attach to (i.e. CNF defines some topology of network items, but Contiv provides addresses that can be used to connect that with the rest of the cluster).
But even in single-agent scenarios this could be useful. By separating addresses from topology the configuration becomes easier to read and a change in addresses will automatically update all related items.
tests/e2e
.With every UT the VPP and agent are restarted as new processes. I added functions to start/stop microservices (containers with MICROSERVICE_LABEL defined), also added are methods to execute commands inside a microservice, ping IP from VPP or from microservice, check that the agent is in-sync with VPP and Linux, etc.