Configuring Services

Once a service exists (see Your First Service), you can change how it appears in the catalogue, where it can be used and how its forms behave. This page covers managing a service in the dashboard and the annotations and schema markers that control it.

Managing a service in the dashboard

Open Services in the sidebar of the organisation that owns the service. The first tab lists your own services; the Subscriptions tab lists services you consume from others. Each of your services has a menu (…) with:

  • Edit: change the title, short description, category, documentation URL, Generate UI, labels and annotations, logo and description. The name, API group and kubeconfig location can’t be changed.
  • Update Permissions: change which resources the service claims access to. Only shown once the service is active.
  • Kubeconfig: show, copy or download the kubeconfig for the api-syncagent again, from the Secret you chose when you created the service.
  • UI Builder: see UI Builder.
  • Delete: delete the service, its uploaded logo and, if your organisation uses the service itself, its own binding to it.

Catalogue details

The create and edit forms set what consumers see in the service catalogue:

FieldShown as
TitleThe service’s name on its tile.
Short DescriptionThe text on its tile.
CategoryUsed for sorting and search: Database, General, Infrastructure, Messaging, Monitoring, Security, Storage or Other. Defaults to General.
Documentation URLA link in the service’s details.
LogoThe image on its tile. Upload a PNG, JPG or SVG file of up to 1 MB, or enter a URL. Uploads are stored on the KDP storage server.
DescriptionThe full description in the service’s details. Markdown is supported.

Restricting where a service can be used

Some services only make sense in an organisation, or only in a project. Set the catalog.kdp.k8c.io/disallow-workspace-types annotation on the Service to the kinds of workspace where it must not be used: organization, project, or both, separated by a comma.

metadata:
  annotations:
    catalog.kdp.k8c.io/disallow-workspace-types: organization

With this annotation:

  • KDP rejects creating the service’s objects in those workspaces with the error <Kind> cannot be created in a <type> workspace. Existing objects stay.
  • The dashboard hides the service from the catalogue there and shows it as read-only.

KDP enforces this with an admission webhook that it sets up for the service. While the KDP controller manager is unavailable, creating any object of the service fails; see Operating KDP. Unknown values are ignored.

Labels and annotations in the catalogue

Consumers can’t read your Service object, only its catalogue entry. KDP copies labels and annotations whose key starts with exactly catalog.kdp.k8c.io/ to the catalogue entry and leaves out all others, including subdomains such as team.catalog.kdp.k8c.io/. Put anything consumers or their tools should see under that prefix, and nothing you want to keep private.

Offering choices in forms

The dashboard builds forms from your CRD’s schema. To turn a text field into a list to choose from, filled from objects in the workspace, add a kdp:options block to the field’s description in the CRD. With kubebuilder, put it in the Go doc comment of the field:

// The ConfigMap with the application's settings.
// <!-- kdp:options
// ---
// apiVersion: options.kdp.k8c.io/v1
// kind: FieldSource
// source: local
// path: /api/v1/namespaces/${LOCAL_NAMESPACE}/configmaps
// value: "{.metadata.name}"
// -->
ConfigMapName string `json:"configMapName,omitempty"`

The dashboard hides the block from the field’s help text. Its fields:

FieldMeaning
apiVersion, kindAlways options.kdp.k8c.io/v1 and FieldSource.
sourcelocal lists objects in the consumer’s workspace. vwcatalog lists objects through the service catalogue, across workspaces, with your service’s permissions. Defaults to local.
pathThe API path to list, starting with /. It can use ${LOCAL_WORKSPACE}, ${APIEXPORT_WORKSPACE} and ${LOCAL_NAMESPACE}.
valueA JSONPath template for the value stored in the field, such as "{.metadata.name}".
labelOptional JSONPath template for the text shown in the list.

This works for string, integer and number fields, and for lists of them, which become multi-selects. If the source returns nothing, the field becomes a normal input again. When an object is edited, a stored value the source no longer offers is still shown, marked (current value).