Discover reasons why top companies like Replicated buy instead of build their dev platform
Watch the Webinar Recording

Lightweight Kubernetes development with k3s and Okteto

A couple of days ago, Rancher labs released k3s, a lightweight, fully compliant production-grade Kubernetes. The entire thing runs out of a 40MB binary, runs on x64 and ARM, and even from a docker-compose. Saying that this is a great engineering feat is an understatement.

I tried it out as soon as I saw the announcement. I expected their initial release to show promise, but to be rough around the edges. Was I in it for a surprise!

I decided to go with the docker-compose way so I didn’t have to deal with downloads, configs, and all that. I went ahead, got the compose manifest, and launched it.

$ mkdir ~/k3s
$ curl > ~/k3s/docker-compose.yml
$ cd ~/k3s
$ docker-compose up -d
Starting k3s_node_1 ... done
Starting k3s_server_1 ... done

After about 30 seconds, I had my k3s instance up and running.

k3s’ docker-compose drops the kubeconfig file in the same folder you started it at. Great pattern!

$ export KUBECONFIG=~/k3s/kubeconfig.yaml
$ kubectl --kubeconfig kubeconfig.yaml get node (k3s/default)
df305e6358a6 Ready \<none> 5m16s v1.13.3-k3s.6

Once your cluster is ready, install Rancher's local path provisioner, so we can use the local storage of your k3s node.

$ kubectl apply -f [](

$ kubectl get storageclass
local-path (default) 50s

We built okteto to quickly create development environments in your kubernetes cluster. k3s is a fully compliant Kubernetes distro. Will they work together? Only one way to figure it out (full disclosure: I’m one of Okteto's founders).

For this experiment, I went with our Python Sample App. I cloned the repository and deployed the app with kubectl.

$ git clone
$ cd python-getting-started
$ kubectl apply -f manifests
deployment.apps/hello-world created
service/hello-world created

Once the application is ready, I used okteto to launch my development environment in my k3s instance (install okteto from here).

$ okteto up
 ✓ Development environment activated
 ✓ Files synchronized
    Name:      hello-world
    SSH:       51553 -> 2222
    Forward:   8080 -> 8080
    Reverse:   3500 <- 3500

Starting hello-world server...
 * Serving Flask app "app" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on (Press CTRL+C to quit)

With the application now running, I fired up my browser and went to http://localhost:8080 to see the app up and running.

Finally, I went ahead and did some mock dev work to try my entire workflow. I opened the file in VS Code and modified the response message on line 7 to be Hello world from the cluster!. Save your changes.

def hello_world():
    return 'Hello world from the cluster!'

I went back to the browser. The changes were automatically reloaded (thanks to python hot reloader) without having to build a container, pick a tag, redeploy it or even refresh my browser! 😎


k3s is an amazing product. It has some issues (I couldn't get outbound network connections to work). But If this is the first release, I can't wait and see what they come up with in the near future.

Kudos to the team at Rancher for taking the fully compliant approach. With this, their users can leverage the entire ecosystem from day one!

Ramiro BerrellezaCEO & Co-founder View all posts

Automate Provisioning Any Dev Resource on Any Cloud Provider With Pulumi and Okteto

The Value It is common in today's landscape to build microservices-based applications that leverage resources like RDS databases, storage buckets, etc...

October 19, 2023
Avatar of Arsh SharmaAvatar of Arsh SharmaArsh Sharma

How Developers Can Seamlessly Collaborate When Building Microservice Apps

Building microservices based applications is inherently challenging. Given the multitude of components involved, it is unrealistic to expect any individual...

October 10, 2023
Avatar of Arsh SharmaAvatar of Arsh SharmaArsh Sharma