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

Change linux default network-mode to user #4514

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

lilyLuLiu
Copy link
Contributor

@lilyLuLiu lilyLuLiu commented Dec 16, 2024

Currently, the Linux default network mode is system. But many issues happen due to different system situations.
For most user, user network mode already satisfied their demands. And user network mode no need to deal with complex system situations.
So after discuss, it's better to set user as default network-mode, making sure CRC works well in default.
If the user requires more functions, they can switch to system network mode.

@gbraad @praveenkumar @anjannath have agreed on this being needed.
It needs to start testing early during December.
In the worst case, we can revert before the new release in January.

@openshift-ci openshift-ci bot requested review from adrianriobo and gbraad December 16, 2024 08:09
Copy link

openshift-ci bot commented Dec 16, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign gbraad for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@rohanKanojia
Copy link
Contributor

@lilyLuLiu : Hello, Could you please provide some context on why this change is needed?

@lilyLuLiu lilyLuLiu self-assigned this Dec 18, 2024
@praveenkumar
Copy link
Member

/retest

@praveenkumar
Copy link
Member

@lilyLuLiu About integration failure I think https://github.com/crc-org/crc/blob/main/pkg/crc/network/types.go#L65 is culprit because settings only apply if we build binary for non installer, we need to change the default here also

@lilyLuLiu lilyLuLiu force-pushed the linux-networkmode branch 6 times, most recently from 8c8f346 to 1c56660 Compare December 31, 2024 03:32
@lilyLuLiu lilyLuLiu force-pushed the linux-networkmode branch 2 times, most recently from 92bdef8 to cfb029d Compare January 6, 2025 08:51
@lilyLuLiu lilyLuLiu force-pushed the linux-networkmode branch 5 times, most recently from b383170 to 99a0ff7 Compare January 7, 2025 10:59
@lilyLuLiu lilyLuLiu force-pushed the linux-networkmode branch 2 times, most recently from c89cf80 to e10b8d9 Compare January 13, 2025 07:56
@anjannath
Copy link
Member

/retest

Copy link

openshift-ci bot commented Jan 22, 2025

@lilyLuLiu: 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
ci/prow/e2e-crc 6b1ce3f link true /test e2e-crc

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@praveenkumar praveenkumar merged commit c108399 into crc-org:main Jan 23, 2025
28 of 36 checks passed
@karelyatin
Copy link

Hi with latest CRC release including this commit crc not starting, is that expected?
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.4 (Plow)
$ crc version
CRC version: 2.47.0+457b65
OpenShift version: 4.17.14
MicroShift version: 4.17.14

$ crc config view

  • consent-telemetry : no
  • cpus : 24
  • disk-size : 100
  • kubeadmin-password : 12345678
  • memory : 48000
  • pull-secret-file : /home/ocp_dev/install_yamls/devsetup/pull-secret.txt
  • skip-check-daemon-systemd-sockets : true
  • skip-check-daemon-systemd-unit : true

INFO Uncompressing /home/ocp_dev/.crc/cache/crc_libvirt_4.17.14_amd64.crcbundle
crc.qcow2: 19.43 GiB / 19.43 GiB [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%
oc: 158.81 MiB / 158.81 MiB [-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00%
Your system is correctly setup for using CRC. Use 'crc start' to start the instance

  • /home/ocp_dev/bin/crc start
    Is 'crc daemon' running? Cannot reach daemon API: Get "http://unix/api/version": dial unix /home/ocp_dev/.crc/crc-http.sock: connect: no such file or directory
  • /home/ocp_dev/bin/crc console --credentials
    Get "http://unix/api/webconsoleurl": dial unix /home/ocp_dev/.crc/crc-http.sock: connect: no such file or directory
    ++ /home/ocp_dev/bin/crc oc-env
    Machine does not exist. Use 'crc start' to create it

With explicitly setting network mode i t works fine:-
$ crc config set network-mode system
$ crc setup
$ crc start

@praveenkumar
Copy link
Member

@karelyatin did you use crc cleanup before using this latest version of CRC? can you try following and see if that works?

$ crc delete
$ crc cleanup
$ crc setup

Also you need to unset following settings

crc config unset skip-check-daemon-systemd-sockets
crc config unset skip-check-daemon-systemd-unit

@karlyan
Copy link

karlyan commented Feb 20, 2025

This break your own document: https://crc.dev/docs/networking/#setting-up-on-a-remote-server
It looks like in linux you change ip from 192.168.130.1 to 127.0.0.1. The haproxy can no longer bind with bind 0.0.0.0:6443

@gbraad
Copy link
Contributor

gbraad commented Feb 21, 2025 via email

@gbraad
Copy link
Contributor

gbraad commented Feb 21, 2025

I filed: crc-org/docs#26 and made a quick-fix in crc-org/docs#25


$ crc config set network-mode system

@karlyan
Copy link

karlyan commented Feb 21, 2025

Thanks for the response.
I like the current user mode. With this new fix I don't need to install haproxy and setup all these proxy config. In our case; we have a pipelline to create crc instance on gcp vm. Later we use ssh tunnel to forward the traffic to local mac machine. With the new user network; I can remove the haproxy code. Just the doc needs to change a little bit.

@gbraad
Copy link
Contributor

gbraad commented Feb 21, 2025

We will update the document, but have no indication when this would happen.
So, good to hear using ssh forwards works for you.

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

Successfully merging this pull request may close these issues.

7 participants