Can you access localhost from K0s - Lens Desktop Kube? Networking and local filesystem?

Can apps running inside LDK access apps running outside of K0s on localhost? With Docker Desktop K8s the localhost is exposed as host.docker.internal, is there something similar with LDK?

Also to use shared local volumes, can OpenEBS persistent volumes be configured to point to a folder under the home directory on the system?

You mean an app running in a pod accessing something running on the Linux VM outside of k8s via localhost?

Or by localhost, do you mean the host OS (osx, windows,…) which is running the main Lens app?

I mean the host OS, osx in this case. For example, the MySQL service is running on localhost:3306, and I want a pod inside the local k0s cluster to be able to connect to it.

You should be able to access the host OS (on macos/linux) using ip address “192.168.5.2”.

1 Like

Thanks, still also looking for an answer regarding mounting volumes backed by folders under the host OSX home directory?

Lens Desktop Kube profile create has an option to mount home folder from host OS. That probably would do the trick but I’m not sure if it is a good idea to use host OS disk for persistent volumes because it would be really slow.

Thanks. I typically side-car load war files into a tomcat webapps instance from a docker image built in our CI pipelines using an initContainer. For local K8s dev, I can just mount the local build dir and copy the war from there. Since this is just in an initContainer, performance is not an issue. Developer can just delete the pod to reload the war w/out having to redeploy.

I see the “Mount local homes folder” option in the profile, so if enabled, then a volume definition like this should work w/out extra configuration in LDK?

volumes:
   - name: host-mount
  hostPath:
    path: /Users/jayseletz/myproject/build

Yes it should work without extra configuration.