This article was inspired by our recent "5 tools to increase Kubernetes developer productivity" video, hosted by Saiyam Pathak and Kunal Kushwaha.

Over the years Kubernetes has become the de facto orchestration platform, as such it's crucial that developers have the right set of tools to increase their productivity for development and operations.

In this article, we take a look at five such tools that can help developers inprove productivity while when Kubernetes. Let’s jump in.

What are the tools?

There are a lot of tools that help in enhancing developer productivity for Kubernetes, but we are going to look at the following:

We will look at what these tools are along with their functions. Also, we will look at a small demo of each of these tools.

What is K9s?

K9s is a terminal-based UI that we can use to interact with our Kubernetes clusters. The UI helps in observing, navigating, and managing the deployed applications. In addition, K9s monitors the changes in Kubernetes and offers commands to interact with the observed resources.

How to install K9s?

First, to use K9s in our machine, we need to install K9s. To do that, we have to fulfill a few prerequisites. In this guide, we are using windows as the operating system. So, for windows, you need to install Scoop if not already installed. You can find the whole installation process by clicking here.

After installing Scoop, use the following command to install K9s:

scoop install k9s

scoop install k9s

Next, use the command k9s to run the UI in your terminal. The below pic shows the UI running in the terminal.

UI running in the terminal

How does K9s work?

After installing K9s and opening the UI, you will find all the running nodes. To see the details of the nodes, select the one with the arrow keys and press d. It will show the details of the node.

installing K9s and opening the UI, you will find all the running nodes

Again by typing :, you can add more commands to get more details of the nodes, pods, etc. Just type the name of the thing you want to see, and you will get the details. . For example, :deployments to see the deployments, :pods to see the pods, :statefulset to view the statefulsets, and so on.

So, this is how you can install and use K9s in your terminal.

What is Lens?

Lens is an Integrated Development Environment or IDE that helps in providing complete situational awareness for everything that runs in Kubernetes. It is entirely open-source and assists in incrementing Kubernetes developer productivity.

How to install Lens?

You can download the Lens IDE for free from the official website of the Lens. For any operating system, you can download the Lens IDE from the official website.

After downloading, install the IDE on your local machine by going through the installation process. After installing, you have to sign up to create an account or log in if you already have an account to use Lens on your machine. After that, the IDE will appear, as shown in the picture below.

IDE will appear

How does Lens work?

In the Lens IDE, you will find the catalog listing the clusters you have.

Lens IDE catalog listing the clusters you have

If you have clusters previously running in your workspace, double-click on any of them, and you will get connected with the particular cluster. Inside the cluster, you will get a dashboard view that will help you view the pods, nodes, etc. Here, I have minikube installed, and we can see the overview of the cluster from the picture below.

minikube installed

To create any of the resources, open the Lens terminal by clicking on the + button, which you can see at the lefthand corner of the IDE. After clicking, select create resources and select the resource template that you want to create. Fill out the template according to your needs and click on the create button.

Create button

You can also add a new cluster to Lens by going to the File section on the left hand top corner of the screen and then selecting Add Cluster or by using crtl+shift+a. You will enter the details of your kubeconfig file in the displayed input field and add a cluster.

Also, you can go back to the catalog and select clusters. From there, hover over the + button that you will find at the lower right-hand corner of the screen. It will give you the various options to add a cluster into the Lens workspace.

This is how you can make full use of the Lens IDE while managing our Kubernetes clusters.

What is Krew?

Krew is a kubectl plugin manager which helps in increasing Kubernetes developer productivity. As a Kubernetes user, you can install several plugins with the help of Krew, which will help make things easy, such as getting a neat, readable yaml file or getting an access matrix for the pods.

Also, as a developer, you can create plugins to mitigate your problems and distribute them so that everyone can use them. As of today, there are over 180 kubectl plugins that can help you in your day-to-day activities because the devs have created each plugin with separate functionality.

How to install Krew?

We'll be using Windows but other OS versions can be acquired here. To install Krew, firstly, you have to install git. You can install git from here. After installing git, download the krew.exe file from the releases page to a directory. Navigate to the directory and run the following command in the command prompt to install Krew:

install krew

Note that, you have to launch the command prompt with administrator privileges.

After that, add the %USERPROFILE%\.krew\bin to your PATH environment variable and launch a new command prompt window. If you don't know how to edit an environment variable, you can learn that by clicking here.

Run the following command to check the installation:

kubectl krew

How does Krew work?

Krew has a whole lot of plugins which are listed here. If you want to install a plugin via Krew, run the following command:

kubectl krew install <PLUGIN_NAME>

Replace PLUGIN_NAME with the name of the plugin that you want to install.

Access-matrix is a plugin that helps in showing an RBAC access matrix for server resources. After installing, if you want to use the plugin, run the following command:

kubectl access-matrix for pods

This command will list out all the pods you have along with the individual ability of the pods to list, create, update and delete.

Similarly, neat is a plugin that helps in removing clutter from Kubernetes manifests to make it more readable. To use this plugin, run the following command on your terminal:

kubectl-neat get pod [POD_NAME] -oyaml

Replace POD_NAME with the name of the pod whose details you want to see.

After running the command, you will be able to see a neat version of the yaml file excluding the unwanted informations for the pod.

These are just two examples of Krew plugins, but each of the 180+ plugins are worth exploring.

What is DevSpace?

Devspace is a client-only open source development tool that helps build, test, and debug applications inside Kubernetes. It allows faster deployment of cloud-native software with streamlined deployment workflows between development, staging, and production environments. It also helps in deployment with rapid iterations, cross-environment consistency, feature-rich user interface, and localhost experience.

With the help of Devspace, you can update your containers without having to restart them with rebuilt images each time you make a change.

How to install DevSpace?

You can install DevSpace by installing the DevSpace CLI. To do that, open Windows PowerShell on your local machine and run the following commands:

md -Force "$Env:APPDATA\devspace"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12';
Invoke-WebRequest -UseBasicParsing ((Invoke-WebRequest -URI "https://github.com/loft-sh/devspace/releases/latest" -UseBasicParsing).Content -replace "(?ms).*`"([^`"]*devspace-windows-amd64.exe)`".*","https://github.com/`$1") -o $Env:APPDATA\devspace\devspace.exe;
$env:Path += ";" + $Env:APPDATA + "\devspace";
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User);

If asked to continue, press enter. Run the following command to check the successful installation of DevSpace:

devspace --version

How does DevSpace work?

To start working with Devspace, you must initialize your project by creating a devspace.yaml config file. Run the following command in your project directory to create the same config file:

devspace init

This command will start the initialization process by asking a series of questions that will ask you to specify the path of the deployment.yaml file if you are using existing Kubernetes manifests. Also, you have to specify the container image and port, and others. Then, it will create the config file and initialize your project.

create the config file and initialize your project

Next, use the following command to set the default namespace:

devspace use namespace [NAMESPACE_NAME]

Replace NAMESPACE_NAME with the name of one of your namespaces which you want to set as default. Afterwards, run the following command to deploy the application:

devspace dev

After deploying the services and applications through DevSpace, the DevSpace UI will be active on the http://localhost:whateverport. You can run the applications from the UI by running commands in the shell.

running commands in the shell

In this way, we can use DevSpace to deploy applications and services.

What is Okteto?

Okteto gives you the pre-configured environment in the cloud to make the Kubernetes native development easy and hassle-free. In Okteto, you will see the replacement of Kubernetes deployment by a development container that will contain your development tools.

With Okteto, you will get the advantage of faster development with a real developer environment containing the development tools and synchronization of the local file system. Also, it is deployment independent because Okteto decouples development from deployment. Again, it is replicable because the development container eliminates the need to install the dependencies. Lastly, it works anywhere from a Kubernetes cluster to a local machine.

How to install Okteto?

To install Okteto in Windows, you have to fulfill the prerequisite of installing Scoop. You can find the installation process for Scoop by clicking here. Next, install the Okteto CLI by running this command in your terminal:

scoop install okteto

scoop install okteto

For other operating systems, you can find the installation commands by clicking here.

How does Okteto work?

Getting started with Okteto is easy. For that, you have to create a free account on Okteto Cloud. After creating an account, you will enter the Okteto Cloud UI.

enter the Okteto Cloud UI

Now, if you already have an application ready, navigate to the project directory and add the okteto.yml file by running the following command:

okteto init

Next, deploy the application in the Okteto Cloud through git repository or helm chart. If you want to learn about git and GitHub, you can do that by clicking here.

After that, run the following command in your terminal:

okteto context use https://cloud.okteto.com

Here we are using the context in cloud.oketeto.com. Now, use the following command to activate the development container:

okteto up

This command will start activating the development container along with the pulling of images and synchronization of files. In the Okteto Cloud UI, you will see that the deployment is now in development under your namespace. Also, you can see the logs and other informations.

Okteto Cloud UI

Next, if you start your application and want to see it is up and running, click on the link below Endpoints.

In this way, you can deploy an application in a development phase through Okteto.

In conclusion

This article introduced five tools to improve productivity of developers working with Kubernetes. We have discussed the installation process and working principles of each. Let us know on the Civo Slack workspace or over on Twitter if you try any of these out – or if there is an app you think we have missed.