Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the x v1alpha1 API group +kubebuilder:object:generate=true +groupName=kro.run
Index ¶
- Constants
- Variables
- func IsReconcileSuspended(value string) bool
- type CRDMetadata
- type Condition
- type ConditionType
- type Conditions
- type Dependency
- type ExternalRef
- type ExternalRefMetadata
- type ForEachDimension
- type InstanceState
- type NodeState
- type Resource
- type ResourceGraphDefinition
- func (in *ResourceGraphDefinition) DeepCopy() *ResourceGraphDefinition
- func (in *ResourceGraphDefinition) DeepCopyInto(out *ResourceGraphDefinition)
- func (in *ResourceGraphDefinition) DeepCopyObject() runtime.Object
- func (o *ResourceGraphDefinition) GetConditions() []Condition
- func (o *ResourceGraphDefinition) SetConditions(conditions []Condition)
- type ResourceGraphDefinitionList
- type ResourceGraphDefinitionSpec
- type ResourceGraphDefinitionState
- type ResourceGraphDefinitionStatus
- type ResourceInformation
- type ResourceScope
- type Schema
Constants ¶
const ( // AllowBreakingChangesAnnotation allows RGD updates that would otherwise be // blocked due to breaking schema changes. Use with caution - breaking changes // can invalidate existing instances. AllowBreakingChangesAnnotation = KRODomainName + "/allow-breaking-changes" // InstanceReconcileAnnotation controls instance reconciliation. When set to // "suspended" (case-insensitive), the instance controller skips resource // reconciliation and marks the instance as suspended. // "disabled" is accepted as a legacy alias for backward compatibility. InstanceReconcileAnnotation = KRODomainName + "/reconcile" // ReconcileSuspended is the canonical annotation value to suspend reconciliation. ReconcileSuspended = "suspended" // ReconcileLegacyDisabled is the legacy annotation value for suspending reconciliation. // Kept for backward compatibility; prefer ReconcileSuspended. ReconcileLegacyDisabled = "disabled" )
Annotations for ResourceGraphDefinitions
const (
KRODomainName = "kro.run"
)
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: KRODomainName, Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func IsReconcileSuspended ¶ added in v0.9.1
IsReconcileSuspended reports whether the given annotation value represents a suspended reconciliation state. It accepts "suspended" (canonical) and "disabled" (legacy) in a case-insensitive manner.
Types ¶
type CRDMetadata ¶ added in v0.8.0
type CRDMetadata struct {
// Labels to apply to the generated CRD
// +kubebuilder:validation:Optional
Labels map[string]string `json:"labels,omitempty"`
// Annotations to apply to the generated CRD
// +kubebuilder:validation:Optional
Annotations map[string]string `json:"annotations,omitempty"`
}
CRDMetadata defines metadata to be applied to the generated CRD.
func (*CRDMetadata) DeepCopy ¶ added in v0.8.0
func (in *CRDMetadata) DeepCopy() *CRDMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRDMetadata.
func (*CRDMetadata) DeepCopyInto ¶ added in v0.8.0
func (in *CRDMetadata) DeepCopyInto(out *CRDMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Condition ¶
type Condition struct {
// Type is the type of the Condition
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status metav1.ConditionStatus `json:"status"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
// +optional
Reason *string `json:"reason,omitempty"`
// A human-readable message indicating details about the transition.
// +optional
Message *string `json:"message,omitempty"`
// 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.
// +optional
// +kubebuilder:validation:Minimum=0
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}
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
func (*Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Condition) GetStatus ¶
func (c *Condition) GetStatus() metav1.ConditionStatus
type ConditionType ¶
type ConditionType string
ConditionType is a type of condition for a resource.
const ( // RGDConditionTypeGraphAccepted is true when the RGD spec (schema and // resource templates) passes validation. False with reason // "InvalidResourceGraph" when the spec contains errors. RGDConditionTypeGraphAccepted ConditionType = "GraphAccepted" // RGDConditionTypeGraphRevisionsResolved is true when all // GraphRevisions for this RGD have been discovered, no terminating // revisions remain in flight, and the latest revision's state in the // in-memory registry is known. Unknown while revisions are settling // (terminating GRs still deleting), warming (latest not yet in the // cache or registry), or compiling (latest is Pending). False when // the latest revision fails compilation. RGDConditionTypeGraphRevisionsResolved ConditionType = "GraphRevisionsResolved" // RGDConditionTypeKindReady is true when the generated // CustomResourceDefinition has been applied and its Established // condition is true. RGDConditionTypeKindReady ConditionType = "KindReady" // RGDConditionTypeControllerReady is true when the instance reconciler // for this RGD's generated kind is registered with the dynamic // controller and ready to reconcile instances. RGDConditionTypeControllerReady ConditionType = "ControllerReady" )
ResourceGraphDefinition condition types.
Ready (root) ├── GraphRevisionsResolved — all revisions discovered and latest state known ├── GraphAccepted — RGD spec schema and resources are valid ├── KindReady — generated CRD is established └── ControllerReady — instance reconciler is registered and serving
func (ConditionType) String ¶
func (c ConditionType) String() string
type Conditions ¶
type Conditions []Condition
Conditions is a list of conditions.
func (Conditions) DeepCopy ¶
func (in Conditions) DeepCopy() Conditions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions.
func (Conditions) DeepCopyInto ¶
func (in Conditions) DeepCopyInto(out *Conditions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (Conditions) Has ¶
func (conditions Conditions) Has(t ConditionType) bool
Has returns true if the conditions list contains the given condition type.
func (Conditions) Set ¶
func (conditions Conditions) Set(condition Condition) []Condition
Set sets the provided condition into the conditions list, if it exists already the condition is replaced.
type Dependency ¶
type Dependency struct {
// ID is the unique identifier of the resource that this resource depends on.
ID string `json:"id,omitempty"`
}
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.
func (*Dependency) DeepCopy ¶
func (in *Dependency) DeepCopy() *Dependency
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dependency.
func (*Dependency) DeepCopyInto ¶
func (in *Dependency) DeepCopyInto(out *Dependency)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExternalRef ¶
type ExternalRef struct {
// APIVersion is the API version of the external resource.
// Example: "v1" for core resources, "apps/v1" for Deployments.
//
// +kubebuilder:validation:Required
APIVersion string `json:"apiVersion"`
// Kind is the kind of the external resource.
// Example: "Service", "ConfigMap", "Deployment".
//
// +kubebuilder:validation:Required
Kind string `json:"kind"`
// Metadata contains the name and optional namespace of the external resource.
//
// +kubebuilder:validation:Required
Metadata ExternalRefMetadata `json:"metadata"`
}
ExternalRef is a reference to an external resource that already exists in the cluster. It allows you to read and use existing resources in your ResourceGraphDefinition without creating them. The referenced resource's fields can be accessed using CEL expressions in other resources.
func (*ExternalRef) DeepCopy ¶
func (in *ExternalRef) DeepCopy() *ExternalRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalRef.
func (*ExternalRef) DeepCopyInto ¶
func (in *ExternalRef) DeepCopyInto(out *ExternalRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExternalRefMetadata ¶
type ExternalRefMetadata struct {
// Name is the name of the external resource to reference.
// Mutually exclusive with Selector.
//
// +kubebuilder:validation:Optional
// +kubebuilder:validation:MinLength=1
Name string `json:"name,omitempty"`
// 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.
//
// +kubebuilder:validation:Optional
Namespace string `json:"namespace,omitempty"`
// Selector is a label selector for collection external references.
// When set, all resources matching the selector are included.
// Mutually exclusive with Name.
//
// +kubebuilder:validation:Optional
Selector *metav1.LabelSelector `json:"selector,omitempty"`
}
+kubebuilder:validation:XValidation:rule="(has(self.name) && !has(self.selector)) || (!has(self.name) && has(self.selector))",message="exactly one of name or selector must be provided"
func (*ExternalRefMetadata) DeepCopy ¶
func (in *ExternalRefMetadata) DeepCopy() *ExternalRefMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalRefMetadata.
func (*ExternalRefMetadata) DeepCopyInto ¶
func (in *ExternalRefMetadata) DeepCopyInto(out *ExternalRefMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ForEachDimension ¶ added in v0.8.0
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.
+kubebuilder:validation:MinProperties=1 +kubebuilder:validation:MaxProperties=1
func (ForEachDimension) DeepCopy ¶ added in v0.8.0
func (in ForEachDimension) DeepCopy() ForEachDimension
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForEachDimension.
func (ForEachDimension) DeepCopyInto ¶ added in v0.8.0
func (in ForEachDimension) DeepCopyInto(out *ForEachDimension)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InstanceState ¶ added in v0.9.0
type InstanceState string
InstanceState represents high-level reconciliation state for an instance.
const ( // InstanceStateInProgress means reconciliation is ongoing. InstanceStateInProgress InstanceState = "IN_PROGRESS" // Deprecated: InstanceStateFailed is a legacy state kept for compatibility. InstanceStateFailed InstanceState = "FAILED" // InstanceStateActive means all nodes reached terminal success states. InstanceStateActive InstanceState = "ACTIVE" // InstanceStateDeleting means deletion workflow is running. InstanceStateDeleting InstanceState = "DELETING" // InstanceStateError means reconciliation hit an error. InstanceStateError InstanceState = "ERROR" )
type NodeState ¶ added in v0.9.0
type NodeState string
NodeState tracks the lifecycle of individual nodes during reconciliation.
const ( NodeStateInProgress NodeState = "IN_PROGRESS" NodeStateDeleting NodeState = "DELETING" NodeStateSkipped NodeState = "SKIPPED" NodeStateError NodeState = "ERROR" NodeStateSynced NodeState = "SYNCED" NodeStateDeleted NodeState = "DELETED" NodeStateWaitingForReadiness NodeState = "WAITING_FOR_READINESS" )
type Resource ¶
type Resource struct {
// 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".
//
// +kubebuilder:validation:Required
ID string `json:"id,omitempty"`
// 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.
//
// +kubebuilder:validation:Optional
Template runtime.RawExtension `json:"template,omitempty"`
// 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.
//
// +kubebuilder:validation:Optional
ExternalRef *ExternalRef `json:"externalRef,omitempty"`
// 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.
// Examples:
// - Single resource: ["database.status.phase == 'Running'", "database.status.readyReplicas > 0"]
// - Collection: ["each.status.phase == 'Running'"]
//
// +kubebuilder:validation:Optional
ReadyWhen []string `json:"readyWhen,omitempty"`
// 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.
// Example: ["schema.spec.enableMonitoring == true", "network.status.ready == true"]
//
// +kubebuilder:validation:Optional
IncludeWhen []string `json:"includeWhen,omitempty"`
// 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}"}]
//
// +kubebuilder:validation:Optional
ForEach []ForEachDimension `json:"forEach,omitempty"`
}
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.
+kubebuilder:validation:XValidation:rule="(has(self.template) && !has(self.externalRef)) || (!has(self.template) && has(self.externalRef))",message="exactly one of template or externalRef must be provided"
func (*Resource) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource.
func (*Resource) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceGraphDefinition ¶
type ResourceGraphDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ResourceGraphDefinitionSpec `json:"spec,omitempty"`
Status ResourceGraphDefinitionStatus `json:"status,omitempty"`
}
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.
func (*ResourceGraphDefinition) DeepCopy ¶
func (in *ResourceGraphDefinition) DeepCopy() *ResourceGraphDefinition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGraphDefinition.
func (*ResourceGraphDefinition) DeepCopyInto ¶
func (in *ResourceGraphDefinition) DeepCopyInto(out *ResourceGraphDefinition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourceGraphDefinition) DeepCopyObject ¶
func (in *ResourceGraphDefinition) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ResourceGraphDefinition) GetConditions ¶
func (o *ResourceGraphDefinition) GetConditions() []Condition
func (*ResourceGraphDefinition) SetConditions ¶
func (o *ResourceGraphDefinition) SetConditions(conditions []Condition)
type ResourceGraphDefinitionList ¶
type ResourceGraphDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourceGraphDefinition `json:"items"`
}
ResourceGraphDefinitionList contains a list of ResourceGraphDefinition
func (*ResourceGraphDefinitionList) DeepCopy ¶
func (in *ResourceGraphDefinitionList) DeepCopy() *ResourceGraphDefinitionList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGraphDefinitionList.
func (*ResourceGraphDefinitionList) DeepCopyInto ¶
func (in *ResourceGraphDefinitionList) DeepCopyInto(out *ResourceGraphDefinitionList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourceGraphDefinitionList) DeepCopyObject ¶
func (in *ResourceGraphDefinitionList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ResourceGraphDefinitionSpec ¶
type ResourceGraphDefinitionSpec struct {
// 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.
//
// +kubebuilder:validation:Required
Schema *Schema `json:"schema,omitempty"`
// 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.
//
// +kubebuilder:validation:Optional
Resources []*Resource `json:"resources,omitempty"`
}
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.
func (*ResourceGraphDefinitionSpec) DeepCopy ¶
func (in *ResourceGraphDefinitionSpec) DeepCopy() *ResourceGraphDefinitionSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGraphDefinitionSpec.
func (*ResourceGraphDefinitionSpec) DeepCopyInto ¶
func (in *ResourceGraphDefinitionSpec) DeepCopyInto(out *ResourceGraphDefinitionSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceGraphDefinitionState ¶
type ResourceGraphDefinitionState string
ResourceGraphDefinitionState defines the state of the resource graph definition.
const ( // ResourceGraphDefinitionStateActive represents the active state of the resource definition. ResourceGraphDefinitionStateActive ResourceGraphDefinitionState = "Active" // ResourceGraphDefinitionStateInactive represents the inactive state of the resource graph definition ResourceGraphDefinitionStateInactive ResourceGraphDefinitionState = "Inactive" )
type ResourceGraphDefinitionStatus ¶
type ResourceGraphDefinitionStatus struct {
// 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.
State ResourceGraphDefinitionState `json:"state,omitempty"`
// 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"]
TopologicalOrder []string `json:"topologicalOrder,omitempty"`
// Conditions represent the latest available observations of the ResourceGraphDefinition's state.
// Common condition types include "Ready", "GraphRevisionsResolved", "GraphAccepted",
// "KindReady", and "ControllerReady".
Conditions Conditions `json:"conditions,omitempty"`
// Resources provides detailed information about each resource in the graph,
// including their dependencies.
Resources []ResourceInformation `json:"resources,omitempty"`
// 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.
LastIssuedRevision int64 `json:"lastIssuedRevision,omitempty"`
}
ResourceGraphDefinitionStatus defines the observed state of ResourceGraphDefinition. It provides information about the deployment state, resource ordering, and conditions.
func (*ResourceGraphDefinitionStatus) DeepCopy ¶
func (in *ResourceGraphDefinitionStatus) DeepCopy() *ResourceGraphDefinitionStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceGraphDefinitionStatus.
func (*ResourceGraphDefinitionStatus) DeepCopyInto ¶
func (in *ResourceGraphDefinitionStatus) DeepCopyInto(out *ResourceGraphDefinitionStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceInformation ¶
type ResourceInformation struct {
// ID is the unique identifier of the resource as defined in the resources list.
ID string `json:"id,omitempty"`
// 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.
Dependencies []Dependency `json:"dependencies,omitempty"`
}
ResourceInformation provides detailed information about a specific resource in the ResourceGraphDefinition, particularly its dependencies on other resources.
func (*ResourceInformation) DeepCopy ¶
func (in *ResourceInformation) DeepCopy() *ResourceInformation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceInformation.
func (*ResourceInformation) DeepCopyInto ¶
func (in *ResourceInformation) DeepCopyInto(out *ResourceInformation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceScope ¶ added in v0.9.0
type ResourceScope string
ResourceScope defines whether the generated instance CRD is Namespaced or Cluster scoped.
+kubebuilder:validation:Enum=Namespaced;Cluster
const ( // ResourceScopeNamespaced means the generated instance CRD will be namespace-scoped. // This is the default. ResourceScopeNamespaced ResourceScope = "Namespaced" // ResourceScopeCluster means the generated instance CRD will be cluster-scoped. ResourceScopeCluster ResourceScope = "Cluster" )
type Schema ¶
type Schema struct {
// 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"
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:Pattern=`^[A-Z][a-zA-Z0-9]{0,62}$`
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="kind is immutable"
Kind string `json:"kind,omitempty"`
// 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"
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:Pattern=`^v[0-9]+(alpha[0-9]+|beta[0-9]+)?$`
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="apiVersion is immutable"
APIVersion string `json:"apiVersion,omitempty"`
// 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"
//
// +kubebuilder:validation:Optional
// +kubebuilder:default="kro.run"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="group is immutable"
Group string `json:"group,omitempty"`
// 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.
// Example: {"replicas": "integer | default=1 | min=1 | max=10"}
Spec runtime.RawExtension `json:"spec,omitempty"`
// 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"}}
Types runtime.RawExtension `json:"types,omitempty"`
// 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}"}
Status runtime.RawExtension `json:"status,omitempty"`
// 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.
//
// +kubebuilder:validation:Required
// +kubebuilder:default="Namespaced"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="scope is immutable"
Scope ResourceScope `json:"scope,omitempty"`
// 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.
//
// +kubebuilder:validation:Optional
AdditionalPrinterColumns []extv1.CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty"`
// Metadata to apply to the generated CRD
// +kubebuilder:validation:Optional
Metadata *CRDMetadata `json:"metadata,omitempty"`
}
Schema defines the structure and behavior of instances created from a ResourceGraphDefinition. It specifies the API group, version, and kind for the generated CRD, along with the spec and status schemas using SimpleSchema syntax. You can also define custom types, validation rules, and printer columns.
func (*Schema) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Schema.
func (*Schema) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.