Difficulty: Intermediate
Estimated Time: 25 minutes

Creating A Kubectl Plugin


This scenario takes you through the introductory steps for developing a kubectl plugin. You will create a plugin that will interact with a Kubernetes cluster. While the plugin is it's written in Go the steps will gently guide you, even if you are a bit new at writing code in Go.

In this scenario you will learn how to:

  • Layout the source directory structure for a kubectl plugin
  • Connect implementation logic to command
  • Work with client references that can administer Kubernetes
  • List and create Pods via a custom plugin


Kubectl offers a helpful plugin feature to extend Kubernetes. The Community supported plugins are quite helpful. But sometimes, what the community offers is not what you need. Fortunately, you can code you own plugin to solve specific problems related to your domain. If you do create a plugin that can help others, consider adding it to the public community of kubectl plugins.

Lessons Learned

With these steps you have learned:

  • ✔ how to layout the source directory structure for a kubectl plugin,
  • ✔ how to connect implementation logic to command,
  • ✔ how to work with client references that can administer Kubernetes,
  • ✔ how to list and create Pods via a custom plugin

Special Thank You

To Ken Sipe as he inspired this scenario from his labs found here.


For a deeper understanding of these topics and more join
Jonathan Johnson
at various conferences, symposiums, workshops, and meetups.

Software Architectures ★ Speaker ★ Workshop Hosting ★ Kubernetes & Java Specialist

Kubectl CLI Plugin Development

Step 1 of 11

Your Kubernetes Cluster

For this scenario, Katacoda has just started a fresh Kubernetes cluster for you. Verify it's ready for your use.

kubectl version --short && \ kubectl get componentstatus && \ kubectl get nodes && \ kubectl cluster-info

The Helm package manager used for installing applications on Kubernetes is also available.

helm version --short

Kubernetes Dashboard

You can administer your cluster with the kubectl CLI tool or use the visual Kubernetes Dashboard. Use this script to access the protected Dashboard.


This tab will not be visible to users and provides only information to help authors when creating content.

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]