Development Inside Kubernetes Part 1: Rancher Desktop

in #blog2 years ago (edited)

Development Inside Kubernetes Part 1: Rancher Desktop

In Development Environment with Rancher Desktop/containerd, Kaniko, Private Registry, and Okteto, I discussed a development environment built around containers, development of containers, and orchestration. An environment, where anything could be accomlished and would in all-likelihood be unified with production.

I am now going to review the steps of making that happen starting with setting up Rancher Desktop as a Docker Desktop replacement. We will

  • Install Rancher Desktop
  • Setup Traefik for ingress.
  • Setup a private container registry.
  • Use cert-manager to get a free SSL/TLS certificate.
  • Use kaniko to build and push container images.
  • Install okteto and use it to develop your application inside a kubernetes cluster.

Rancher Desktop

Rancher Desktop is software intended to replace Docker Desktop. It provides tools

  • nerdctl as in contai(nerdctl) is a cli replacement for docker
  • kubectl
  • helm
  • Dashboard

Installing it is as simple as going to the Rancher Desktop site and downloading the installer.

K3s

rancher-k8s-prefs.png

K3s is a small-footprint easy install of kubernetes that comes with Rancher Desktop. It includes a dashboard for managing resources.

Traefik

Traefik is an ingress manager that comes packaged with Rancher Desktop. After installation, the first thing you are going to want to do is enable Traefik. It is essential to being able to access resources inside

Containerd

This is one of the fundamentally important reasons to use Rancher Desktop. I love buildkit and moby, but they're tools and tools have a purpose. My purpose is containerization minimized which moby and buildkit are inherently bad at IMHO (leave comments below if you disagree).

Recently, Kubernetes-SIG decided to replace docker as the container runtime. They switched to containerd instead. This makes sense because containerd is included with docker. That is, docker uses it. It only makes sense to cut out the middle-man and go with the actual container runtime.

Rancher Desktop also offers containerd out-of-the-box. Just select it as your container runtime in the preferences, click "Apply", and you're good to go.

rancher-container-prefs.png

Next Time

At this point, you are setup with Rancher Desktop and Traefik. Next time, I will review our changes and show how I updated the environment making the Traefik Dashboard accessible and creating a certificate for my local environment development.