rancher-desktop-agent

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2022 License: Apache-2.0

README

Rancher Desktop Agent

The Rancher Desktop guest agent runs in Rancher Desktop VMs providing helper services. It currently has the following functionality:

containerd port forwarding (WSL)

In Windows Subsystem for Linux, WSL automatically forwards ports opened on 127.0.0.1 or 0.0.0.0 by opening the corresponding port on 127.0.0.1 on the host (running Windows). However, containerd (as configured by nerdctl) just sets up iptables rules rather than actually listening, meaning this isn't caught by the normal mechanisms. Rancher Desktop Agent therefore creates the listeners so that they get picked up and forwarded automatically. Note that the listeners will never receive any traffic, as the iptables rules are in place to forward the traffic before it reaches the application. This is not necessary for Lima, as that already does the iptables scanning (the core of the code has been lifted from Lima).

Kubernetes NodePort forwarding

In newer versions of Kubernetes†, kubelet no longer creates a listener for NodePort services. We therefore need to create those listeners manually, so that port forward works correctly as in the container port forwarding above.

† 1.21.12+, 1.22.10+, 1.23.7+, 1.24+

Directories

Path Synopsis
cmd
rancher-desktop-guestagent command
Rancher-desktop-guestagent implements an agent that runs instead of the Rancher Desktop VM (whether WSL-based on Windows, or Lima-based on mac/Linux).
Rancher-desktop-guestagent implements an agent that runs instead of the Rancher Desktop VM (whether WSL-based on Windows, or Lima-based on mac/Linux).
pkg
containerd
Package containerd handles port binding events from containerd API
Package containerd handles port binding events from containerd API
docker
Package docker handles port binding events from docker events API
Package docker handles port binding events from docker events API
forwarder
Package forwarder implements a forwarding mechanism to forward port mappings over Vtunnel.
Package forwarder implements a forwarding mechanism to forward port mappings over Vtunnel.
iptables
Package iptables handles forwarding ports found in iptables dnat
Package iptables handles forwarding ports found in iptables dnat
kube
Package kube watches Kubernetes for NodePort services and forces a listener on 127.0.0.1, so that it can be picked up by the automatic port forwarding mechanisms found in WSLv2 and Lima.
Package kube watches Kubernetes for NodePort services and forces a listener on 127.0.0.1, so that it can be picked up by the automatic port forwarding mechanisms found in WSLv2 and Lima.
tcplistener
Package tcplistener implements a TCP listener
Package tcplistener implements a TCP listener
tracker
Package tracker implements a tracking mechanism to keep track of the ports during various container event types e.g start, stop
Package tracker implements a tracking mechanism to keep track of the ports during various container event types e.g start, stop
types
Package types maintains common types that are used across different packages.
Package types maintains common types that are used across different packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL