Skip to content

Kubernetes Indexed Resources

Overview

When you write a generation rule, you tell the workspace builder which resources to match by listing one or more resource types under resourceTypes. This page lists the resource types the Kubernetes indexer discovers, the names that work, and a working match rule example.

Use the Kubernetes kind name (lowercase) as resourceTypes — e.g. deployment, pod, namespace. Custom CRDs use plural.group[/version] and must be declared in customResourceTypes. Full catalog →

Built-in resource types

Resource typeAPI group
cluster— (synthesized)
namespacecore/v1
deploymentapps/v1
statefulsetapps/v1
daemonsetapps/v1
podcore/v1
servicecore/v1
configmapcore/v1
secretcore/v1
cronjobbatch/v1
jobbatch/v1
ingressnetworking.k8s.io/v1
gatewayclassgateway.networking.k8s.io/v1
gatewaygateway.networking.k8s.io/v1
httproutegateway.networking.k8s.io/v1
custom— (CRDs via customResourceTypes)
persistentvolumeclaimcore/v1

Built-in matchable properties

PropertyValue
nameObject name
namespaceParent namespace
clusterCluster name
labels, label-keys, label-valuesKubernetes labels
annotations, annotation-keys, annotation-valuesKubernetes annotations

Use resource/<path> to reach raw JSON fields from the object manifest — e.g. resource/spec/replicas or resource/spec/template/spec/containers/0/image.

Example match rule

apiVersion: runwhen.com/v1
kind: GenerationRules
spec:
platform: kubernetes
generationRules:
- resourceTypes:
- deployment
matchRules:
- type: and
matches:
- type: pattern
properties: [namespace]
pattern: "^payments$"
mode: exact
- type: pattern
properties: ["resource/spec/replicas"]
pattern: "^[2-9]|[0-9]{2,}$"
mode: exact
slxs:
- baseName: deployment-health
qualifiers: [cluster, namespace, name]
baseTemplateName: k8s-deployment-health
levelOfDetail: detailed
outputItems:
- type: slx
- type: runbook

Note: Pods, services, secrets, and configmaps are only discovered in namespaces with detailed or basic LOD. Namespaces set to none are skipped by the indexer entirely — no resources from those namespaces are visible to generation rules. Configure LOD in workspaceInfo.yaml per context or per namespace; the full scoping mechanics are in the Kubernetes-LOD architecture.