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:
- First try to match
${apiGroup}/${kind}. - Fall back to
kindif no match is found.
Parameters
| Parameter | Type | Description |
|---|---|---|
kind | string | Resource kind |
definition | IconDefinition | icon definition |
apiGroup? | string | Kubernetes 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");