Kubernetes HomeLab Customizations and Extras
Updated: Dec 11, 2020
This post is intended to be a follow-up to Kubernetes Cluster Setup with Kubeadm. Here I will cover all of the completely optional customizations and extras that I install on my K8s HomeLab cluster which I find particularly useful. Many of these I'm guessing you wouldn't install in a production environment, but hey; this isn't prod, it's HomeLab.
To make it easier to connect, add the IP of your k8s-controller node to the hosts file of your local computer.
Helm is a package manager (like apt) but for Kubernetes.
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 chmod 700 get_helm.sh ./get_helm.sh
Zsh is very similar to bash, but with a ton of extra customizations. I use zsh as the primary shell on my MacBook, so why not have that same experience when I'm working on my K8s cluster. Besides, when I try to open a VS Code terminal it'll bark at me that it can't find zsh otherwise. ¯\_(ツ)_/¯
sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
When it asks if you want to change your default shell to zsh, answer Y.
Add Plugins and Customize!
VS Code is a free IDE with some really powerful extensions. Not only does it keep me from having to fuss with vi as much, but it also gives me graphical feedback on the status of my cluster. Install VS Code on your local machine, and then do the following...
Install these extension:
Remote - SSH
Remote - Containers
GitHub Pull Requests and Issues
You should get a notice to sign into GitHub.
You can also connect to Docker Hub by opening the Docker extension and clicking Connect Registry...
Finally, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and type ssh. This should filter down to Remote-SSH: Connect to Host...
Click + Add New SSH Host... and then type the ssh command to connect to your controller node.
Save the configuration to /home/[username]/.ssh/config when prompted.
The next time you open Remote-SSH: Connect to Host... you'll be able to just select the saved configuration.
You can tell you're connected by checking the far bottom left corner of VS Code. It should say SSH: k8s-controller.
Once connected, you may have to install some of your extension to the remote host.