https://rancher.com/ logo
Title
n

nutritious-application-85076

06/23/2022, 2:33 PM
The Dashboard of rancher desktop shows for a node its internal IP Address
apiVersion: v1
kind: Node
metadata:
  annotations:
    <http://alpha.kubernetes.io/provided-node-ip|alpha.kubernetes.io/provided-node-ip>: 192.168.205.2
Nevertheless this IP address do not correspond to the Lima VM Eth0 IP
lima-rancher-desktop:/Users/cmoullia$ ifconfig
eth0      Link encap:Ethernet  HWaddr 52:55:55:4A:B8:EC
          inet addr:192.168.5.15  Bcast:0.0.0.0  Mask:255.255.255.0
So I'm wondering where this IP is configured and if we can access it from the local machine (= macbook) ?
f

freezing-airplane-30363

06/23/2022, 2:41 PM
Hi, strange, on Linux I can see that RD node Internal IP is the same as lima's eth0 IP
n

nutritious-application-85076

06/23/2022, 2:43 PM
I cannot ping the IP Address from my mac's terminal
f

freezing-airplane-30363

06/23/2022, 2:43 PM
also the annotation on the node is different than yours, are you using correct context/cluster for kubectl?
n

nutritious-application-85076

06/23/2022, 2:43 PM
ping 192.168.205.2 PING 192.168.205.2 (192.168.205.2): 56 data bytes Request timeout for icmp_seq 0
Yes
kubectx
cmoullia/c114-e-eu-de-containers-cloud-ibm-com:32429/IAM#cmoullia@redhat.com
default/c114-e-eu-de-containers-cloud-ibm-com:32429/IAM#cmoullia@redhat.com
kind-kind
kubernetes-admin@kubernetes
--> "rancher-desktop"

and 

k get nodes
NAME                   STATUS   ROLES                  AGE    VERSION
lima-rancher-desktop   Ready    control-plane,master   143d   v1.21.9+k3s1
f

freezing-airplane-30363

06/23/2022, 2:45 PM
this is from my RD 1.4.1 on Linux:
$ kubectl get nodes -o wide
NAME                   STATUS   ROLES                  AGE   VERSION        INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION   CONTAINER-RUNTIME
lima-rancher-desktop   Ready    control-plane,master   27h   v1.23.6+k3s1   192.168.5.15   <none>        Alpine Linux v3.15   5.15.40-0-virt   <containerd://1.5.11>
n

nutritious-application-85076

06/23/2022, 2:46 PM
on macos
k get nodes -o wide
NAME                   STATUS   ROLES                  AGE    VERSION        INTERNAL-IP     EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION   CONTAINER-RUNTIME
lima-rancher-desktop   Ready    control-plane,master   143d   v1.21.9+k3s1   192.168.205.2   <none>        Alpine Linux v3.15   5.15.40-0-virt   <containerd://1.5.11>
f

freezing-airplane-30363

06/23/2022, 2:46 PM
anyway I'd recommend you to do RD update - the node lives 143d days and I'd say lot of things changed in meantime
n

nutritious-application-85076

06/23/2022, 2:47 PM
I'm using RD - 1.4.1
Will reset ti
f

freezing-airplane-30363

06/23/2022, 2:49 PM
I'd do factory reset via RD UI if possible - that should pull everything from scratch
n

nutritious-application-85076

06/23/2022, 2:51 PM
k get nodes -o wide
NAME                   STATUS   ROLES                  AGE     VERSION        INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION   CONTAINER-RUNTIME
lima-rancher-desktop   Ready    control-plane,master   2m31s   v1.21.9+k3s1   192.168.5.15   <none>        Alpine Linux v3.15   5.15.40-0-virt   <containerd://1.5.11>
 ~  ping 192.168.5.15
PING 192.168.5.15 (192.168.5.15): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
f

freezing-airplane-30363

06/23/2022, 2:53 PM
ok, the node has right ip now - ping doesn't work to lima VM as it using qemu user networking which doesn't support ICMP
... you may run
rdctl shell
to get into lima shell
n

nutritious-application-85076

06/23/2022, 2:55 PM
I can ssh
rdctl shell
lima-rancher-desktop:/Users/cmoullia$ ifcofig
/bin/ash: ifcofig: not found
lima-rancher-desktop:/Users/cmoullia$ ifconfig
cni0      Link encap:Ethernet  HWaddr E6:D9:93:FB:DE:B2
          inet addr:10.42.0.1  Bcast:10.42.0.255  Mask:255.255.255.0
          inet6 addr: fe80::e4d9:93ff:fefb:deb2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1
          RX packets:8242 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8665 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1859556 (1.7 MiB)  TX bytes:2949775 (2.8 MiB)

eth0      Link encap:Ethernet  HWaddr 52:55:55:4A:B8:EC
          inet addr:192.168.5.15  Bcast:0.0.0.0  Mask:255.255.255.0
f

freezing-airplane-30363

06/23/2022, 2:56 PM
perfect, now it looks good to me
n

nutritious-application-85076

06/23/2022, 3:02 PM
Is there an traefix ingress example that I could test ?
I deployed the following exemple but cannot access the route from my local macos using http://whoami.192.168.5.15.nip.io/ -> https://gist.github.com/cmoulliard/c53df84d1e9199cad18a0cfbdb0d5334
Question: Is it possible to access from Google Chrome opened within my laptop (= my mac running rancher desktop) the IP address of the Lima VM =
192.168.5.15
as on my mac the IP address is
192.168.1.90
?
f

freezing-airplane-30363

06/23/2022, 4:12 PM
No, traffic is forwarded to 127.0.0.1 so use eg.
- host: <http://myhost.127.0.0.1.nip.io|myhost.127.0.0.1.nip.io>
then you should be able open in browser http://myhost.127.0.0.1.nip.io
f

fast-garage-66093

06/23/2022, 4:19 PM
There seems to be some confusions about the internal network (eth0, always
192.168.5.0/24
, and the additional networks supported on macOS (bridged and shared) (interfaces
rd0
and
rd1
). The additional interfaces are "real" interfaces and don't use port forwarding, but are only available when you enable "administrative" access ("sudo").
This is an image from our Lima talk, but it applies to Rancher Desktop too (but just one VM):
Rancher Desktop will try to use the bridged network, if it got an IPv4 address. Sometimes that doesn't work for local networking reasons; then it will fall back to the shared network, and if that also doesn't work (or if "sudo" was not enabled), it uses the internal qemu network that is not routable from the host, but relies on port forwarding.
The
192.168.205.2
address is from the shared network range, so should have been reachable from inside the host, but not from other machines on the local network. I don't know why this didn't work for you, and it is too late now to investigate since you reset the configuration.
(Rancher Desktop configures the shared network to use the
192.168.205.0/24
subnet so it doesn't conflict if you also run regular lima side-by-side with it).
n

nutritious-application-85076

06/23/2022, 4:38 PM
I will enable
sudo
and do another test. That should be great to better document how networks are configured between the host and VMs like also that someone add a getting started real example using traefix ;-)
I do --> • Allow sudo access • Get the IP address
IP=$(get node/lima-rancher-desktop -o json | jq ".status.addresses[0].address")
• Set up the ingress host to :
<http://whoami.192.168.205.2.nip.io/>
• Access from my browser
<http://whoami.192.168.205.2.nip.io/>
f

fast-garage-66093

06/23/2022, 5:00 PM
And, is it working?
Quick check if you can reach traefik:
$ curl -k https://$(kubectl get svc traefik -n kube-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
404 page not found
The
404
means it worked 🙂 Otherwise you would have gotten connection refused or some other lower level error. If you can make an https connection, it means you have reached the ingress controller
n

nutritious-application-85076

06/23/2022, 5:22 PM
And, is it working?
Yes 🙂
😛artyparrot: 1
f

fast-garage-66093

06/23/2022, 5:23 PM
Good; glad to hear that! 🙂
n

nutritious-application-85076

06/23/2022, 5:34 PM
curl -k https://$(kubectl get svc traefik -n kube-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
404 page not found
👍 1