Context Extension in Aptakube

Use kubeconfig extensions to customize contexts in Aptakube

Aptakube supports context configuration with the use of a custom extension named aptakube in your kubeconfig file. This extension allow developers to customize the icon and order of the context in the Aptakube UI, with more features to come in the future.

This extension is supported starting from Aptakube 1.6.3, and must be added to the context object in your Kubeconfig, not the cluster or user object. All fields are optional.

1. Custom Context Icon

Aptakube includes a set of built-in icons for common platforms like EKS, GKE, AKS, and others, but you can also use your own icons. This is useful if you have multiple clusters from the same cloud provider and want an easy way to distinguish between them.

To do that, you can use the icon-url field in the context extension, here's an example:

contexts:
  - context:
      cluster: minikube
      namespace: default
      user: minikube
      extensions:
        - name: aptakube
          extension:
            icon-url: https://example.com/custom-icon.png
    name: minikube
clusters:
  - ...
users:
  - ...
current-context: minikube
kind: Config
preferences: {}

The icon-url field can be either a local file path or a remote URL. Here's an example of a local file path:

extensions:
  - name: aptakube
    extension:
      # macOS or Linux
      icon-url: /Users/username/Desktop/custom-icon.png
      # Windows
      # icon-url: C:\Users\username\Desktop\custom-icon.png

2. Ordered Contexts

You can also use the order field to specify the order of the context in the Aptakube UI. This is useful if you want to prioritize certain contexts over others.

The lower the order, the higher the priority it'll have on the UI. Here's an example:

contexts:
  - context:
      cluster: minikube
      namespace: default
      user: minikube
      extensions:
        - name: aptakube
          extension:
            order: 1
    name: minikube
clusters:
  - ...
users:
  - ...
current-context: minikube
kind: Config
preferences: {}

So what's next?

What else would you like to see in terms of context configuration in Aptakube?

Let us know by opening an issue on GitHub or joining our Discord.