Skip to content
Hands-on IT IT Drills

Appendix A: Cheat Sheet

Everything at a glance, sorted by topic.

Addresses in the Lab

What Where
notes (namespace app) http://<VM-IP>:30080
Fleet blau, environment dev http://<VM-IP>:31100
kro metrics kubectl -n kro-system port-forward deploy/kro 8078:8078
Platform ConfigMap kubectl -n platform get configmap notes-platform
Values for the chart ~/kro-lab/kro-values.yaml

Installation and Upgrade

helm install kro oci://registry.k8s.io/kro/charts/kro \
  --namespace kro-system --create-namespace --version 0.10.0
helm upgrade kro oci://registry.k8s.io/kro/charts/kro -n kro-system \
  --version 0.10.0 -f ~/kro-lab/kro-values.yaml
U=https://raw.githubusercontent.com/kubernetes-sigs/kro/v0.10.0/helm/crds
kubectl apply --server-side -f $U/kro.run_resourcegraphdefinitions.yaml
kubectl -n kro-system rollout restart deploy/kro

Structure of an RGD

apiVersion: kro.run/v1alpha1
kind: ResourceGraphDefinition
metadata:
  name: <name>
spec:
  schema:
    apiVersion: v1alpha1
    kind: <Art>
    group: <gruppe>            # default: kro.run
    scope: Namespaced          # or Cluster
    shortNames: [...]
    types: {...}               # custom types
    spec: {...}                # SimpleSchema
    status: {...}              # CEL, type is derived
    additionalPrinterColumns: [...]
  resources:
    - id: <lowerCamelCase>
      template: {...}          # or externalRef: {...}
      includeWhen: [...]       # all true → create
      readyWhen: [...]         # all true → ready
      forEach: [...]           # collection

SimpleSchema

Notation Meaning
name: string Text
n: integer \| default=1 minimum=1 maximum=5 Number with default and limits
on: boolean \| default=false Switch
level: string \| enum="a,b" Fixed choice
team: string \| required=true pattern="^[a-z]+$" Required with pattern
id: string \| immutable=true Fixed after creation
tags: "[]string \| uniqueItems=true maxItems=3" List
labels: "map[string]string" Map
owner: Contact Custom type from types

CEL

Expression Purpose
${schema.spec.x}, ${schema.metadata.name} Fields of the instance
${deployment.status.readyReplicas} Field of another object (edge)
${string(n)} Number as text
'${a ? "x" : "y"}' Branch, in single quotes
${x.?feld.orValue(0)} Field or fallback
${liste.join(",")}, ${size(liste)} Lists
${liste.map(e, e.metadata.name)} Transform a list
${lists.range(3)} [0, 1, 2]
${random.seededString(24, seed)} Fixed random value
${"${HOME}"} Literal ${HOME}
${runtime.newCondition({type, status, reason, message})} Your own condition
${runtime.condition(schema, 'ResourcesReady')} kro’s own condition

Checking and Troubleshooting

kubectl get rgd
kubectl get rgd <name> -o wide
kubectl get rgd <name> \
  -o jsonpath='{range .status.conditions[*]}{.type}={.status} {.message}{"\n"}{end}'
kubectl get gr -l kro.run/resource-graph-definition-name=<name>
kubectl -n <ns> get <art> <instanz> \
  -o jsonpath='{range .status.conditions[*]}{.type}={.status} {.message}{"\n"}{end}'
kubectl -n <ns> get all -l kro.run/instance-name=<instanz>
kubectl -n kro-system logs deploy/kro --since=5m | grep ERROR
kubectl wait --for=condition=Ready rgd/<name> --timeout=60s

Messages and What They Mean

Message Cause Day
mapping values are not allowed in this context : in an expression without quotes 3
type mismatch … returns type "int" but expected "string" string() missing 3
undefined field '…' Typo in the field name 3
references unknown identifiers: [HOME] ${…} is not an expression; escape it 3
graph contains a cycle Two objects point at each other 4
no such key: … (data pending) Field without default not set; use ? 3
readyWhen … is false: waiting for readiness Object not ready yet 5
schema not found for field … (instance ERROR) New status field; restart kro 6
requires the DeletionPolicy feature gate Feature gate missing 6
external ref … not found External object missing 9
breaking changes detected Schema change blocked 11
is forbidden: User "system:serviceaccount:kro-system:kro" Permissions in aggregation mode 12
cache sync timeout (ControllerReady) Permissions for the new kind missing 15
duplicate identity in collection Two elements, one name 15

Feature Gates

Gate Purpose
DeletionPolicy Annotation kro.run/deletion-policy: Orphaned
InstanceConditionEvents Event on every condition change
InstanceConditionMetrics Metric per instance and condition
CELOmitFunction omit() leaves out a field
ConservativeCRDComparison Stricter check for breaking changes
GraphKind The Graph API

Orders

  • Create: RGD, kubectl wait --for=condition=Ready rgd/…, permissions, instances
  • Delete: instances, RGD, CRD
  • Protect a volume: set the policy, wait until the annotation is on the object, then delete
  • Tighten the schema: first switch the instances over, then the schema