Skip to content

lensapp/lens-extension-samples

Repository files navigation

Lens Extension API Samples

This repository contains sample code illustrating the Lens Extension API. You can read, play with or adapt from these samples to create your own extensions.

You can expect from each sample:

  • An explanation of its functionality
  • A gif or screenshot demonstrating its usage
  • Link to a guide on Lens Documentation website, if it has one
  • Code of the same style, enforced using ESLint

Prerequisites

You need to have node and npm installed on your system to run the examples. It is recommended to use the node version used for Lens development itself which is documented here.

Usage

To install one of the samples follow the below instructions:

Linux

git clone https://github.com/lensapp/lens-extension-samples
mkdir -p ~/.k8slens/extensions
cp -pr ./lens-extension-samples/<sample folder> ~/.k8slens/extensions/
cd ~/.k8slens/extensions/<sample folder>
npm install
npm run build

The extension will now be built. If Lens is already open then you can reload it to pick up the newly installed extension.

Getting Started

Samples

Sample Guide on Lens Documentation Website
Hello World Sample Renderer Extension
Custom Resource Page Sample Stores
Styling CSS Modules Renderer Extension
Styling Emotion Renderer Extension
Styling SASS Renderer Extension