I'm trying to use Lens on my Windows PC, and my Kubernetes master node is running on a Raspberry Pi 4. The way I've set it up is by sharing the folder containing the config.yaml file over the network so I can access it from Lens on my PC. However, I'm new to this and wondering if there's an easier or better way to set it up. Any advice?
3 Answers
If your devices are on the same network, you should consider exposing the Kubernetes API server externally. Change the server address in the config file from `127.0.0.1:6443` to your Raspberry Pi's IP followed by `:6443`. Also, make sure to bind the kube-apiserver to `0.0.0.0` instead of just `127.0.0.1`. Check out the documentation for more details on this setup!
It sounds like you're overcomplicating things a bit. Instead of using a network share, you can create a `.kube` folder in your `C:Usersyourusername` directory on Windows. Then copy the contents of your k3s.yaml file from the Raspberry Pi into a file named `config` within that folder. Your config path should look like this: `C:Usersyourusername.kubeconfig`. Lens should automatically detect this, but make sure to replace any `127.0.0.1` IPs in the k3s.yaml file with your Pi's actual IP address on the network.
Wait, hold on! What `.yaml` file are you using? If it's the `/etc/rancher/k3s/config.yaml`, that makes sense, but I'd recommend just going for a local setup unless you have a strong reason for using a network folder. It might be simpler to set it up directly on your Windows machine as others have suggested!
Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux