--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.21.0 name: resourcegraphdefinitions.kro.run spec: group: kro.run names: kind: ResourceGraphDefinition listKind: ResourceGraphDefinitionList plural: resourcegraphdefinitions shortNames: - rgd singular: resourcegraphdefinition scope: Cluster versions: - additionalPrinterColumns: - jsonPath: .spec.schema.apiVersion name: APIVERSION type: string - jsonPath: .spec.schema.kind name: KIND type: string - jsonPath: .status.state name: STATE type: string - jsonPath: .status.conditions[?(@.type=="Ready")].status name: READY type: string - jsonPath: .status.topologicalOrder name: TOPOLOGICALORDER priority: 1 type: string - jsonPath: .metadata.creationTimestamp name: AGE type: date name: v1alpha1 schema: openAPIV3Schema: description: |- ResourceGraphDefinition is the core API for defining reusable groups of Kubernetes resources. It allows you to create custom resources that manage multiple underlying resources as a cohesive unit. When you create a ResourceGraphDefinition, kro automatically generates a CRD and deploys a controller to manage instances of your custom resource. Resources can reference each other using CEL expressions, and kro ensures they are created in the correct dependency order. properties: apiVersion: description: |- APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: description: |- Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object spec: description: |- ResourceGraphDefinitionSpec defines the desired state of ResourceGraphDefinition. It contains the schema for instances (defining the CRD structure) and the list of Kubernetes resources that make up the graph. properties: resources: description: |- Resources is the list of Kubernetes resources that will be created and managed for each instance. Resources can reference each other using CEL expressions, creating a dependency graph that determines creation order. items: description: |- Resource represents a Kubernetes resource that is part of the ResourceGraphDefinition. Each resource can either be created using a template or reference an existing resource. Resources can depend on each other through CEL expressions, creating a dependency graph. properties: externalRef: description: |- ExternalRef references an existing resource in the cluster instead of creating one. This is useful for reading existing resources and using their values in other resources. Exactly one of template or externalRef must be provided. properties: apiVersion: description: |- APIVersion is the API version of the external resource. Example: "v1" for core resources, "apps/v1" for Deployments. type: string kind: description: |- Kind is the kind of the external resource. Example: "Service", "ConfigMap", "Deployment". type: string metadata: description: Metadata contains the name and optional namespace of the external resource. properties: name: description: |- Name is the name of the external resource to reference. Mutually exclusive with Selector. minLength: 1 type: string namespace: description: |- Namespace is the namespace of the external resource. For single external refs (Name), defaults to the instance's namespace. For external collections (Selector), empty means list across all namespaces. type: string selector: description: |- Selector is a label selector for collection external references. When set, all resources matching the selector are included. Mutually exclusive with Name. properties: matchExpressions: description: matchExpressions is a list of label selector requirements. The requirements are ANDed. items: description: |- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. properties: key: description: key is the label key that the selector applies to. type: string operator: description: |- operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. type: string values: description: |- values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. items: type: string type: array x-kubernetes-list-type: atomic required: - key - operator type: object type: array x-kubernetes-list-type: atomic matchLabels: additionalProperties: type: string description: |- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic type: object x-kubernetes-validations: - message: exactly one of name or selector must be provided rule: (has(self.name) && !has(self.selector)) || (!has(self.name) && has(self.selector)) required: - apiVersion - kind - metadata type: object forEach: description: |- ForEach expands this resource into a collection of resources. Each entry binds a variable name to a CEL expression that evaluates to an array. kro creates one resource instance for each element in the array. With multiple entries, kro creates the cartesian product of all combinations. Use the variable directly in template expressions (e.g., ${region}). Example: [{"region": "${schema.spec.regions}"}, {"tier": "${schema.spec.tiers}"}] items: additionalProperties: type: string description: |- ForEachDimension defines a single expansion axis in a forEach block. Each dimension is a map with exactly one entry where the key is the variable name and the value is the CEL expression. Example: {"region": "${schema.spec.regions}"} Multiple dimensions create a cartesian product of expansions. maxProperties: 1 minProperties: 1 type: object type: array id: description: |- ID is a unique identifier for this resource within the ResourceGraphDefinition. It is used to reference this resource in CEL expressions from other resources. Example: "deployment", "service", "configmap". type: string includeWhen: description: |- IncludeWhen is a list of CEL expressions that determine whether this resource should be created. All expressions must evaluate to true for the resource to be included. If not specified, the resource is always included. Expressions may reference schema fields and/or fields in other resources in the RGD. They are re-evaluated during reconciliation, so resources may be created later or pruned later as conditions change. Each entry must be a single standalone CEL expression wrapped in ${...}. Example: ["${schema.spec.enableMonitoring == true}", "${network.status.ready == true}"] items: type: string type: array readyWhen: description: |- ReadyWhen is a list of CEL expressions that determine when this resource is considered ready. All expressions must evaluate to true for the resource to be ready. If not specified, the resource is considered ready when it exists. Each entry must be a single standalone CEL expression wrapped in ${...}. Examples: - Single resource: ["${database.status.phase == 'Running'}", "${database.status.readyReplicas > 0}"] - Collection: ["${each.status.phase == 'Running'}"] items: type: string type: array template: description: |- Template is the Kubernetes resource manifest to create. It can contain CEL expressions (using ${...} syntax) that reference other resources. Exactly one of template or externalRef must be provided. type: object x-kubernetes-preserve-unknown-fields: true required: - id type: object x-kubernetes-validations: - message: exactly one of template or externalRef must be provided rule: (has(self.template) && !has(self.externalRef)) || (!has(self.template) && has(self.externalRef)) type: array schema: description: |- Schema defines the structure of instances created from this ResourceGraphDefinition. It specifies the API version, kind, and fields (spec/status) for the generated CRD. Use SimpleSchema syntax to define the instance schema concisely. properties: additionalPrinterColumns: description: |- AdditionalPrinterColumns defines additional printer columns that will be passed down to the created CRD. If set, no default printer columns will be added to the created CRD, and if default printer columns need to be retained, they need to be added explicitly. items: description: CustomResourceColumnDefinition specifies a column for server side printing. properties: description: description: description is a human readable description of this column. type: string format: description: |- format is an optional OpenAPI type definition for this column. The 'name' format is applied to the primary identifier column to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. type: string jsonPath: description: |- jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against each custom resource to produce the value for this column. type: string name: description: name is a human readable name for the column. type: string priority: description: |- priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a priority greater than 0. format: int32 type: integer type: description: |- type is an OpenAPI type definition for this column. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. type: string required: - jsonPath - name - type type: object type: array apiVersion: description: |- APIVersion is the version identifier for the generated CRD. Must follow Kubernetes versioning conventions (v1, v1alpha1, v1beta1, etc.). This field is immutable after creation. Example: "v1alpha1", "v1", "v2beta1" pattern: ^v[0-9]+(alpha[0-9]+|beta[0-9]+)?$ type: string x-kubernetes-validations: - message: apiVersion is immutable rule: self == oldSelf categories: description: |- Categories is a list of grouped resources this custom resource belongs to. Resources in a category can be retrieved together with `kubectl get `. Example: ["kro"] makes instances appear in `kubectl get kro`. items: maxLength: 63 pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$ type: string maxItems: 32 type: array x-kubernetes-list-type: set group: default: kro.run description: |- Group is the API group for the generated CRD. Together with APIVersion and Kind, it forms the complete GVK (Group-Version-Kind) identifier. If omitted, defaults to "kro.run". This field is immutable after creation. Example: "mycompany.io", "databases.example.com" type: string x-kubernetes-validations: - message: group is immutable rule: self == oldSelf kind: description: |- Kind is the name of the custom resource type that will be created. This becomes the kind field of the generated CRD and must be a valid Kubernetes kind name (PascalCase, starting with a capital letter). This field is immutable after creation. Example: "WebApplication", "Database", "MicroService" pattern: ^[A-Z][a-zA-Z0-9]{0,62}$ type: string x-kubernetes-validations: - message: kind is immutable rule: self == oldSelf metadata: description: Metadata to apply to the generated CRD properties: annotations: additionalProperties: type: string description: Annotations to apply to the generated CRD type: object labels: additionalProperties: type: string description: Labels to apply to the generated CRD type: object type: object scope: default: Namespaced description: |- Scope determines whether the generated instance CRD is Namespaced or Cluster scoped. Defaults to Namespaced to preserve existing behaviour. This field is immutable after creation. enum: - Namespaced - Cluster type: string x-kubernetes-validations: - message: scope is immutable rule: self == oldSelf shortNames: description: |- ShortNames are aliases for the generated CRD that can be used with kubectl. Example: ["wa", "webapp"] allows `kubectl get wa` or `kubectl get webapp` instead of `kubectl get webapplications`. items: maxLength: 63 pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$ type: string maxItems: 32 type: array x-kubernetes-list-type: set spec: description: |- Spec defines the schema for the instance's spec section using SimpleSchema syntax. This becomes the OpenAPI schema for instances of the generated CRD. Use SimpleSchema's concise syntax to define fields, types, defaults, and validations. Markers are space-separated after a single "|" separator. Example: {"replicas": "integer | default=1 minimum=1 maximum=10"} type: object x-kubernetes-preserve-unknown-fields: true status: description: |- Status defines the schema for the instance's status section using SimpleSchema syntax. Unlike spec, status fields use CEL expressions to project values from underlying resources. This allows you to surface important information from managed resources at the instance level. Example: {"connectionName": "${database.status.connectionName}", "endpoint": "${service.status.loadBalancer.ingress[0].hostname}"} type: object x-kubernetes-preserve-unknown-fields: true types: description: |- Types is a map of custom type definitions that can be referenced in the Spec. This allows you to define reusable complex types using SimpleSchema syntax. Reference custom types in Spec using the type name. Example: {"Server": {"host": "string", "port": "integer"}} type: object x-kubernetes-preserve-unknown-fields: true required: - apiVersion - kind - scope type: object required: - schema type: object status: description: |- ResourceGraphDefinitionStatus defines the observed state of ResourceGraphDefinition. It provides information about the deployment state, resource ordering, and conditions. properties: conditions: description: |- Conditions represent the latest available observations of the ResourceGraphDefinition's state. Common condition types include "Ready", "GraphRevisionsResolved", "GraphAccepted", "KindReady", and "ControllerReady". items: description: |- Condition is the common struct used by all CRDs managed by ACK service controllers to indicate terminal states of the CR and its backend AWS service API resource properties: lastTransitionTime: description: Last time the condition transitioned from one status to another. format: date-time type: string message: description: A human-readable message indicating details about the transition. type: string observedGeneration: description: |- observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: description: The reason for the condition's last transition. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: description: Type is the type of the Condition type: string required: - status - type type: object type: array lastIssuedRevision: description: |- LastIssuedRevision is the highest GraphRevision revision number ever issued for this RGD. It is a persisted high-water mark used to keep revision allocation monotonic across GC. format: int64 type: integer resources: description: |- Resources provides detailed information about each resource in the graph, including their dependencies. items: description: |- ResourceInformation provides detailed information about a specific resource in the ResourceGraphDefinition, particularly its dependencies on other resources. properties: dependencies: description: |- Dependencies lists all resources that this resource depends on. A resource depends on another if it references it in a CEL expression. These dependencies determine the order of resource creation. items: description: |- Dependency represents a dependency relationship between resources. When a resource uses CEL expressions to reference another resource, a dependency is created to ensure proper ordering. properties: id: description: ID is the unique identifier of the resource that this resource depends on. type: string type: object type: array id: description: ID is the unique identifier of the resource as defined in the resources list. type: string type: object type: array state: description: |- State indicates whether the ResourceGraphDefinition is Active or Inactive. Active means the graph is accepted and the generated CRD and dynamic controller are currently serving. Inactive means the current graph is not accepted or the RGD is not currently serving. type: string topologicalOrder: description: |- TopologicalOrder is the ordered list of resource IDs based on their dependencies. Resources are created in this order to ensure dependencies are satisfied. Example: ["configmap", "deployment", "service"] items: type: string type: array type: object type: object served: true storage: true subresources: status: {}