From 6fcb8123f7ad3987507bbfd3f52a0617c7258695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Sun, 11 Feb 2024 10:55:47 +0100 Subject: [PATCH] add tinkerbell/cluster-api-provider-tinkerbell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Hoß --- .reuse/dep5 | 4 + code-generator/src/catalog.rs | 9 + .../v1beta1/tinkerbellclusters.yaml | 83 +++++++ .../v1beta1/tinkerbellmachines.yaml | 209 ++++++++++++++++++ .../v1beta1/tinkerbellmachinetemplates.yaml | 166 ++++++++++++++ .../v1beta1/mod.rs | 3 + .../v1beta1/tinkerbellclusters.rs | 50 +++++ .../v1beta1/tinkerbellmachines.rs | 155 +++++++++++++ .../v1beta1/tinkerbellmachinetemplates.rs | 136 ++++++++++++ kube-custom-resources-rs/src/lib.rs | 3 + 10 files changed, 818 insertions(+) create mode 100644 crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellclusters.yaml create mode 100644 crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachines.yaml create mode 100644 crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachinetemplates.yaml create mode 100644 kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellclusters.rs create mode 100644 kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellmachines.rs create mode 100644 kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellmachinetemplates.rs diff --git a/.reuse/dep5 b/.reuse/dep5 index 741379db0..b53c4d3fa 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -895,6 +895,10 @@ Files: crd-catalog/theketchio/ketch/* Copyright: The theketchio/ketch Authors License: Apache-2.0 +Files: crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/* +Copyright: The tinkerbell/cluster-api-provider-tinkerbell Authors +License: Apache-2.0 + Files: crd-catalog/tinkerbell/rufio/* Copyright: The tinkerbell/rufio Authors License: Apache-2.0 diff --git a/code-generator/src/catalog.rs b/code-generator/src/catalog.rs index ec215fada..96334e970 100644 --- a/code-generator/src/catalog.rs +++ b/code-generator/src/catalog.rs @@ -2339,6 +2339,15 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[ "https://github.com/theketchio/ketch/blob/main/config/crd/bases/theketch.io_jobs.yaml", ], }, + UpstreamSource { + project_name: "tinkerbell/cluster-api-provider-tinkerbell", + license: APACHE_V2, + urls: &[ + "https://github.com/tinkerbell/cluster-api-provider-tinkerbell/blob/main/config/crd/bases/infrastructure.cluster.x-k8s.io_tinkerbellclusters.yaml", + "https://github.com/tinkerbell/cluster-api-provider-tinkerbell/blob/main/config/crd/bases/infrastructure.cluster.x-k8s.io_tinkerbellmachines.yaml", + "https://github.com/tinkerbell/cluster-api-provider-tinkerbell/blob/main/config/crd/bases/infrastructure.cluster.x-k8s.io_tinkerbellmachinetemplates.yaml", + ], + }, UpstreamSource { project_name: "tinkerbell/rufio", license: APACHE_V2, diff --git a/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellclusters.yaml b/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellclusters.yaml new file mode 100644 index 000000000..db3f0d07c --- /dev/null +++ b/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellclusters.yaml @@ -0,0 +1,83 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.10.0" + name: "tinkerbellclusters.infrastructure.cluster.x-k8s.io" +spec: + group: "infrastructure.cluster.x-k8s.io" + names: + categories: + - "cluster-api" + kind: "TinkerbellCluster" + listKind: "TinkerbellClusterList" + plural: "tinkerbellclusters" + singular: "tinkerbellcluster" + scope: "Namespaced" + versions: + - additionalPrinterColumns: + - description: "Cluster to which this TinkerbellCluster belongs" + jsonPath: ".metadata.labels.cluster\\.x-k8s\\.io/cluster-name" + name: "Cluster" + type: "string" + - description: "TinkerbellCluster ready status" + jsonPath: ".status.ready" + name: "Ready" + type: "string" + name: "v1beta1" + schema: + openAPIV3Schema: + description: "TinkerbellCluster is the Schema for the tinkerbellclusters API." + 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: "TinkerbellClusterSpec defines the desired state of TinkerbellCluster." + properties: + controlPlaneEndpoint: + description: "ControlPlaneEndpoint is a required field by ClusterAPI v1beta1. \n See https://cluster-api.sigs.k8s.io/developer/architecture/controllers/cluster.html for more details." + properties: + host: + description: "The hostname on which the API server is serving." + type: "string" + port: + description: "The port on which the API server is serving." + format: "int32" + type: "integer" + required: + - "host" + - "port" + type: "object" + imageLookupBaseRegistry: + default: "ghcr.io/tinkerbell/cluster-api-provider-tinkerbell" + description: "ImageLookupBaseRegistry is the base Registry URL that is used for pulling images, if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell." + type: "string" + imageLookupFormat: + description: "ImageLookupFormat is the URL naming format to use for machine images when a machine does not specify. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupFormat. Supports substitutions for {{.BaseRegistry}}, {{.OSDistro}}, {{.OSVersion}} and {{.KubernetesVersion}} with the basse URL, OS distribution, OS version, and kubernetes version, respectively. BaseRegistry will be the value in ImageLookupBaseRegistry or ghcr.io/tinkerbell/cluster-api-provider-tinkerbell (the default), OSDistro will be the value in ImageLookupOSDistro or ubuntu (the default), OSVersion will be the value in ImageLookupOSVersion or default based on the OSDistro (if known), and the kubernetes version as defined by the packages produced by kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/" + type: "string" + imageLookupOSDistro: + default: "ubuntu" + description: "ImageLookupOSDistro is the name of the OS distro to use when fetching machine images, if not set it will default to ubuntu." + type: "string" + imageLookupOSVersion: + description: "ImageLookupOSVersion is the version of the OS distribution to use when fetching machine images. If not set it will default based on ImageLookupOSDistro." + type: "string" + type: "object" + status: + description: "TinkerbellClusterStatus defines the observed state of TinkerbellCluster." + properties: + ready: + description: "Ready denotes that the cluster (infrastructure) is ready." + type: "boolean" + type: "object" + type: "object" + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachines.yaml b/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachines.yaml new file mode 100644 index 000000000..2efcd2d1a --- /dev/null +++ b/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachines.yaml @@ -0,0 +1,209 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.10.0" + name: "tinkerbellmachines.infrastructure.cluster.x-k8s.io" +spec: + group: "infrastructure.cluster.x-k8s.io" + names: + categories: + - "cluster-api" + kind: "TinkerbellMachine" + listKind: "TinkerbellMachineList" + plural: "tinkerbellmachines" + singular: "tinkerbellmachine" + scope: "Namespaced" + versions: + - additionalPrinterColumns: + - description: "Cluster to which this TinkerbellMachine belongs" + jsonPath: ".metadata.labels.cluster\\.x-k8s\\.io/cluster-name" + name: "Cluster" + type: "string" + - description: "Tinkerbell instance state" + jsonPath: ".status.instanceState" + name: "State" + type: "string" + - description: "Machine ready status" + jsonPath: ".status.ready" + name: "Ready" + type: "string" + - description: "Tinkerbell instance ID" + jsonPath: ".spec.providerID" + name: "InstanceID" + type: "string" + - description: "Machine object which owns with this TinkerbellMachine" + jsonPath: ".metadata.ownerReferences[?(@.kind==\"Machine\")].name" + name: "Machine" + type: "string" + name: "v1beta1" + schema: + openAPIV3Schema: + description: "TinkerbellMachine is the Schema for the tinkerbellmachines API." + 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: "TinkerbellMachineSpec defines the desired state of TinkerbellMachine." + properties: + hardwareAffinity: + description: "HardwareAffinity allows filtering for hardware." + properties: + preferred: + description: "Preferred are the preferred hardware affinity terms. Hardware matching these terms are preferred according to the weights provided, but are not required." + items: + description: "WeightedHardwareAffinityTerm is a HardwareAffinityTerm with an associated weight. The weights of all the matched WeightedHardwareAffinityTerm fields are added per-hardware to find the most preferred hardware." + properties: + hardwareAffinityTerm: + description: "HardwareAffinityTerm is the term associated with the corresponding weight." + properties: + labelSelector: + description: "LabelSelector is used to select for particular hardware by label." + 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" + required: + - "key" + - "operator" + type: "object" + type: "array" + 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" + required: + - "labelSelector" + type: "object" + weight: + description: "Weight associated with matching the corresponding hardwareAffinityTerm, in the range 1-100." + format: "int32" + maximum: 100.0 + minimum: 1.0 + type: "integer" + required: + - "hardwareAffinityTerm" + - "weight" + type: "object" + type: "array" + required: + description: "Required are the required hardware affinity terms. The terms are OR'd together, hardware must match one term to be considered." + items: + description: "HardwareAffinityTerm is used to select for a particular existing hardware resource." + properties: + labelSelector: + description: "LabelSelector is used to select for particular hardware by label." + 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" + required: + - "key" + - "operator" + type: "object" + type: "array" + 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" + required: + - "labelSelector" + type: "object" + type: "array" + type: "object" + hardwareName: + description: "Those fields are set programmatically, but they cannot be re-constructed from \"state of the world\", so we put them in spec instead of status." + type: "string" + imageLookupBaseRegistry: + description: "ImageLookupBaseRegistry is the base Registry URL that is used for pulling images, if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell." + type: "string" + imageLookupFormat: + description: "ImageLookupFormat is the URL naming format to use for machine images when a machine does not specify. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupFormat. Supports substitutions for {{.BaseRegistry}}, {{.OSDistro}}, {{.OSVersion}} and {{.KubernetesVersion}} with the basse URL, OS distribution, OS version, and kubernetes version, respectively. BaseRegistry will be the value in ImageLookupBaseRegistry or ghcr.io/tinkerbell/cluster-api-provider-tinkerbell (the default), OSDistro will be the value in ImageLookupOSDistro or ubuntu (the default), OSVersion will be the value in ImageLookupOSVersion or default based on the OSDistro (if known), and the kubernetes version as defined by the packages produced by kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/" + type: "string" + imageLookupOSDistro: + description: "ImageLookupOSDistro is the name of the OS distro to use when fetching machine images, if not set it will default to ubuntu." + type: "string" + imageLookupOSVersion: + description: "ImageLookupOSVersion is the version of the OS distribution to use when fetching machine images. If not set it will default based on ImageLookupOSDistro." + type: "string" + providerID: + type: "string" + templateOverride: + description: "TemplateOverride overrides the default Tinkerbell template used by CAPT. You can learn more about Tinkerbell templates here: https://docs.tinkerbell.org/templates/" + type: "string" + type: "object" + status: + description: "TinkerbellMachineStatus defines the observed state of TinkerbellMachine." + properties: + addresses: + description: "Addresses contains the Tinkerbell device associated addresses." + items: + description: "NodeAddress contains information for the node's address." + properties: + address: + description: "The node address." + type: "string" + type: + description: "Node address type, one of Hostname, ExternalIP or InternalIP." + type: "string" + required: + - "address" + - "type" + type: "object" + type: "array" + errorMessage: + description: "ErrorMessage will be set in the event that there is a terminal problem reconciling the Machine and will contain a more verbose string suitable for logging and human consumption. \n This field should not be set for transitive errors that a controller faces that are expected to be fixed automatically over time (like service outages), but instead indicate that something is fundamentally wrong with the Machine's spec or the configuration of the controller, and that manual intervention is required. Examples of terminal errors would be invalid combinations of settings in the spec, values that are unsupported by the controller, or the responsible controller itself being critically misconfigured. \n Any transient errors that occur during the reconciliation of Machines can be added as events to the Machine object and/or logged in the controller's output." + type: "string" + errorReason: + description: "Any transient errors that occur during the reconciliation of Machines can be added as events to the Machine object and/or logged in the controller's output." + type: "string" + instanceStatus: + description: "InstanceStatus is the status of the Tinkerbell device instance for this machine." + type: "integer" + ready: + description: "Ready is true when the provider resource is ready." + type: "boolean" + type: "object" + type: "object" + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachinetemplates.yaml b/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachinetemplates.yaml new file mode 100644 index 000000000..881b6c0ac --- /dev/null +++ b/crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachinetemplates.yaml @@ -0,0 +1,166 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.10.0" + name: "tinkerbellmachinetemplates.infrastructure.cluster.x-k8s.io" +spec: + group: "infrastructure.cluster.x-k8s.io" + names: + categories: + - "cluster-api" + kind: "TinkerbellMachineTemplate" + listKind: "TinkerbellMachineTemplateList" + plural: "tinkerbellmachinetemplates" + singular: "tinkerbellmachinetemplate" + scope: "Namespaced" + versions: + - name: "v1beta1" + schema: + openAPIV3Schema: + description: "TinkerbellMachineTemplate is the Schema for the tinkerbellmachinetemplates API." + 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: "TinkerbellMachineTemplateSpec defines the desired state of TinkerbellMachineTemplate." + properties: + template: + description: "TinkerbellMachineTemplateResource describes the data needed to create am TinkerbellMachine from a template." + properties: + spec: + description: "Spec is the specification of the desired behavior of the machine." + properties: + hardwareAffinity: + description: "HardwareAffinity allows filtering for hardware." + properties: + preferred: + description: "Preferred are the preferred hardware affinity terms. Hardware matching these terms are preferred according to the weights provided, but are not required." + items: + description: "WeightedHardwareAffinityTerm is a HardwareAffinityTerm with an associated weight. The weights of all the matched WeightedHardwareAffinityTerm fields are added per-hardware to find the most preferred hardware." + properties: + hardwareAffinityTerm: + description: "HardwareAffinityTerm is the term associated with the corresponding weight." + properties: + labelSelector: + description: "LabelSelector is used to select for particular hardware by label." + 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" + required: + - "key" + - "operator" + type: "object" + type: "array" + 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" + required: + - "labelSelector" + type: "object" + weight: + description: "Weight associated with matching the corresponding hardwareAffinityTerm, in the range 1-100." + format: "int32" + maximum: 100.0 + minimum: 1.0 + type: "integer" + required: + - "hardwareAffinityTerm" + - "weight" + type: "object" + type: "array" + required: + description: "Required are the required hardware affinity terms. The terms are OR'd together, hardware must match one term to be considered." + items: + description: "HardwareAffinityTerm is used to select for a particular existing hardware resource." + properties: + labelSelector: + description: "LabelSelector is used to select for particular hardware by label." + 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" + required: + - "key" + - "operator" + type: "object" + type: "array" + 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" + required: + - "labelSelector" + type: "object" + type: "array" + type: "object" + hardwareName: + description: "Those fields are set programmatically, but they cannot be re-constructed from \"state of the world\", so we put them in spec instead of status." + type: "string" + imageLookupBaseRegistry: + description: "ImageLookupBaseRegistry is the base Registry URL that is used for pulling images, if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell." + type: "string" + imageLookupFormat: + description: "ImageLookupFormat is the URL naming format to use for machine images when a machine does not specify. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupFormat. Supports substitutions for {{.BaseRegistry}}, {{.OSDistro}}, {{.OSVersion}} and {{.KubernetesVersion}} with the basse URL, OS distribution, OS version, and kubernetes version, respectively. BaseRegistry will be the value in ImageLookupBaseRegistry or ghcr.io/tinkerbell/cluster-api-provider-tinkerbell (the default), OSDistro will be the value in ImageLookupOSDistro or ubuntu (the default), OSVersion will be the value in ImageLookupOSVersion or default based on the OSDistro (if known), and the kubernetes version as defined by the packages produced by kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/" + type: "string" + imageLookupOSDistro: + description: "ImageLookupOSDistro is the name of the OS distro to use when fetching machine images, if not set it will default to ubuntu." + type: "string" + imageLookupOSVersion: + description: "ImageLookupOSVersion is the version of the OS distribution to use when fetching machine images. If not set it will default based on ImageLookupOSDistro." + type: "string" + providerID: + type: "string" + templateOverride: + description: "TemplateOverride overrides the default Tinkerbell template used by CAPT. You can learn more about Tinkerbell templates here: https://docs.tinkerbell.org/templates/" + type: "string" + type: "object" + required: + - "spec" + type: "object" + required: + - "template" + type: "object" + type: "object" + served: true + storage: true diff --git a/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/mod.rs b/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/mod.rs index d831ac8b4..5b65c5661 100644 --- a/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/mod.rs +++ b/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/mod.rs @@ -6,6 +6,9 @@ pub mod ibmpowervsmachinetemplates; pub mod ibmvpcclusters; pub mod ibmvpcmachines; pub mod ibmvpcmachinetemplates; +pub mod tinkerbellclusters; +pub mod tinkerbellmachines; +pub mod tinkerbellmachinetemplates; pub mod vsphereclusteridentities; pub mod vsphereclusters; pub mod vsphereclustertemplates; diff --git a/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellclusters.rs b/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellclusters.rs new file mode 100644 index 000000000..1d2ca750b --- /dev/null +++ b/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellclusters.rs @@ -0,0 +1,50 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellclusters.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; + +/// TinkerbellClusterSpec defines the desired state of TinkerbellCluster. +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "infrastructure.cluster.x-k8s.io", version = "v1beta1", kind = "TinkerbellCluster", plural = "tinkerbellclusters")] +#[kube(namespaced)] +#[kube(status = "TinkerbellClusterStatus")] +#[kube(schema = "disabled")] +pub struct TinkerbellClusterSpec { + /// ControlPlaneEndpoint is a required field by ClusterAPI v1beta1. + /// See https://cluster-api.sigs.k8s.io/developer/architecture/controllers/cluster.html for more details. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "controlPlaneEndpoint")] + pub control_plane_endpoint: Option, + /// ImageLookupBaseRegistry is the base Registry URL that is used for pulling images, if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupBaseRegistry")] + pub image_lookup_base_registry: Option, + /// ImageLookupFormat is the URL naming format to use for machine images when a machine does not specify. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupFormat. Supports substitutions for {{.BaseRegistry}}, {{.OSDistro}}, {{.OSVersion}} and {{.KubernetesVersion}} with the basse URL, OS distribution, OS version, and kubernetes version, respectively. BaseRegistry will be the value in ImageLookupBaseRegistry or ghcr.io/tinkerbell/cluster-api-provider-tinkerbell (the default), OSDistro will be the value in ImageLookupOSDistro or ubuntu (the default), OSVersion will be the value in ImageLookupOSVersion or default based on the OSDistro (if known), and the kubernetes version as defined by the packages produced by kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/ + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupFormat")] + pub image_lookup_format: Option, + /// ImageLookupOSDistro is the name of the OS distro to use when fetching machine images, if not set it will default to ubuntu. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupOSDistro")] + pub image_lookup_os_distro: Option, + /// ImageLookupOSVersion is the version of the OS distribution to use when fetching machine images. If not set it will default based on ImageLookupOSDistro. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupOSVersion")] + pub image_lookup_os_version: Option, +} + +/// ControlPlaneEndpoint is a required field by ClusterAPI v1beta1. +/// See https://cluster-api.sigs.k8s.io/developer/architecture/controllers/cluster.html for more details. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellClusterControlPlaneEndpoint { + /// The hostname on which the API server is serving. + pub host: String, + /// The port on which the API server is serving. + pub port: i32, +} + +/// TinkerbellClusterStatus defines the observed state of TinkerbellCluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellClusterStatus { + /// Ready denotes that the cluster (infrastructure) is ready. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ready: Option, +} + diff --git a/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellmachines.rs b/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellmachines.rs new file mode 100644 index 000000000..d2f43cde4 --- /dev/null +++ b/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellmachines.rs @@ -0,0 +1,155 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachines.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// TinkerbellMachineSpec defines the desired state of TinkerbellMachine. +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "infrastructure.cluster.x-k8s.io", version = "v1beta1", kind = "TinkerbellMachine", plural = "tinkerbellmachines")] +#[kube(namespaced)] +#[kube(status = "TinkerbellMachineStatus")] +#[kube(schema = "disabled")] +pub struct TinkerbellMachineSpec { + /// HardwareAffinity allows filtering for hardware. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "hardwareAffinity")] + pub hardware_affinity: Option, + /// Those fields are set programmatically, but they cannot be re-constructed from "state of the world", so we put them in spec instead of status. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "hardwareName")] + pub hardware_name: Option, + /// ImageLookupBaseRegistry is the base Registry URL that is used for pulling images, if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupBaseRegistry")] + pub image_lookup_base_registry: Option, + /// ImageLookupFormat is the URL naming format to use for machine images when a machine does not specify. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupFormat. Supports substitutions for {{.BaseRegistry}}, {{.OSDistro}}, {{.OSVersion}} and {{.KubernetesVersion}} with the basse URL, OS distribution, OS version, and kubernetes version, respectively. BaseRegistry will be the value in ImageLookupBaseRegistry or ghcr.io/tinkerbell/cluster-api-provider-tinkerbell (the default), OSDistro will be the value in ImageLookupOSDistro or ubuntu (the default), OSVersion will be the value in ImageLookupOSVersion or default based on the OSDistro (if known), and the kubernetes version as defined by the packages produced by kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/ + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupFormat")] + pub image_lookup_format: Option, + /// ImageLookupOSDistro is the name of the OS distro to use when fetching machine images, if not set it will default to ubuntu. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupOSDistro")] + pub image_lookup_os_distro: Option, + /// ImageLookupOSVersion is the version of the OS distribution to use when fetching machine images. If not set it will default based on ImageLookupOSDistro. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupOSVersion")] + pub image_lookup_os_version: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "providerID")] + pub provider_id: Option, + /// TemplateOverride overrides the default Tinkerbell template used by CAPT. You can learn more about Tinkerbell templates here: https://docs.tinkerbell.org/templates/ + #[serde(default, skip_serializing_if = "Option::is_none", rename = "templateOverride")] + pub template_override: Option, +} + +/// HardwareAffinity allows filtering for hardware. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineHardwareAffinity { + /// Preferred are the preferred hardware affinity terms. Hardware matching these terms are preferred according to the weights provided, but are not required. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred: Option>, + /// Required are the required hardware affinity terms. The terms are OR'd together, hardware must match one term to be considered. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option>, +} + +/// WeightedHardwareAffinityTerm is a HardwareAffinityTerm with an associated weight. The weights of all the matched WeightedHardwareAffinityTerm fields are added per-hardware to find the most preferred hardware. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineHardwareAffinityPreferred { + /// HardwareAffinityTerm is the term associated with the corresponding weight. + #[serde(rename = "hardwareAffinityTerm")] + pub hardware_affinity_term: TinkerbellMachineHardwareAffinityPreferredHardwareAffinityTerm, + /// Weight associated with matching the corresponding hardwareAffinityTerm, in the range 1-100. + pub weight: i32, +} + +/// HardwareAffinityTerm is the term associated with the corresponding weight. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineHardwareAffinityPreferredHardwareAffinityTerm { + /// LabelSelector is used to select for particular hardware by label. + #[serde(rename = "labelSelector")] + pub label_selector: TinkerbellMachineHardwareAffinityPreferredHardwareAffinityTermLabelSelector, +} + +/// LabelSelector is used to select for particular hardware by label. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineHardwareAffinityPreferredHardwareAffinityTermLabelSelector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// 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. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineHardwareAffinityPreferredHardwareAffinityTermLabelSelectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// 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. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// HardwareAffinityTerm is used to select for a particular existing hardware resource. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineHardwareAffinityRequired { + /// LabelSelector is used to select for particular hardware by label. + #[serde(rename = "labelSelector")] + pub label_selector: TinkerbellMachineHardwareAffinityRequiredLabelSelector, +} + +/// LabelSelector is used to select for particular hardware by label. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineHardwareAffinityRequiredLabelSelector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// 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. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineHardwareAffinityRequiredLabelSelectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// 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. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// TinkerbellMachineStatus defines the observed state of TinkerbellMachine. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineStatus { + /// Addresses contains the Tinkerbell device associated addresses. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub addresses: Option>, + /// ErrorMessage will be set in the event that there is a terminal problem reconciling the Machine and will contain a more verbose string suitable for logging and human consumption. + /// This field should not be set for transitive errors that a controller faces that are expected to be fixed automatically over time (like service outages), but instead indicate that something is fundamentally wrong with the Machine's spec or the configuration of the controller, and that manual intervention is required. Examples of terminal errors would be invalid combinations of settings in the spec, values that are unsupported by the controller, or the responsible controller itself being critically misconfigured. + /// Any transient errors that occur during the reconciliation of Machines can be added as events to the Machine object and/or logged in the controller's output. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "errorMessage")] + pub error_message: Option, + /// Any transient errors that occur during the reconciliation of Machines can be added as events to the Machine object and/or logged in the controller's output. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "errorReason")] + pub error_reason: Option, + /// InstanceStatus is the status of the Tinkerbell device instance for this machine. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "instanceStatus")] + pub instance_status: Option, + /// Ready is true when the provider resource is ready. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ready: Option, +} + +/// NodeAddress contains information for the node's address. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineStatusAddresses { + /// The node address. + pub address: String, + /// Node address type, one of Hostname, ExternalIP or InternalIP. + #[serde(rename = "type")] + pub r#type: String, +} + diff --git a/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellmachinetemplates.rs b/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellmachinetemplates.rs new file mode 100644 index 000000000..6773288bb --- /dev/null +++ b/kube-custom-resources-rs/src/infrastructure_cluster_x_k8s_io/v1beta1/tinkerbellmachinetemplates.rs @@ -0,0 +1,136 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/cluster-api-provider-tinkerbell/infrastructure.cluster.x-k8s.io/v1beta1/tinkerbellmachinetemplates.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// TinkerbellMachineTemplateSpec defines the desired state of TinkerbellMachineTemplate. +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "infrastructure.cluster.x-k8s.io", version = "v1beta1", kind = "TinkerbellMachineTemplate", plural = "tinkerbellmachinetemplates")] +#[kube(namespaced)] +#[kube(schema = "disabled")] +pub struct TinkerbellMachineTemplateSpec { + /// TinkerbellMachineTemplateResource describes the data needed to create am TinkerbellMachine from a template. + pub template: TinkerbellMachineTemplateTemplate, +} + +/// TinkerbellMachineTemplateResource describes the data needed to create am TinkerbellMachine from a template. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplate { + /// Spec is the specification of the desired behavior of the machine. + pub spec: TinkerbellMachineTemplateTemplateSpec, +} + +/// Spec is the specification of the desired behavior of the machine. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpec { + /// HardwareAffinity allows filtering for hardware. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "hardwareAffinity")] + pub hardware_affinity: Option, + /// Those fields are set programmatically, but they cannot be re-constructed from "state of the world", so we put them in spec instead of status. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "hardwareName")] + pub hardware_name: Option, + /// ImageLookupBaseRegistry is the base Registry URL that is used for pulling images, if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupBaseRegistry")] + pub image_lookup_base_registry: Option, + /// ImageLookupFormat is the URL naming format to use for machine images when a machine does not specify. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupFormat. Supports substitutions for {{.BaseRegistry}}, {{.OSDistro}}, {{.OSVersion}} and {{.KubernetesVersion}} with the basse URL, OS distribution, OS version, and kubernetes version, respectively. BaseRegistry will be the value in ImageLookupBaseRegistry or ghcr.io/tinkerbell/cluster-api-provider-tinkerbell (the default), OSDistro will be the value in ImageLookupOSDistro or ubuntu (the default), OSVersion will be the value in ImageLookupOSVersion or default based on the OSDistro (if known), and the kubernetes version as defined by the packages produced by kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/ + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupFormat")] + pub image_lookup_format: Option, + /// ImageLookupOSDistro is the name of the OS distro to use when fetching machine images, if not set it will default to ubuntu. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupOSDistro")] + pub image_lookup_os_distro: Option, + /// ImageLookupOSVersion is the version of the OS distribution to use when fetching machine images. If not set it will default based on ImageLookupOSDistro. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageLookupOSVersion")] + pub image_lookup_os_version: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "providerID")] + pub provider_id: Option, + /// TemplateOverride overrides the default Tinkerbell template used by CAPT. You can learn more about Tinkerbell templates here: https://docs.tinkerbell.org/templates/ + #[serde(default, skip_serializing_if = "Option::is_none", rename = "templateOverride")] + pub template_override: Option, +} + +/// HardwareAffinity allows filtering for hardware. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpecHardwareAffinity { + /// Preferred are the preferred hardware affinity terms. Hardware matching these terms are preferred according to the weights provided, but are not required. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred: Option>, + /// Required are the required hardware affinity terms. The terms are OR'd together, hardware must match one term to be considered. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option>, +} + +/// WeightedHardwareAffinityTerm is a HardwareAffinityTerm with an associated weight. The weights of all the matched WeightedHardwareAffinityTerm fields are added per-hardware to find the most preferred hardware. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpecHardwareAffinityPreferred { + /// HardwareAffinityTerm is the term associated with the corresponding weight. + #[serde(rename = "hardwareAffinityTerm")] + pub hardware_affinity_term: TinkerbellMachineTemplateTemplateSpecHardwareAffinityPreferredHardwareAffinityTerm, + /// Weight associated with matching the corresponding hardwareAffinityTerm, in the range 1-100. + pub weight: i32, +} + +/// HardwareAffinityTerm is the term associated with the corresponding weight. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpecHardwareAffinityPreferredHardwareAffinityTerm { + /// LabelSelector is used to select for particular hardware by label. + #[serde(rename = "labelSelector")] + pub label_selector: TinkerbellMachineTemplateTemplateSpecHardwareAffinityPreferredHardwareAffinityTermLabelSelector, +} + +/// LabelSelector is used to select for particular hardware by label. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpecHardwareAffinityPreferredHardwareAffinityTermLabelSelector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// 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. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpecHardwareAffinityPreferredHardwareAffinityTermLabelSelectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// 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. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// HardwareAffinityTerm is used to select for a particular existing hardware resource. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpecHardwareAffinityRequired { + /// LabelSelector is used to select for particular hardware by label. + #[serde(rename = "labelSelector")] + pub label_selector: TinkerbellMachineTemplateTemplateSpecHardwareAffinityRequiredLabelSelector, +} + +/// LabelSelector is used to select for particular hardware by label. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpecHardwareAffinityRequiredLabelSelector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// 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. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TinkerbellMachineTemplateTemplateSpecHardwareAffinityRequiredLabelSelectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// 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. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + diff --git a/kube-custom-resources-rs/src/lib.rs b/kube-custom-resources-rs/src/lib.rs index c4ae5d9e8..f7c621b63 100644 --- a/kube-custom-resources-rs/src/lib.rs +++ b/kube-custom-resources-rs/src/lib.rs @@ -1160,6 +1160,9 @@ apiVersion `infrastructure.cluster.x-k8s.io/v1beta1`: - `VSphereMachine` - `VSphereMachineTemplate` - `VSphereVM` +- `TinkerbellCluster` +- `TinkerbellMachine` +- `TinkerbellMachineTemplate` apiVersion `infrastructure.cluster.x-k8s.io/v1beta2`: - `IBMPowerVSCluster`