-
Notifications
You must be signed in to change notification settings - Fork 76
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
add basic OVS CNI plugin implementation #4
Conversation
88d48ee
to
bb0f93c
Compare
@dankenigsberg @yuvalif @SchSeba could you please review this? Thanks. |
27a1558
to
30244ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Just a few nits.
docs/cni-plugin.md
Outdated
* `name` (string, required): the name of the network. | ||
* `type` (string, required): "ovs". | ||
* `bridge` (string, required): name of the bridge to use. | ||
* `vlan` (integer, optional): VLAN ID of attached port. Opened for all if not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Opened for all/Trunk port/
# Create a new namespace | ||
ip netns add ns1 | ||
|
||
# Create OVS bridge on the host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add here how to install ovs or maybe just a note that ovs needs to be installed and running
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
## Go Tests | ||
|
||
This plugin also have Go test coverage. To run tests, Open vSwitch must be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this to the manual section maybe :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,82 @@ | |||
# Usage Example on Local Cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the provider I already created on the kubevirtci project? (KUBEVIRT_PROVIDER=k8s-multus-1.11.1)
Then the cluster-sync only needs to deploy the ovs plugin daemonset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
if netconf.BrName == "" { | ||
return nil, fmt.Errorf("\"bridge\" is a required argument") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also can we make a vlan validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is later validated by ovs-vsctl ovs-vsctl: constraint violation: 5555 is not in the valid range 0 to 4095 (inclusive)
, I think we should validate only necessary minimum, but I'm open to discuss it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok works for me.
Just connect container to an OVS bridge and give its port specified VLAN ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks and good job!
@SchSeba thanks a lot |
// this ensures that main runs only on main thread (thread group leader). | ||
// since namespace ops (unshare, setns) are done for a single thread, we | ||
// must ensure that the goroutine does not jump from OS thread to thread | ||
runtime.LockOSThread() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do you use network actions inside goroutines?
Resolves #2.
Just connect container to an OVS bridge and give its port specified VLAN ID.