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

Add support for Kind OVNK IPV6 deployment #1751

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

yboaron
Copy link
Contributor

@yboaron yboaron commented Nov 18, 2024

@submariner-bot
Copy link

🤖 Created branch: z_pr1751/yboaron/ovn_add_ipv6

@yboaron
Copy link
Contributor Author

yboaron commented Nov 19, 2024

@mkolesnik , QQ: I'm getting [1] error when trying to deploy Kind clusters with OVNK and IPV6 with this PR(with make clusters using=ipv6-stack,ovn), while running directly ./ovn-kubernetes/contrib/kind.sh .... things looks fine, any idea ?

[1]
[cluster2] ++ sysctl net.ipv6.conf.all.forwarding [cluster1] ++ sysctl net.ipv6.conf.all.forwarding [cluster2] ++ awk '{print $3}' [cluster1] ++ awk '{print $3}' [cluster2] + TMPVAR=0 [cluster2] + echo 'net.ipv6.conf.all.forwarding is equal to 0' [cluster2] net.ipv6.conf.all.forwarding is equal to 0 [cluster2] + '[' 0 '!=' 1 ']' [cluster1] + TMPVAR=0 [cluster2] + '[' true == true ']' [cluster2] + sudo sysctl -w net.ipv6.conf.all.forwarding=1 [cluster1] + echo 'net.ipv6.conf.all.forwarding is equal to 0' [cluster1] net.ipv6.conf.all.forwarding is equal to 0 [cluster1] + '[' 0 '!=' 1 ']' [cluster1] + '[' true == true ']' [cluster1] + sudo sysctl -w net.ipv6.conf.all.forwarding=1 [cluster2] sysctl: permission denied on key "net.ipv6.conf.all.forwarding" [cluster1] sysctl: permission denied on key "net.ipv6.conf.all.forwarding" [cluster2] Failed to run './ovn-kubernetes/contrib/kind.sh -ov localhost:5000/ovn-daemonset-f:latest -cn cluster2 -ric -n4 -i6 -sw -lr

Copy link

github-actions bot commented Dec 5, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further
activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 5, 2024
@tpantelis tpantelis removed the stale label Dec 10, 2024
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further
activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 25, 2024
@github-actions github-actions bot closed this Jan 1, 2025
@submariner-bot
Copy link

🤖 Closed branches: [z_pr1751/yboaron/ovn_add_ipv6]

@yboaron yboaron reopened this Jan 6, 2025
@submariner-bot
Copy link

🤖 Created branch: z_pr1751/yboaron/ovn_add_ipv6

This PR depends on ovn-kubernetes PR [1]

[1]
ovn-kubernetes/ovn-kubernetes#4955

Signed-off-by: Yossi Boaron <[email protected]>
@yboaron yboaron marked this pull request as ready for review January 12, 2025 14:21
@@ -4,7 +4,7 @@ FROM fedora:41
# good balance between compression time and resulting image size.
ARG UPX_LEVEL=-5
ENV DAPPER_HOST_ARCH=amd64 SHIPYARD_DIR=/opt/shipyard SHELL=/bin/bash \
DAPPER_RUN_ARGS="--net=kind"
DAPPER_RUN_ARGS="--net=kind --cap-add=NET_ADMIN --privileged=true"
Copy link
Contributor Author

@yboaron yboaron Jan 12, 2025

Choose a reason for hiding this comment

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

We only need the extra networking permissions to container for OVN/IPV6 deployment.

@mkolesnik @skitt , is it possible to set DAPPER_RUN_ARGS content based on CNI, IP family env vars ?

Copy link
Member

Choose a reason for hiding this comment

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

DAPPER_RUN_ARGS is a bit of a cheat — it’s not used as an environment variable as such inside the container, so nothing running in the container can set it meaningfully. The .dapper scripts extracts the value of the variable from the container image before running it.

However since we decide what .dapper does, anything can be done. Could you explain what the exacts criteria (as in, which values in which files) are and which containers need to run with privileges?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For IPV6 OVN deployment (make clusters using=ipv6-stack,ovn) OVN-K script [1] sets net.ipv6.conf.all.forwarding and sudo sysctl -w net.ipv6.conf.all.disable_ipv6 .
so, container should run with net privileges.

[1]
https://github.com/ovn-kubernetes/ovn-kubernetes/blob/master/contrib/kind.sh#L642

Copy link
Member

Choose a reason for hiding this comment

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

It only does so if the values don’t match what it expects. Unfortunately GH doesn’t enable IPv6 forwarding by default, so changing that would be necessary.

However it would be possible to do this as an extra step before running the jobs, instead of making the containers themselves privileged…

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only does so if the values don’t match what it expects

Yep, without net privileges we can't even read kernel's ipv6 config (sysctl net.ipv6.conf.all.forwarding)

However it would be possible to do this as an extra step before running the jobs, instead of making the containers themselves privileged…

Maybe I'm missing something here, this idea will be useful only on GH, will it be possible to deploy Kind+IPV6,OVN locally without making the containers privileged?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, without net privileges we can't even read kernel's ipv6 config (sysctl net.ipv6.conf.all.forwarding)

That’s surprising, it works for me and should work fine as long as /proc/sys is mounted in the container (sysctl literally only reads from that).

Copy link
Member

Choose a reason for hiding this comment

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

For local deployments, we can check the settings early and give an appropriate error, same as for other sysctl settings. In most cases I expect developer machines will be set up with IPv6 enabled and forwarded anyway.

Workaround until commit [1] is delivered in ovn-kubernetes branch

[1]
ovn-kubernetes/ovn-kubernetes#4955

Signed-off-by: Yossi Boaron <[email protected]>
@skitt
Copy link
Member

skitt commented Jan 17, 2025

Would it be possible to add an IPv6 deployment in the deployment tests, to check that this does what is expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants