Skip to main content

Function: registerKindIcon()

function registerKindIcon(
kind: string,
definition: IconDefinition,
apiGroup?: string): void

Register Icon for a resource kind

By default, icons are matched only by kind. Optionally, apiGroup can be provided to differentiate resources that share the same kind across different API groups.

When apiGroup is provided, Headlamp will:

  1. First try to match ${apiGroup}/${kind}.
  2. Fall back to kind if no match is found.

Parameters

ParameterTypeDescription
kindstringResource kind
definitionIconDefinitionicon definition
apiGroup?stringKubernetes API group, optional

Returns

void

Example

Kind only Matching

registerKindIcon("MyCustomResource", { icon: <MyIcon />, color: "#FF0000" })

Match only networking service

registerKindIcon("Service", { icon: <NetworkingServiceIcon /> }, "networking.k8s.io");

Defined in

src/plugin/registry.tsx:856