Skip to content
Hands-on IT IT Drills

Day 1: Installing kro, First RGD

Goal: kro runs in the cluster. You have built your first API Greeting, created an instance and seen how kro guards the generated objects. · Duration: approx. 45 min · Prerequisite: Day 0

Briefing

  • kro comes as a Helm chart from registry.k8s.io (the image registry of the Kubernetes project). kro is a subproject of Kubernetes SIG Cloud Provider.
  • The chart brings three CRDs: ResourceGraphDefinition (short rgd), Graph (alpha, Day 14) and GraphRevision (short gr, Day 11).
  • When you create an RGD, kro does four things: it validates it, generates a CRD for your new kind, starts a controller for it and creates the objects as soon as someone creates an instance.
 RGD greeting ──► CRD greetings.kro.run ──► Instance Greeting/hallo
                                                 │  kro applies
                                                 ▼
                                           ConfigMap hallo

Drill 1: Installing kro

helm install kro oci://registry.k8s.io/kro/charts/kro \
  --namespace kro-system --create-namespace --version 0.10.0

Expected (shortened):

Pulled: registry.k8s.io/kro/charts/kro:0.10.0
Digest: sha256:56561368ed4c574520e8bd6a677a2e6c66333fb90e759ff4f2f068341fe9956c
NAME: kro
NAMESPACE: kro-system
STATUS: deployed
REVISION: 1
  • oci://: The chart lives as an OCI artifact in a registry; no helm repo add is needed.
  • --version 0.10.0 pins the version. Without it, Helm takes the latest.
kubectl -n kro-system get pods

Expected:

NAME                   READY   STATUS    RESTARTS   AGE
kro-69965dc9cc-cgc4f   1/1     Running   0          31s

A single pod; that is the whole controller.

Save your progress? Sign up for free

Drill 2: What kro Brings Along

kubectl get crd | grep kro

Expected:

graphrevisions.internal.kro.run    2026-11-11T17:28:00Z
graphs.kro.run                     2026-11-11T17:28:00Z
resourcegraphdefinitions.kro.run   2026-11-11T17:28:00Z
kubectl api-resources --api-group=kro.run

Expected:

NAME                       SHORTNAMES   APIVERSION         NAMESPACED   KIND
graphs                                  kro.run/v1alpha1   true         Graph
resourcegraphdefinitions   rgd          kro.run/v1alpha1   false        ResourceGraphDefinition

An RGD is cluster-scoped (NAMESPACED false). It defines an API for the whole cluster, just like a CRD.

Helm shows you the chart’s settings:

helm show values oci://registry.k8s.io/kro/charts/kro --version 0.10.0 \
  | grep -A3 '^rbac:'

Expected:

rbac:
  # Specifies how to manage access for kro in the cluster
  # Two modes are currently supported:
  # - unrestricted: Grants cluster-wide full access to all resources

The default is unrestricted: kro may do everything in the cluster. That’s convenient for the lab. On Day 12 you switch to aggregation.

Save your progress? Sign up for free

Drill 3: The First RGD

You build an API Greeting. Each instance gets a ConfigMap with a message.

mkdir -p ~/kro-lab/tag01
cd ~/kro-lab/tag01
cat > greeting-rgd.yaml <<'EOF'
apiVersion: kro.run/v1alpha1
kind: ResourceGraphDefinition
metadata:
  name: greeting
spec:
  schema:
    apiVersion: v1alpha1
    kind: Greeting
    spec:
      message: string
  resources:
    - id: config
      template:
        apiVersion: v1
        kind: ConfigMap
        metadata:
          name: ${schema.metadata.name}
        data:
          message: ${schema.spec.message}
EOF
  • schema describes the new API: kind Greeting, version v1alpha1, one field message of type string. The group is missing, so kro uses kro.run.
  • resources is the list of objects. Each has an id (here config) and a template, a completely normal Kubernetes manifest.
  • ${schema.metadata.name} is a CEL expression. It reads the name of the instance. ${schema.spec.message} reads the field the team sets.
  • 'EOF' in quotes is important: that way the shell leaves the ${…} alone.
kubectl apply -f greeting-rgd.yaml
kubectl get rgd

Expected:

resourcegraphdefinition.kro.run/greeting created
NAME       APIVERSION   KIND       STATE    READY   AGE
greeting   v1alpha1     Greeting   Active   True    6s

Active and True: kro has validated and accepted the RGD. What it made of it is shown by -o wide:

kubectl get rgd greeting -o wide
kubectl get crd greetings.kro.run

Expected:

NAME       APIVERSION   KIND       STATE    READY   TOPOLOGICALORDER   AGE
greeting   v1alpha1     Greeting   Active   True    ["config"]         6s
NAME                SCOPE        VERSIONS            CREATED AT
greetings.kro.run   Namespaced   v1alpha1(storage)   2026-11-11T17:29:59Z
  • TOPOLOGICALORDER is the order in which kro creates the objects. With a single object it’s boring; from Day 4 on, it won’t be.
  • kro generated the CRD greetings.kro.run itself. From now on, the API server knows the kind Greeting:
kubectl explain greeting.spec

Expected:

GROUP:      kro.run
KIND:       Greeting
VERSION:    v1alpha1

FIELD: spec <Object>

DESCRIPTION:
    <empty>
FIELDS:
  message   <string>
    <no description>

Save your progress? Sign up for free

Drill 4: The First Instance

kubectl create namespace app
cat > hallo.yaml <<'EOF'
apiVersion: kro.run/v1alpha1
kind: Greeting
metadata:
  name: hallo
  namespace: app
spec:
  message: Hallo kro
EOF
kubectl apply -f hallo.yaml
kubectl -n app get greeting

Expected:

namespace/app created
greeting.kro.run/hallo created
NAME    STATE    READY   AGE
hallo   ACTIVE   True    4s

To the team, Greeting looks like any other Kubernetes kind. What was created behind it:

kubectl -n app get configmap hallo -o yaml

Expected (shortened):

apiVersion: v1
data:
  message: Hallo kro
kind: ConfigMap
metadata:
  annotations:
    internal.kro.run/apply-order: "1"
    internal.kro.run/node-path: config
  labels:
    app.kubernetes.io/managed-by: kro
    applyset.kubernetes.io/part-of: applyset-Iiz_0lx5c0WuukoyYjCPBF1CcU-I56PoX...
    kro.run/instance-kind: Greeting
    kro.run/instance-name: hallo
    kro.run/instance-namespace: app
    kro.run/kro-version: v0.10.0
    kro.run/node-id: config
    kro.run/owned: "true"
  name: hallo
  namespace: app
  • The kro.run/… labels say which instance and which node (node-id) the object belongs to. With them you’ll later find everything that belongs to an instance.
  • applyset.kubernetes.io/part-of: kro keeps track of everything it has created via an ApplySet. If an object drops out of the RGD, kro knows what it has to clean up.

Save your progress? Sign up for free

Drill 5: kro Is Watching

Change the ConfigMap by hand:

kubectl -n app patch configmap hallo --type merge -p '{"data":{"message":"von Hand"}}'
kubectl -n app get configmap hallo -o jsonpath='{.data.message}{"\n"}'

Expected:

configmap/hallo patched
Hallo kro

The change was gone again before you could look. kro watches the objects it has created and immediately resets any deviation. This is called drift correction.

Delete the ConfigMap:

kubectl -n app delete configmap hallo
kubectl -n app get configmap hallo

Expected:

configmap "hallo" deleted from app namespace
NAME    DATA   AGE
hallo   1      5s

It is back immediately. What the instance itself says about its state:

kubectl -n app get greeting hallo \
  -o jsonpath='{range .status.conditions[*]}{.type}={.status}{"\n"}{end}'

Expected:

InstanceManaged=True
GraphResolved=True
ResourcesReady=True
Ready=True
Condition Meaning
InstanceManaged kro has set finalizer and labels
GraphResolved All expressions could be evaluated
ResourcesReady All objects are created and ready
Ready All three above are True

Save your progress? Sign up for free

Drill 6: What the Controller Says

kubectl -n kro-system logs deploy/kro | grep greeting

Expected (shortened):

... INFO rgd-controller Creating CRD {"controller": "ResourceGraphDefinition",
  ..., "name": "greeting", ..., "name": "greetings.kro.run"}
... INFO rgd-controller Waiting for CRD to become ready {..., "name": "greeting",
  ...}

The logs are your first port of call when an RGD doesn’t become Active.

Save your progress? Sign up for free

Checkpoint

kubectl get rgd greeting

Expected: STATE Active, READY True.

kubectl -n app get greeting hallo

Expected: STATE ACTIVE, READY True.

kubectl -n app get configmap -l kro.run/instance-name=hallo

Expected:

NAME    DATA   AGE
hallo   1      3m

The label finds all objects of an instance, regardless of kind.

Challenge

Change the message of the instance hallo to “Servus kro” without touching the ConfigMap. Then check the ConfigMap and finally delete the instance. What happens to the ConfigMap?

Note: The instance is an object like any other; kubectl patch or kubectl edit work.

Solution

kubectl -n app patch greeting hallo --type merge -p '{"spec":{"message":"Servus kro"}}'
kubectl -n app get configmap hallo -o jsonpath='{.data.message}{"\n"}'
kubectl -n app delete greeting hallo
kubectl -n app get configmap hallo

Expected:

greeting.kro.run/hallo patched
Servus kro
greeting.kro.run "hallo" deleted from app namespace
Error from server (NotFound): configmaps "hallo" not found

Together with the instance, kro deletes everything it created for it. It removes the finalizer kro.run/finalizer on the instance only once the ConfigMap is gone.

Save your progress? Sign up for free

Enterprise Note

  • Pin the version: kro is still pre-1.0; the API is called v1alpha1. Pin the chart version and read the upgrade notes before every upgrade (Day 14).
  • One controller per cluster: kro runs as one Deployment with leader election. More replicas don’t make kro faster; they only ensure a quick failover when a pod fails.
  • unrestricted is for the lab: In this mode kro may do everything, and anyone allowed to create an RGD can use it to create any object in the cluster. Day 12 shows the way out.