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

Re-enable GuestAgent for RD Networking #4556

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

Nino-K
Copy link
Member

@Nino-K Nino-K commented Apr 26, 2023

Guest Agent needs to run when the new Rancher Desktop Networking is enabled. It will be used to automate the port forwarding. Guest Agent will be listening for events from k8s, docker, and containerd's event API, upon discovery of the event it will be calling the port forwarding API on the host switch to open appropriate ports.

Related to: rancher-sandbox/rancher-desktop-agent#36
and
#4296

@Nino-K Nino-K requested a review from mook-as April 26, 2023 18:30
@Nino-K Nino-K modified the milestone: 1.9 Apr 26, 2023
@Nino-K Nino-K force-pushed the re-enable-guest-agent-rd-networking branch from 30e3873 to 7d8959b Compare April 26, 2023 18:39
if (this.privilegedServiceEnabled) {
if (rdNetworking) {
guestAgentConfig = {
LOG_DIR: await this.wslify(paths.logs),
Copy link
Contributor

Choose a reason for hiding this comment

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

LOG_DIR, GUESTAGENT_KUBERNETES, etc are all shared between all configs. Would it make sense to build the default map + overrides instead?

Or even merge rdNetworking || this.privilegedServiceEnabled, and just set GUESTAGENT_PRIVILEGED_SERVICE differently?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that would make more sense 👍

Signed-off-by: Nino Kodabande <nkodabande@suse.com>
@Nino-K Nino-K force-pushed the re-enable-guest-agent-rd-networking branch from 7d8959b to b245d59 Compare April 26, 2023 19:10
@Nino-K Nino-K requested a review from mook-as April 26, 2023 19:10
Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

The PR looks fine, but I'm having issues testing this (since this looks like it'll have non-obvious effects). When I turn on experimental network tunnel, wsl-init.pid isn't being written correctly.

That's not exactly requesting changes for this PR, but I can't tell if this would be a good change…

@Nino-K
Copy link
Member Author

Nino-K commented Apr 27, 2023

Tested this with both .exe and .msi and in all situations it was running as expected:
When RD networking is enabled on an admin install:

/usr/local/bin/rancher-desktop-guestagent -kubernetes=true -iptables=false -privilegedService=false -docker=true -containerd=false -k8sServiceListenerAddr=127.0.0.1 -debug 

When RD networking is enabled on a non-admin install:

/usr/local/bin/rancher-desktop-guestagent -kubernetes=true -iptables=false -privilegedService=false -docker=true -containerd=false -k8sServiceListenerAddr=127.0.0.1 -debug 

When RD networking is disabled on admin install:

/usr/local/bin/rancher-desktop-guestagent -kubernetes=true -iptables=false -privilegedService=true -docker=true -containerd=false -k8sServiceListenerAddr=127.0.0.1 -debug 

When RD networking is disabled on a non-admin install:

/usr/local/bin/rancher-desktop-guestagent -kubernetes=true -iptables=false -privilegedService=false -docker=true -containerd=false -k8sServiceListenerAddr=127.0.0.1 -debug 

@Nino-K Nino-K merged commit 05a20a8 into main Apr 27, 2023
@Nino-K Nino-K deleted the re-enable-guest-agent-rd-networking branch April 27, 2023 20:42
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.

2 participants