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

**URL:** https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154
**Category:** All about k0s
**Tags:** lens-desktop-kube, ldk
**Created:** [February 20, 2023, 4:35pm UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154 "2023-02-20T16:35:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jseletz](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jseletz](https://forums.k8slens.dev/u/jseletz)
#### Post date: [February 20, 2023, 4:35pm UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154/1 "2023-02-20T16:35:14Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![jnummelin](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jnummelin](https://forums.k8slens.dev/u/jnummelin)
#### Post date: [February 21, 2023, 10:38am UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154/2 "2023-02-21T10:38:31Z")

</div>

> [@jseletz](#):
>
> Can apps running inside LDK access apps running outside of K0s on localhost?

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?

---

<div class="post-metadata">

### Author: ![jseletz](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jseletz](https://forums.k8slens.dev/u/jseletz)
#### Post date: [February 21, 2023, 2:13pm UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154/3 "2023-02-21T14:13:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jakolehm](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@jakolehm](https://forums.k8slens.dev/u/jakolehm)
#### Post date: [February 22, 2023, 8:31am UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154/4 "2023-02-22T08:31:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jseletz](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jseletz](https://forums.k8slens.dev/u/jseletz)
#### Post date: [February 22, 2023, 1:43pm UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154/5 "2023-02-22T13:43:21Z")

</div>

> [@jseletz](#):
>
> can OpenEBS persistent volumes be configured to point to a folder under the home directory

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

---

<div class="post-metadata">

### Author: ![jakolehm](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@jakolehm](https://forums.k8slens.dev/u/jakolehm)
#### Post date: [February 22, 2023, 3:43pm UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154/6 "2023-02-22T15:43:48Z")

</div>

> [@jseletz](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![jseletz](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jseletz](https://forums.k8slens.dev/u/jseletz)
#### Post date: [February 22, 2023, 4:07pm UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154/7 "2023-02-22T16:07:04Z")

</div>

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?

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

```

---

<div class="post-metadata">

### Author: ![jakolehm](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@jakolehm](https://forums.k8slens.dev/u/jakolehm)
#### Post date: [February 23, 2023, 12:39pm UTC](https://forums.k8slens.dev/t/can-you-access-localhost-from-k0s-lens-desktop-kube-networking-and-local-filesystem/154/8 "2023-02-23T12:39:09Z")

</div>

> [@jseletz](#):
>
> 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?

Yes it should work without extra configuration.
