Skip to content

Latest commit

 

History

History
113 lines (88 loc) · 6.11 KB

resources.md

File metadata and controls

113 lines (88 loc) · 6.11 KB

Config Map for resource-based extensions

Table of Contents

Overview

This document describes the required ConfigMap setup that you need to configure in order to handle your CRD UI page. You can provide all the ConfigMap data sections as either JSON or YAML.

Extension version

The version is a string value that defines in which version the extension is configured. It is stored as a value of the busola.io/extension-version label. If the configuration is created with the Create Extension button, this value is provided automatically. When created manually, use the latest version number, for example, '0.5'.

NOTE:: Busola supports only the two latest versions of the configuration. Whenever a new version of the configuration is proposed, go to your Extension and migrate your configuration to the latest version.

general section

The general section is required and contains basic information about the resource and additional options.

Item parameters

  • resource - [required] - information about the resource.
    • kind - [required] Kubernetes kind of the resource.
    • version - [required] API version used for all requests.
    • group - API group used for all requests. Not provided for Kubernetes resources in the core (also called legacy) group.
  • name - title used in the navigation and on the list screen. It defaults to its resource kind.
  • category - the name of a category used for the left-hand menu. By default, it's placed in the Custom Resources category.
  • icon - suffix of an icon name used for the left-hand menu. The default value is customized. You can find the list of icons here.
  • scope - either namespace or cluster. Defaults to cluster.
  • urlPath - path fragment for this resource used in the URL. Defaults to pluralized lowercase kind. Used to provide an alternative URL to avoid conflicts with other resources.
  • defaultPlaceholder - to be shown in place of an empty text placeholder. Overridden by the widget-level placeholder. Defaults to -.
  • description - displays a custom description on the resource list page. It can contain links. If the translations section has a translation entry with the ID that is the same as the description string, the translation is used.
  • filter - optional JSONata filter used to filter the resources shown at the list section property.
  • features - an optional object for the features configuration.
    • actions - an optional object for the actions configuration.
      • disableCreate - when set to true, it disables the Create button. Defaults to false.
      • disableEdit - when set to true, it disables the Edit button. Defaults to false.
      • disableDelete - when set to true, it disables the Delete button. Defaults to false.
  • externalNodes - an optional list of links to external websites.
    • category - a category name
    • scope - either namespace or cluster. Defaults to cluster.
    • icon - an optional icon. Go to Icon Explorer to find a list of the available icons.
    • children - a list of child nodes containing details about the links
      • label - a displayed label
      • link - a link to an external website. You can provide a JSONata function.

Example

resource:
  kind: MyResource
  version: v1alpha3
  group: networking.istio.io
name: MyResourceName
category: My Category
scope: namespace
defaultPlaceholder: '- not set -'
description: See the {{[docs](https://github.com/kyma-project/busola)}} for more information.
filter: "$filter(data, function($data) {$data.type = 'Opaque'})"
features:
  actions:
    disableCreate: true
    disableDelete: true
externalNodes:
  - category: My Category
    icon: course-book
    children:
      - label: Example Node Label
        link: 'https://github.com/kyma-project/busola'
  - category: My Second Category
    icon: bar-chart
    scope: namespace
    children:
      - label: Example Node Label
        link: '$string($exampleResource().link)'

form section

To customize the form section see the Create forms with extensibility documentation. Views created with the extensibility ConfigMap wizard have a straightforward form configuration by default.

list section

The list section presents the resources of a kind, that is, Secrets or ConfigMaps, and comes with a few predefined columns: Name, Created, and Labels. If you want to add your own columns, see Customize UI display to learn how to customize both list and details views.

details section

The details section presents the resource details. To customize it, see Customize UI display. The default details header contains some basic information. By default, the body is empty.

Value preprocessors

Value preprocessors are used as a middleware between a value and the actual renderer. They can transform a given value and pass it to the widget; or stop processing and render it so you can view it immediately, without passing it to the widget.

List of value preprocessors

  • PendingWrapper - useful when value resolves to a triple of {loading, error, data}:

    • For loading equal to true, it displays a loading indicator.
    • For truthy error, it displays an error message.
    • Otherwise, it passes data to the display component.

    Unless you need custom handling of error or loading state, we recommend using PendingWrapper, for example, for fields that use data sources.