Customize Your Kubernetes Dashboard with Skin Badges

K9s, a popular Kubernetes CLI tool, allows users to personalize their terminal interface using Skin Badges. These YAML files control the visual presentation of K9s, enabling customization of colors, fonts, and styles. This guide explains how to utilize skin badges to tailor your K9s experience.

Skin badge files reside in the $XDG_CONFIG_HOME/k9s/skins directory. You can apply a global skin to all your clusters by specifying the skin attribute in your main configuration file (k9s: skin: skin_file_name_no_extension). For context-specific styling, define the same skin attribute within the corresponding context block in your configuration. K9s will default to the stock skin if no matching skin file is found. For instance, to use a skin named “blee” for cluster “clusterX” and context “contextY”, your configuration would include skin: blee within the contextY block, referencing the $XDG_CONFIG_HOME/k9s/skins/blee.yaml file.

Implementing Skin Badges: A Step-by-Step Guide

Configuring skin badges is straightforward. Your global skin is defined in your main K9s configuration file, usually located at $XDG_CONFIG_HOME/k9s/config.yaml. This skin applies universally unless overridden by context-specific settings.

The example above demonstrates setting the in_the_navy skin globally. All clusters will adopt this skin unless a different skin is specified within a particular context’s configuration. This allows for granular control over the appearance of individual Kubernetes contexts.

Skin Badge Structure and Customization

A skin badge file uses a structured YAML format to define various style elements. Colors can be specified using predefined named colors (e.g., dodgerblue, steelblue) or hexadecimal representations (e.g., #ffffff). The special color default preserves the terminal’s background color.

This example showcases a skin badge named in_the_navy. It meticulously defines colors for various interface components:

  • body: Sets the overall foreground and background colors.
  • info: Styles the ClusterInfoView section.
  • frame & border: Controls the appearance of borders and focus.
  • menu: Customizes the menu colors and highlighting.
  • crumbs: Styles the navigation breadcrumbs.
  • status: Defines colors for resource status indicators (e.g., new, modified, error).
  • title: Sets colors for titles, counters, and filters.
  • views: Contains specific styles for different views like tables, YAML data, and logs. Each sub-section under views allows fine-grained control over elements within those specific views.

Comprehensive Named Color Palette

K9s offers an extensive selection of named colors for use in your skin badges. This table provides a complete reference:

This wide array of colors empowers you to craft highly personalized skin badges and enhance your K9s user experience. Experiment with different color combinations to achieve the perfect look for your Kubernetes dashboard.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *