Development Environment with Rancher Desktop/containerd, Kaniko, Private Registry, and Okteto
I'm currently working on a new development environment. I'm building it around containerization and cloud native tools. The goal is to run k3s agents at home behind a VPN. Then, whenever I am online (VPN or wifi), the k3s agents connect to my laptop running a k3s master. Suddenly, my laptop becomes much much much more powerful.
Rancher Desktop Setup
Install Rancher Desktop. Be sure to select containerd and not (moby) for container management in Rancher Desktop preferences.
containerd
There are a lot of tools that are included with Rancher Desktop for working with containerd through CLI. One of those is nerdctl
which is basically just a replacement for docker
. I tried this and I ran into numerous problems. containerd
isn't Docker. It's not supposed to be or we would just use that. The new approach is to leverage what containerd
is good at. Find other tools to supplement what I need.
Kaniko (and buildkit-cli-for-kubectl)
These are separate things. Kaniko is its own set of tooling for building and deploying containers inside Kubernetes. This is exactly what I need. buildkit-cli-for-kubectl
is exactly what it sounds like. It's buildkit
as in Docker; however, it is intended to work with kubectl
in a kubernetes cluster. I could make this work for me, but I would not be using containerd. I decided Kaniko is the solution more suited for what I want to do. I may still use buildkit because it does sound interesting. It offers daemon support for building with Docker which is interesting in itself. It's just outside what I want right now.
Private Registry
One of the things Docker offers that most people take for granted is the local registry that comes with the Desktop. For example, when you use docker build .
, it creates a container and auto deploys to the local registry. When you type docker images
, you are being shown what's currently deployed to your local registry. With containerd
, you do not have this. The solution is to setup a local registry. There are a lot of options
- JFrog Artifactory
- this is a good option because now it can be used for multiple things)
- Docker
- Docker has a container called
registry:2
that can be used
- Docker has a container called
Okteto
Okteto is the icing here. It's a tool that allows using the k3s cluster for development environments by allowing environments to be deployed as pods to the cluster.
Congratulations @timesheets! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):
Your next target is to reach 50 replies.
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Check out the last post from @hivebuzz:
Support the HiveBuzz project. Vote for our proposal!