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

Mount OVS socket unconditionally #861

Merged
merged 1 commit into from Nov 11, 2021

Conversation

rhrazdil
Copy link
Collaborator

Signed-off-by: Radim Hrazdil rhrazdil@redhat.com

Is this a BUG FIX or a FEATURE ?:

Uncomment only one, leave it on its own line:

/kind bug
/kind enhancement

What this PR does / why we need it:

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/S labels Oct 27, 2021
@rhrazdil
Copy link
Collaborator Author

/uncc @bcrochet
/cc @qinqon

@@ -6,12 +6,28 @@ kubectl=./cluster/kubectl.sh

source ./cluster/sync-common.sh

function __yq() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we enable this by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It requires OVS to be installed, otherwise handlers fail

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make it to fail gracefully / detect OVS on runtime?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe detect whether the OVS socket is available while starting and based on it, set the variable. (I don't know how it is implemented now, so sorry if I'm totally off)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've discussed with @qinqon that it would probably make sense to expose this knob
to the user, to decide whether or not the handlers should attempt to mount the ovs socket.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENABLE_OVS causes us to try to mount the OVS socket from the host, and if nmstate finds the socket, it tries to use it, right?

I think we could make the mount unconditioned, possibly by mounting the whole directory with DirectoryOrCreate. That should be enough, no? It is not great that we would create a directory on host, but it would give us this flexibility.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting point. According to the docs, specifying no type at all performs no checks, which would also solve the empty directory (although that should be harmless).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd be even better o/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But what will do nmstate it find that we have a fake socket for ovs ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There would be no socket, Kubernetes will only mount an empty directory.

Mout ovs socket with unspecified type, which doesn't
check it's actual existence on the host.

Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com>
@rhrazdil
Copy link
Collaborator Author

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 27, 2021
@kubevirt-bot
Copy link
Collaborator

@rhrazdil: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-nmstate-e2e-handler-k8s-future 7df5d5f link false /test pull-kubernetes-nmstate-e2e-handler-k8s-future

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@qinqon
Copy link
Member

qinqon commented Nov 11, 2021

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 11, 2021
@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qinqon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 11, 2021
@qinqon
Copy link
Member

qinqon commented Nov 11, 2021

/hold cancel
@rhrazdil has manually test it.

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 11, 2021
@rhrazdil
Copy link
Collaborator Author

We'll want to extend our e2e test with a scenario that creates ovs-bridge with primary nic connected to it as a port as well as a veth pair connecting linux-bride to the ovs-bridge.
However, this is currently blocked by an nmstate bug that causes removing ovs-bridge to fail (sometimes).
Let's include this scenario when https://bugzilla.redhat.com/show_bug.cgi?id=2012420 is resolved

@oshoval
Copy link
Collaborator

oshoval commented Apr 14, 2022

You might want please to change PR title, it is outdated comparing to the commit that was pushed as part of this PR
"Mount ovs socket unconditionally"

(just saw while trying to learn the flow)

@rhrazdil rhrazdil changed the title Set ENABLE_OVS var when deploying knmstate with cluster-sync Mount OVS socket unconditionally Apr 14, 2022
@relyt0925
Copy link

This PR looks to have broken non OVS providers (specifically calico) is there a way to revert it?

@phoracek
Copy link
Member

phoracek commented May 19, 2022

@relyt0925 I believe that this PR is the one that fixed that usecase. With removal of "type: Socket", the mount does not fail when the socket does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants