Files
oam/knowledge base/kubernetes/kro.md
2026-01-03 14:16:46 +01:00

2.5 KiB

Kube Resource Orchestrator

Allows defining custom Kubernetes APIs using simple and straightforward configuration.

  1. TL;DR
  2. Create the RDG
  3. Further readings
    1. Sources

TL;DR

Configuring new custom APIs creates a group of Kubernetes objects and the logical operations between them.
kro calculates the order in which objects should be created based on Common Expression Language expressions.

CLE allows passing values from one object to another, and incorporate conditionals into the custom API definitions.
One can define default values for fields in the API specification, allowing end users to invoke custom APIs to create grouped resources with minimal configuration.

Installing kro in a cluster installs the ResourceGraphDefinition Custom Resource Definition.

Custom APIs are created by defining Custom Resources for the ResourceGraphDefinition CRD.
Those CRs encapsulate the necessary resources, any additional logic, abstractions, and best practices.
When the CR is applied to the cluster, it creates a new API of the kind it describes. Users can then create an instance of the CR, which will make the custom API handle the deployment and configuration of the required resources.

When creating an RGD, kro:

  1. Treats resources as a Directed Acyclic Graph to understand their dependencies.
  2. Validates resource definitions and detects the correct deployment order.
  3. Creates a new API in the cluster from the CR.
  4. Configures itself to watch and serve instances of this API, continuously reconciling the resources defined by the RDG.
Setup
# Install.
helm --namespace 'kro-system' --create-namespace upgrade --install 'kro' 'oci://registry.k8s.io/kro/charts/kro'
helm -n 'kro-system' --create-namespace install 'kro' 'oci://registry.k8s.io/kro/charts/kro' --version '0.7.1'

# Uninstall.
helm -n 'kro-system' uninstall 'kro'

Create the RDG

  1. Create its manifest file.

  2. Apply the RGD to the Kubernetes cluster:

    kubectl apply -f 'resourceGraphDefinition.yaml'
    
  3. Check the status of the RGD:

    kubectl get rgd 'myApplication' -o 'wide'
    

Further readings

Sources