Start your free 14-day ContainIQ trial

Using Okteto | A Kubernetes Development Platform

In this guide, we highlight Okteto, a Kubernetes development platform, that offers a number of tools for simplifying the development process.

August 9, 2022
Kumar Harsh
Software Developer

Container orchestration technologies such as Kubernetes give application owners a lot of power and control over how their applications are deployed and distributed to users. But fully understanding how to use them can take a while.

Some might argue that Kubernetes isn’t supposed to be a part of the development process — that it falls under DevOps. However, if you’re a developer working on an app that gets deployed in containers, you need access to a staging environment of your production clusters, so you can test your apps properly before they are sent out to users.

Kubernetes development platforms can simplify this process. Okteto is one such platform — it enables you to create recyclable namespaces on the fly and sync your local and remote code repositories for testing. In this post, we’ll explore the tool in detail and help you determine whether it’s the right fit for your use case.

How Does Okteto Work?

Okteto offers a number of solutions that help you be more productive when working on Kubernetes-based apps, and it provides a quick way to create and connect to remote Kubernetes clusters (namespaces, technically speaking) on its cloud that is unique to you. You can use these clusters to test your app in a production-like setup before moving ahead. This can immensely reduce test decision times.

And recyclable Kubernetes clusters aren’t limited to the Okteto cloud. You can also use the Okteto CLI to connect with any context and create disposable namespaces on it for quick deployment and testing.

Disposable Kubernetes namespaces on remote and/or on-prem clusters have several benefits that we will share in the following sections. Okteto goes so far as to enable you to launch Kubernetes environments, SSH into them, and develop remotely.

Key Features

Here are some of the most important features that Okteto offers:

  • Quick and Simple Sandboxes: Okteto enables you to spin up ready-to-use namespaces on local or remote Kubernetes clusters to deploy and test your applications.
  • Deployment Previews: You can configure Okteto to automatically generate deployment previews as you create pull requests in your version-control systems to view your changes in action.
  • Remote Development Experience: With Okteto and an IDE like Visual Studio Code, you can spin up remote development containers, SSH into them, and develop your apps.

Installation & Support

Setting up Okteto is quite simple. You begin by using your GitHub account to log into the web UI. Once you’re logged in, you’ll see the dashboard.

First-time dashboard
First-time dashboard

There are many ways to deploy your dev environment.

Env deployment options
Env deployment options

At its root, your project needs to have an <terminal inline>okteto.yml<terminal inline> file that defines the details for your dev environment. This is what a sample <terminal inline>okteto.yml<terminal inline> looks like:


build:
  hello-world:
    image: okteto.dev/node-hello-world:1.0.0
    context: .
deploy:
  - kubectl apply -f k8s.yml
dev:
  hello-world:
    command: bash
    sync:
      - .:/usr/src/app
    forward:
      - 9229:9229

The file tells Okteto how to build and deploy your image and outlines the specifics of your dev environment. The <terminal inline>sync<terminal inline> key lists the directory that the CLI needs to be synced with to enable remote development.

Once you’ve set up the environment via the web UI, you can create your dev environment by installing the Okteto CLI, cloning your source code repository locally, and running <terminal inline>okteto up<terminal inline>. And that’s it! That’s all you need to get started with sandboxes and remote development! Setting up deploy previews follows a separate but similar workflow.

All in all, installation is a breeze, and that’s the main selling point of the tool — it’s easy to deploy. If you opt for a paid plan, you get top-quality tech support as well.

User Interface & Ease of Use

Okteto’s UI is quite intuitive and uncluttered, but it has everything you need to get started.

Dashboard
Dashboard

Analyzing and managing your resources from the web UI is very simple. The dashboard has quick action buttons for restarting and destroying your apps or environments. You can also view resource consumption, logs, and a few other statistics at a glance.

Third-Party Integrations

Okteto currently offers integrations with Helm and GitHub for quick deployments. It does not offer much on the integrations front because it does not need to integrate with many tools for sandboxing and deploy previews. Support for monitoring and testing tools would be useful; however, you can run Chaos tests on your Okteto deployments using LitmusTest.

Pricing

Okteto’s CLI is open-source and free to use with local <terminal inline>kind<terminal inline> or <terminal inline>docker-desktop<terminal inline> namespaces. If you’re looking for remote dev environments, you need to opt for Okteto Cloud or another remote cluster context provider (such as AWS or GCP). In that case, pricing will be applicable.

Okteto Cloud offers a generous free tier that allows independent developers to experiment with its offerings comfortably. Once you’re confident about the tool, you can opt for paid plans like Developer Pro ($19 per month) and Scale ($99 per month). Developer Pro provides you with email support and a usage quota that’s twice as high usage as the free plan’s. Scale provides you with additional features such as RBAC, SSO, and shared secrets, on top of a customizable usage quota.

Why Should You Use Okteto?

For the Kubernetes development community, tools like Okteto have often turned out to be game changers. Here’s why you should consider using Okteto:

Lightweight and Disposable Deployment Environments

You can spin up remote deployment environments quickly; test your apps on production-like; SSL-enabled environments; and pass the URLs along to your team members to get feedback before going to production. This is a major change from traditional CI/CD pipelines, which were inflexible and could only deploy and roll out changes from production.

Test as You Develop

With the option to quickly deploy your apps for preview, you can take your testing game up a notch. Automatically generated deployment previews enable you to view your code changes in action whenever you go for a review. This greatly reduces the amount of time spent making test decisions.

Other testing techniques such as load, stress, smoke, and chaos, can be implemented quite easily, since there is little effort required to spin up a new deployment instance to test on.

Development Is Not Limited by Your Local Machine Hardware Anymore

As Okteto enables you to remotely access your clusters’ namespace and make changes to your source code in real time, your development efforts are not limited by your local hardware. You can easily spin up dev environments on high-capacity infrastructure using Okteto Cloud or any other provider and SSH into it to develop directly on a high-power machine.

Alternatives to Okteto

If you don’t feel like Okteto would be the right fit for your use case, there are a few alternatives worth considering:

Skaffold

Skaffold is a lightweight CLI tool that manages the deployment lifecycle of Kubernetes-based apps. It does not involve a server component; it handles only the testing, building, and deployment of your source code.

Skaffold saves you time by automating these routine processes. It can also integrate with many CI tools and build systems to cover a wide range of use cases. However, it does not offer disposable development environments on the cloud as Okteto does.

Tilt

Tilt is another Kubernetes development CLI tool that helps you manage deployments and other K8s-specific routines easily. Similar to Skaffold, Tilt offers a live update feature that deploys changes to your K8s clusters as you work on the source code.

Tilt also offers a host of other features such as build caching, snapshots, and code in flow. However, Tilt won’t be very useful for you if you aren’t working on multiple microservices at once. Its features are meant for managing apps with multiple components deployed across clusters.

Garden

Garden is one of the few tools that help with deployment previews and namespaces, as Okteto does. Garden can automatically generate a full graph of your app’s stack. With it, you can get insights into how your services are structured and deployed, and you can easily generate development environments in your clusters.

Unlike how Skaffold and Tilt promote local development, Garden supports remote, production-like development ideology. The Garden tool is open-source, but it offers an enterprise component as well.

Final Thoughts

Kubernetes is a delight, but its development experience is certainly not the best in the industry. To make things easier, you almost always have to rely on third-party tools, open-source in most cases.

In this guide, we took a look at Okteto, an open-source CLI and a cloud service that enables you to get the most out of your Kubernetes development efforts. You can spin up remote development clusters with private, dedicated namespaces to experiment with, share deployment previews with your team, and SSH into your remote clusters to develop remotely.

Okteto is perfect for teams that are looking to improve their deployment processes and test in production-like environments before migrating to production. The possibilities for combining disposable namespaces with testing techniques like chaos testing are endless, so it’s a great solution for you if you are looking for flexibility and room to experiment with and improve your Kubernetes development experience.

Start your free 14-day ContainIQ trial
Start Free TrialBook a Demo
No card required
Kumar Harsh
Software Developer

Kumar is a software developer and technical author. He has written for a number of software companies including LogRocket and Career Karma. Kumar previously worked for Goldman Sachs as a Summer Analyst. He is currently pursuing a Bachelor of Technology in Computer Science at the National Institute of Technology, Patna.

READ MORE