diff --git a/api/v1alpha1/doc.go b/api/v1alpha1/doc.go deleted file mode 100644 index 9296b5e13..000000000 --- a/api/v1alpha1/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package v1alpha1 contains API Schema definitions for the Tinkerbell v1alpha1 API group -package v1alpha1 diff --git a/api/v1alpha1/hardware_types.go b/api/v1alpha1/hardware_types.go index 6927478d6..a60ed9431 100644 --- a/api/v1alpha1/hardware_types.go +++ b/api/v1alpha1/hardware_types.go @@ -18,6 +18,7 @@ const ( ) // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // HardwareList contains a list of Hardware. type HardwareList struct { @@ -29,8 +30,8 @@ type HardwareList struct { // +kubebuilder:subresource:status // +kubebuilder:object:root=true // +kubebuilder:resource:path=hardware,scope=Namespaced,categories=tinkerbell,singular=hardware,shortName=hw -// +kubebuilder:storageversion // +kubebuilder:printcolumn:JSONPath=".status.state",name=State,type=string +// +kubebuilder:unservedversion // Hardware is the Schema for the Hardware API. type Hardware struct { diff --git a/api/v1alpha1/template_types.go b/api/v1alpha1/template_types.go index c70ed8a95..93811e290 100644 --- a/api/v1alpha1/template_types.go +++ b/api/v1alpha1/template_types.go @@ -29,8 +29,8 @@ type TemplateStatus struct { // +kubebuilder:subresource:status // +kubebuilder:object:root=true // +kubebuilder:resource:path=templates,scope=Namespaced,categories=tinkerbell,shortName=tpl,singular=template -// +kubebuilder:storageversion // +kubebuilder:printcolumn:JSONPath=".status.state",name=State,type=string +// +kubebuilder:unservedversion // Template is the Schema for the Templates API. type Template struct { @@ -42,6 +42,7 @@ type Template struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // TemplateList contains a list of Templates. type TemplateList struct { diff --git a/api/v1alpha1/workflow_types.go b/api/v1alpha1/workflow_types.go index 97dc7ce02..cf9d9f152 100644 --- a/api/v1alpha1/workflow_types.go +++ b/api/v1alpha1/workflow_types.go @@ -65,9 +65,9 @@ type Action struct { // +kubebuilder:subresource:status // +kubebuilder:object:root=true // +kubebuilder:resource:path=workflows,scope=Namespaced,categories=tinkerbell,shortName=wf,singular=workflow -// +kubebuilder:storageversion // +kubebuilder:printcolumn:JSONPath=".spec.templateRef",name=Template,type=string // +kubebuilder:printcolumn:JSONPath=".status.state",name=State,type=string +// +kubebuilder:unservedversion // Workflow is the Schema for the Workflows API. type Workflow struct { @@ -79,6 +79,7 @@ type Workflow struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // WorkflowList contains a list of Workflows. type WorkflowList struct { diff --git a/api/v1alpha2/conditions.go b/api/v1alpha2/conditions.go new file mode 100644 index 000000000..2d388da33 --- /dev/null +++ b/api/v1alpha2/conditions.go @@ -0,0 +1,45 @@ +package v1alpha2 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// ConditionType identifies the type of condition. +type ConditionType string + +// ConditionStatus expresses the current state of the condition. +type ConditionStatus string + +const ( + // ConditionStatusUnknown is the default status and indicates the condition cannot be + // evaluated as True or False. + ConditionStatusUnknown ConditionStatus = "Unknown" + + // ConditionStatusTrue indicates the condition has been evaluated as true. + ConditionStatusTrue ConditionStatus = "True" + + // ConditionStatusFalse indiciates the condition has been evaluated as false. + ConditionStatusFalse ConditionStatus = "False" +) + +// Condition defines an observation on a resource that is generally attainable by inspecting +// other status fields. +type Condition struct { + // Type of condition. + Type ConditionType `json:"type"` + + // Status of the condition. + Status ConditionStatus `json:"status"` + + // LastTransition is the last time the condition transitioned from one status to another. + LastTransition *metav1.Time `json:"lastTransitionTime"` + + // Reason is a short CamelCase description for the conditions last transition. + // +optional + Reason *string `json:"reason,omitempty"` + + // Message is a human readable message indicating details about the last transition. + // +optional + Message *string `json:"message,omitempty"` +} + +// Conditions define a list of observations of a particular resource. +type Conditions []Condition diff --git a/api/v1alpha2/groupversion_info.go b/api/v1alpha2/groupversion_info.go new file mode 100644 index 000000000..81355c8c9 --- /dev/null +++ b/api/v1alpha2/groupversion_info.go @@ -0,0 +1,21 @@ +//+groupName=tinkerbell.org +//+kubebuilder:object:generate=true +//+kubebuilder:validation:Required + +package v1alpha2 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "tinkerbell.org", Version: "v1alpha2"} + + // 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 +) diff --git a/api/v1alpha2/hardware.go b/api/v1alpha2/hardware.go new file mode 100644 index 000000000..d91642a57 --- /dev/null +++ b/api/v1alpha2/hardware.go @@ -0,0 +1,178 @@ +package v1alpha2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type HardwareSpec struct { + // NetworkInterfaces defines the desired DHCP and netboot configuration for a network interface. + // +kubebuilder:validation:MinPoperties=1 + NetworkInterfaces NetworkInterfaces `json:"networkInterfaces,omitempty"` + + // IPXE provides iPXE script override fields. This is useful for debugging or netboot + // customization. + // +optional. + IPXE *IPXE `json:"ipxe,omitempty"` + + // OSIE describes the Operating System Installation Environment to be netbooted. + OSIE corev1.LocalObjectReference `json:"osie,omitempty"` + + // KernelParams passed to the kernel when launching the OSIE. Parameters are joined with a + // space. + // +optional + KernelParams []string `json:"kernelParams,omitempty"` + + // Instance describes instance specific data that is generally unused by Tinkerbell core. + // +optional + Instance *Instance `json:"instance,omitempty"` + + // StorageDevices is a list of storage devices that will be available in the OSIE. + // +optional. + StorageDevices []StorageDevice `json:"storageDevices,omitempty"` + + // BMCRef references a Rufio Machine object. + // +optional. + BMCRef *corev1.LocalObjectReference `json:"bmcRef,omitempty"` +} + +// NetworkInterfaces maps a MAC address to a NetworkInterface. +type NetworkInterfaces map[MAC]NetworkInterface + +// NetworkInterface is the desired configuration for a particular network interface. +type NetworkInterface struct { + // DHCP is the basic network information for serving DHCP requests. + DHCP DHCP `json:"dhcp,omitempty"` + + // DisableDHCP disables DHCP for this interface. Implies DisableNetboot. + // +kubebuilder:default=false + DisableDHCP bool `json:"disableDhcp,omitempty"` + + // DisableNetboot disables netbooting for this interface. The interface will still receive + // network information speified on by DHCP. + // +kubebuilder:default=false + DisableNetboot bool `json:"disableNetboot,omitempty"` +} + +// DHCP describes basic network configuration to be served in DHCP OFFER responses. It can be +// considered a DHCP reservation. +type DHCP struct { + // IP is an IPv4 address to serve. + // +kubebuilder:validation:Pattern=`(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}` + IP string `json:"ip,omitempty"` + + // Netmask is an IPv4 netmask to serve. + // +kubebuilder+validation:Pattern=`^(255)\.(0|128|192|224|240|248|252|254|255)\.(0|128|192|224|240|248|252|254|255)\.(0|128|192|224|240|248|252|254|255)` + Netmask string `json:"netmask,omitempty"` + + // Gateway is the default gateway address to serve. + // +kubebuilder:validation:Pattern=`(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}` + // +optional + Gateway *string `json:"gateway,omitempty"` + + // +kubebuilder:validation:Pattern=`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9]"[A-Za-z0-9\-]*[A-Za-z0-9])$` + // +optional + Hostname *string `json:"hostname,omitempty"` + + // VLANID is a VLAN ID between 0 and 4096. + // +kubebuilder:validation:Pattern=`^(([0-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))(,[1-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))*)$` + // +optional + VLANID *string `json:"vlanId,omitempty"` + + // Nameservers to serve. + // +optional + Nameservers []Nameserver `json:"nameservers,omitempty"` + + // Timeservers to serve. + // +optional + Timeservers []Timeserver `json:"timeservers,omitempty"` + + // LeaseTimeSeconds to serve. 24h default. Maximum equates to max uint32 as defined by RFC 2132 + // § 9.2 (https://www.rfc-editor.org/rfc/rfc2132.html#section-9.2). + // +kubebuilder:default=86400 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=4294967295 + // +optional + LeaseTimeSeconds *int64 `json:"leaseTimeSeconds"` +} + +// IPXE describes overrides for IPXE scripts. At least 1 option must be specified. +type IPXE struct { + // Content is an inline iPXE script. + // +optional + Content *string `json:"inline,omitempty"` + + // URL is a URL to a hosted iPXE script. + // +optional + URL *string `json:"url,omitempty"` +} + +// Instance describes instance specific data. Instance specific data is typically dependent on the +// permanent OS that a piece of hardware runs. This data is often served by an instance metadata +// service such as Tinkerbell's Hegel. The core Tinkerbell stack does not leverage this data. +type Instance struct { + // Userdata is data with a structure understood by the producer and consumer of the data. + // +optional + Userdata *string `json:"userdata,omitempty"` + + // Vendordata is data with a structure understood by the producer and consumer of the data. + // +optional + Vendordata *string `json:"vendordata,omitempty"` +} + +// MAC is a Media Access Control address. MACs must use lower case letters. +// +kubebuilder:validation:Pattern=`^([0-9a-f]{2}:){5}([0-9a-f]{2})$` +type MAC string + +// Nameserver is an IP or hostname. +// +kubebuilder:validation:Pattern=`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$` +type Nameserver string + +// Timeserver is an IP or hostname. +// +kubebuilder:validation:Pattern=`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$` +type Timeserver string + +// StorageDevice describes a storage device path that will be present in the OSIE. +// StorageDevices must be valid Linux paths. They should not contain partitions. +// +// Good +// +// /dev/sda +// /dev/nvme0n1 +// +// Bad (contains partitions) +// +// /dev/sda1 +// /dev/nvme0n1p1 +// +// Bad (invalid Linux path) +// +// \dev\sda +// +// +kubebuilder:validation:Pattern=`^(/[^/ ]*)+/?$` +type StorageDevice string + +// +kubebuilder:printcolumn:name="BMC",type="string",JSONPath=".spec.bmcRef",description="Baseboard management computer attached to the Hardware" +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +// Hardware is a logical representation of a machine that can execute Workflows. +type Hardware struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + HardwareSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +type HardwareList struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Items []Hardware `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Hardware{}, &HardwareList{}) +} diff --git a/api/v1alpha2/osie.go b/api/v1alpha2/osie.go new file mode 100644 index 000000000..e5a62072a --- /dev/null +++ b/api/v1alpha2/osie.go @@ -0,0 +1,36 @@ +package v1alpha2 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +type OSIESpec struct { + // KernelURL is a URL to a kernel image. + KernelURL string `json:"kernelUrl,omitempty"` + + // InitrdURL is a URL to an initrd image. + InitrdURL string `json:"initrdUrl,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +// OSIE describes an Operating System Installation Environment. It is used by Tinkerbell +// to provision machines and should launch the Tink Worker component. +type OSIE struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OSIESpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +type OSIEList struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Items []OSIE `json:"items"` +} + +func init() { + SchemeBuilder.Register(&OSIE{}, &OSIEList{}) +} diff --git a/api/v1alpha2/template.go b/api/v1alpha2/template.go new file mode 100644 index 000000000..936043be4 --- /dev/null +++ b/api/v1alpha2/template.go @@ -0,0 +1,97 @@ +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type TemplateSpec struct { + // Actions defines the set of actions to be run on a target machine. Actions are run sequentially + // in the order they are specified. At least 1 action must be specified. Names of actions + // must be unique within a Template. + // +kubebuilder:validation:MinItems=1 + Actions []Action `json:"actions,omitempty"` + + // Volumes to be mounted on all actions. If an action specifies the same volume it will take + // precedence. + // +optional + Volumes []Volume `json:"volumes,omitempty"` + + // Env defines environment variables to be available in all actions. If an action specifies + // the same environment variable it will take precedence. + // +optional + Env map[string]string `json:"env,omitempty"` +} + +// Action defines an individual action to be run on a target machine. +type Action struct { + // Name is a name for the action. + Name string `json:"name"` + + // Image is an OCI image. + Image string `json:"image"` + + // Cmd defines the command to use when launching the image. + // +optional + Cmd *string `json:"cmd,omitempty"` + + // Args are a set of arguments to be passed to the container on launch. + // +optional + Args []string `json:"args,omitempty"` + + // Env defines environment variables used when launching the container. + //+optional + Env map[string]string `json:"env,omitempty"` + + // Volumes defines the volumes to mount into the container. + // +optional + Volumes []Volume `json:"volumes,omitempty"` + + // NetworkNamespace defines the network namespace to run the container in. This enables access + // to the host network namespace. + // See https://man7.org/linux/man-pages/man7/namespaces.7.html. + // +optional + NetworkNamespace *string `json:"networkNamespace,omitempty"` +} + +// Volume is a specification for mounting a volume in an action. Volumes take the form +// {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that +// does not exist it will be created for you. Examples: +// +// Read-only bind mount bound to /data +// +// /etc/data:/data:ro +// +// Writable volume name bound to /data +// +// shared_volume:/data +// +// See https://docs.docker.com/storage/volumes/ for additional details +type Volume string + +// +kubebuilder:resource:path=templates,scope=Namespaced,categories=tinkerbell,singular=workflow +// +kubebuilder:storageversion +// +kubebuilder:object:root=true + +// Template defines a set of actions to be run on a target machine. The template is rendered +// prior to execution where it is exposed to Hardware and user defined data. Most fields within the +// TemplateSpec may contain templates values excluding .TemplateSpec.Actions[].Name. +// See https://pkg.go.dev/text/template for more details. +type Template struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec TemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +type TemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Items []Template `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Template{}, &TemplateList{}) +} diff --git a/api/v1alpha2/workflow.go b/api/v1alpha2/workflow.go new file mode 100644 index 000000000..366bf03f8 --- /dev/null +++ b/api/v1alpha2/workflow.go @@ -0,0 +1,143 @@ +package v1alpha2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type WorkflowSpec struct { + // HardwareRef is a reference to a Hardware resource this workflow will execute on. + // If no namespace is specified the Workflow's namespace is assumed. + HardwareRef corev1.LocalObjectReference `json:"hardwareRef,omitempty"` + + // TemplateRef is a reference to a Template resource used to render workflow actions. + // If no namespace is specified the Workflow's namespace is assumed. + TemplateRef corev1.LocalObjectReference `json:"templateRef,omitempty"` + + // TemplateParams are a list of key-value pairs that are injected into templates at render + // time. TemplateParams are exposed to templates using a top level .Params key. + // + // For example, TemplateParams = {"foo": "bar"}, the foo key can be accessed via .Params.foo. + // +optional + TemplateParams map[string]string `json:"templateParams,omitempty"` + + // TimeoutSeconds defines the time the workflow has to complete. The timer begins when the first + // action is requested. When set to 0, no timeout is applied. + // +kubebuilder:default=0 + // +kubebuilder:validation:Minimum=0 + TimeoutSeconds int64 `json:"timeout,omitempty"` +} + +type WorkflowStatus struct { + // Actions is a list of action states. + Actions []ActionStatus `json:"actions"` + + // StartedAt is the time the first action was requested. Nil indicates the Workflow has not + // started. + StartedAt *metav1.Time `json:"startedAt,omitempty"` + + // LastTransition is the observed time when State transitioned last. + LastTransition *metav1.Time `json:"lastTransitioned,omitempty"` + + // State describes the current state of the workflow. For the workflow to enter the + // WorkflowStateSucceeded state all actions must be in ActionStateSucceeded. The Workflow will + // enter a WorkflowStateFailed if 1 or more Actions fails. + State WorkflowState `json:"state,omitempty"` + + // Conditions details a set of observations about the Workflow. + Conditions Conditions `json:"conditions"` +} + +// ActionStatus describes status information about an action. +type ActionStatus struct { + // Rendered is the rendered action. + Rendered Action `json:"rendered,omitempty"` + + // ID uniquely identifies the action status. + ID string `json:"id"` + + // StartedAt is the time the action was started as reported by the client. Nil indicates the + // Action has not started. + StartedAt *metav1.Time `json:"startedAt,omitempty"` + + // LastTransition is the observed time when State transitioned last. + LastTransition *metav1.Time `json:"lastTransitioned,omitempty"` + + // State describes the current state of the action. + State ActionState `json:"state,omitempty"` + + // FailureReason is a short CamelCase word or phrase describing why the Action entered + // ActionStateFailed. + FailureReason string `json:"failureReason,omitempty"` + + // FailureMessage is a free-form user friendly message describing why the Action entered the + // ActionStateFailed state. Typically, this is an elaboration on the Reason. + FailureMessage string `json:"failureMessage,omitempty"` +} + +// State describes the point in time state of a Workflow. +type WorkflowState string + +const ( + // WorkflowStatePending indicates the workflow is in a pending state. + WorkflowStatePending WorkflowState = "Pending" + + // WorkflowStateRunning indicates the first Action has been requested and the Workflow is in + // progress. + WorkflowStateRunning WorkflowState = "Running" + + // WorkflowStateSucceeded indicates all Workflow actions have successfully completed. + WorkflowStateSucceeded WorkflowState = "Succeeded" + + // WorkflowStateFailed indicates an Action entered a failure state. + WorkflowStateFailed WorkflowState = "Failed" +) + +// ActionState describes a point in time state of an Action. +type ActionState string + +const ( + // ActionStatePending indicates an Action is awaiting execution. + ActionStatePending ActionState = "Pending" + + // ActionStateRunning indicates an Action has begun execution. + ActionStateRunning ActionState = "Running" + + // ActionStateSucceeded indicates an Action completed execution successfully. + ActionStateSucceeded ActionState = "Succeeded" + + // ActionStatFailed indicates an Action failed to execute. Users may inspect the associated + // Workflow resource to gain deeper insights into why the action failed. + ActionStateFailed ActionState = "Failed" +) + +// +kubebuilder:resource:path=workflows,scope=Namespaced,categories=tinkerbell,shortName=wf,singular=workflow +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state",description="State of the workflow such as Pending,Running etc" +// +kubebuilder:printcolumn:name="Hardware",type="string",JSONPath=".spec.hardwareRef",description="Hardware object that runs the workflow" +// +kubebuilder:printcolumn:name="Template",type="string",JSONPath=".spec.templateRef",description="Template to run on the associated Hardware" + +// Workflow describes a set of actions to be run on a specific Hardware. Workflows execute +// once and should be considered ephemeral. +type Workflow struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec WorkflowSpec `json:"spec,omitempty"` + Status WorkflowStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +type WorkflowList struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Items []Workflow `json:"items,omitempty"` +} + +func init() { + SchemeBuilder.Register(&Workflow{}, &WorkflowList{}) +} diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/api/v1alpha2/zz_generated.deepcopy.go new file mode 100644 index 000000000..c49c7eec5 --- /dev/null +++ b/api/v1alpha2/zz_generated.deepcopy.go @@ -0,0 +1,603 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Tinkerbell Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Action) DeepCopyInto(out *Action) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]Volume, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action. +func (in *Action) DeepCopy() *Action { + if in == nil { + return nil + } + out := new(Action) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ActionStatus) DeepCopyInto(out *ActionStatus) { + *out = *in + in.Rendered.DeepCopyInto(&out.Rendered) + if in.StartedAt != nil { + in, out := &in.StartedAt, &out.StartedAt + *out = (*in).DeepCopy() + } + if in.LastTransition != nil { + in, out := &in.LastTransition, &out.LastTransition + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionStatus. +func (in *ActionStatus) DeepCopy() *ActionStatus { + if in == nil { + return nil + } + out := new(ActionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + if in.LastTransition != nil { + in, out := &in.LastTransition, &out.LastTransition + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Conditions) DeepCopyInto(out *Conditions) { + { + in := &in + *out = make(Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions. +func (in Conditions) DeepCopy() Conditions { + if in == nil { + return nil + } + out := new(Conditions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DHCP) DeepCopyInto(out *DHCP) { + *out = *in + if in.Nameservers != nil { + in, out := &in.Nameservers, &out.Nameservers + *out = make([]Nameserver, len(*in)) + copy(*out, *in) + } + if in.Timeservers != nil { + in, out := &in.Timeservers, &out.Timeservers + *out = make([]Timeserver, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DHCP. +func (in *DHCP) DeepCopy() *DHCP { + if in == nil { + return nil + } + out := new(DHCP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Hardware) DeepCopyInto(out *Hardware) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.HardwareSpec.DeepCopyInto(&out.HardwareSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Hardware. +func (in *Hardware) DeepCopy() *Hardware { + if in == nil { + return nil + } + out := new(Hardware) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Hardware) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HardwareList) DeepCopyInto(out *HardwareList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Hardware, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HardwareList. +func (in *HardwareList) DeepCopy() *HardwareList { + if in == nil { + return nil + } + out := new(HardwareList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *HardwareList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HardwareSpec) DeepCopyInto(out *HardwareSpec) { + *out = *in + if in.NetworkInterfaces != nil { + in, out := &in.NetworkInterfaces, &out.NetworkInterfaces + *out = make(NetworkInterfaces, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + in.IPXE.DeepCopyInto(&out.IPXE) + out.OSIE = in.OSIE + if in.KernelParams != nil { + in, out := &in.KernelParams, &out.KernelParams + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.Instance = in.Instance + if in.StorageDevices != nil { + in, out := &in.StorageDevices, &out.StorageDevices + *out = make([]StorageDevice, len(*in)) + copy(*out, *in) + } + out.BMCRef = in.BMCRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HardwareSpec. +func (in *HardwareSpec) DeepCopy() *HardwareSpec { + if in == nil { + return nil + } + out := new(HardwareSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPXE) DeepCopyInto(out *IPXE) { + *out = *in + if in.Content != nil { + in, out := &in.Content, &out.Content + *out = new(string) + **out = **in + } + if in.URL != nil { + in, out := &in.URL, &out.URL + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPXE. +func (in *IPXE) DeepCopy() *IPXE { + if in == nil { + return nil + } + out := new(IPXE) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Instance) DeepCopyInto(out *Instance) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance. +func (in *Instance) DeepCopy() *Instance { + if in == nil { + return nil + } + out := new(Instance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkInterface) DeepCopyInto(out *NetworkInterface) { + *out = *in + in.DHCP.DeepCopyInto(&out.DHCP) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkInterface. +func (in *NetworkInterface) DeepCopy() *NetworkInterface { + if in == nil { + return nil + } + out := new(NetworkInterface) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in NetworkInterfaces) DeepCopyInto(out *NetworkInterfaces) { + { + in := &in + *out = make(NetworkInterfaces, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkInterfaces. +func (in NetworkInterfaces) DeepCopy() NetworkInterfaces { + if in == nil { + return nil + } + out := new(NetworkInterfaces) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OSIE) DeepCopyInto(out *OSIE) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OSIE. +func (in *OSIE) DeepCopy() *OSIE { + if in == nil { + return nil + } + out := new(OSIE) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OSIE) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OSIEList) DeepCopyInto(out *OSIEList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OSIE, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OSIEList. +func (in *OSIEList) DeepCopy() *OSIEList { + if in == nil { + return nil + } + out := new(OSIEList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OSIEList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OSIESpec) DeepCopyInto(out *OSIESpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OSIESpec. +func (in *OSIESpec) DeepCopy() *OSIESpec { + if in == nil { + return nil + } + out := new(OSIESpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Template) DeepCopyInto(out *Template) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Template. +func (in *Template) DeepCopy() *Template { + if in == nil { + return nil + } + out := new(Template) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Template) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateList) DeepCopyInto(out *TemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Template, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateList. +func (in *TemplateList) DeepCopy() *TemplateList { + if in == nil { + return nil + } + out := new(TemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateSpec) DeepCopyInto(out *TemplateSpec) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]Action, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]Volume, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateSpec. +func (in *TemplateSpec) DeepCopy() *TemplateSpec { + if in == nil { + return nil + } + out := new(TemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workflow) DeepCopyInto(out *Workflow) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow. +func (in *Workflow) DeepCopy() *Workflow { + if in == nil { + return nil + } + out := new(Workflow) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Workflow) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkflowList) DeepCopyInto(out *WorkflowList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Workflow, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList. +func (in *WorkflowList) DeepCopy() *WorkflowList { + if in == nil { + return nil + } + out := new(WorkflowList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkflowList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkflowSpec) DeepCopyInto(out *WorkflowSpec) { + *out = *in + out.HardwareRef = in.HardwareRef + out.TemplateRef = in.TemplateRef + if in.TemplateParams != nil { + in, out := &in.TemplateParams, &out.TemplateParams + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSpec. +func (in *WorkflowSpec) DeepCopy() *WorkflowSpec { + if in == nil { + return nil + } + out := new(WorkflowSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = make([]ActionStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.StartedAt != nil { + in, out := &in.StartedAt, &out.StartedAt + *out = (*in).DeepCopy() + } + if in.LastTransition != nil { + in, out := &in.LastTransition, &out.LastTransition + *out = (*in).DeepCopy() + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus. +func (in *WorkflowStatus) DeepCopy() *WorkflowStatus { + if in == nil { + return nil + } + out := new(WorkflowStatus) + in.DeepCopyInto(out) + return out +} diff --git a/config/crd/bases/tinkerbell.org_hardware.yaml b/config/crd/bases/tinkerbell.org_hardware.yaml index c23b8edd2..a78c3072f 100644 --- a/config/crd/bases/tinkerbell.org_hardware.yaml +++ b/config/crd/bases/tinkerbell.org_hardware.yaml @@ -359,7 +359,140 @@ spec: type: string type: object type: object - served: true - storage: true + served: false + storage: false subresources: status: {} + - additionalPrinterColumns: + - description: Baseboard management computer attached to the Hardware + jsonPath: .spec.bmcRef + name: BMC + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + description: Hardware is a logical representation of a machine that can execute Workflows. + 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: + properties: + bmcRef: + description: BMCRef references a Rufio Machine object. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + instance: + description: Instance describes instance specific data that is generally unused by Tinkerbell core. + properties: + userdata: + description: Userdata is data with a structure understood by the producer and consumer of the data. + type: string + vendordata: + description: Vendordata is data with a structure understood by the producer and consumer of the data. + type: string + type: object + ipxe: + description: IPXE provides iPXE script override fields. This is useful for debugging or netboot customization. + properties: + inline: + description: Content is an inline iPXE script. + type: string + url: + description: URL is a URL to a hosted iPXE script. + type: string + type: object + kernelParams: + description: KernelParams passed to the kernel when launching the OSIE. Parameters are joined with a space. + items: + type: string + type: array + networkInterfaces: + additionalProperties: + description: NetworkInterface is the desired configuration for a particular network interface. + properties: + dhcp: + description: DHCP is the basic network information for serving DHCP requests. + properties: + gateway: + description: Gateway is the default gateway address to serve. + pattern: (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3} + type: string + hostname: + pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9]"[A-Za-z0-9\-]*[A-Za-z0-9])$ + type: string + ip: + description: IP is an IPv4 address to serve. + pattern: (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3} + type: string + leaseTimeSeconds: + default: 86400 + description: LeaseTimeSeconds to serve. 24h default. Maximum equates to max uint32 as defined by RFC 2132 § 9.2 (https://www.rfc-editor.org/rfc/rfc2132.html#section-9.2). + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + nameservers: + description: Nameservers to serve. + items: + description: Nameserver is an IP or hostname. + pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ + type: string + type: array + netmask: + description: Netmask is an IPv4 netmask to serve. + type: string + timeservers: + description: Timeservers to serve. + items: + description: Timeserver is an IP or hostname. + pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ + type: string + type: array + vlanId: + description: VLANID is a VLAN ID between 0 and 4096. + pattern: ^(([0-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))(,[1-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))*)$ + type: string + required: + - leaseTimeSeconds + type: object + disableDhcp: + default: false + description: DisableDHCP disables DHCP for this interface. Implies DisableNetboot. + type: boolean + disableNetboot: + default: false + description: DisableNetboot disables netbooting for this interface. The interface will still receive network information speified on by DHCP. + type: boolean + type: object + description: NetworkInterfaces defines the desired DHCP and netboot configuration for a network interface. + type: object + osie: + description: OSIE describes the Operating System Installation Environment to be netbooted. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + storageDevices: + description: StorageDevices is a list of storage devices that will be available in the OSIE. + items: + description: "StorageDevice describes a storage device path that will be present in the OSIE. StorageDevices must be valid Linux paths. They should not contain partitions. \n Good \n /dev/sda /dev/nvme0n1 \n Bad (contains partitions) \n /dev/sda1 /dev/nvme0n1p1 \n Bad (invalid Linux path) \n \\dev\\sda" + pattern: ^(/[^/ ]*)+/?$ + type: string + type: array + type: object + type: object + served: true + storage: true + subresources: {} diff --git a/config/crd/bases/tinkerbell.org_hardwarelists.yaml b/config/crd/bases/tinkerbell.org_hardwarelists.yaml new file mode 100644 index 000000000..cd95606b9 --- /dev/null +++ b/config/crd/bases/tinkerbell.org_hardwarelists.yaml @@ -0,0 +1,513 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.10.0 + creationTimestamp: null + name: hardwarelists.tinkerbell.org +spec: + group: tinkerbell.org + names: + kind: HardwareList + listKind: HardwareListList + plural: hardwarelists + singular: hardwarelist + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: HardwareList contains a list of Hardware. + 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 + items: + items: + description: Hardware is the Schema for the Hardware 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: HardwareSpec defines the desired state of Hardware. + properties: + bmcRef: + description: BMCRef contains a relation to a BMC state management type in the same namespace as the Hardware. This may be used for BMC management by orchestrators. + properties: + apiGroup: + description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + disks: + items: + description: Disk represents a disk device for Tinkerbell Hardware. + properties: + device: + type: string + type: object + type: array + interfaces: + items: + description: Interface represents a network interface configuration for Hardware. + properties: + dhcp: + description: DHCP configuration. + properties: + arch: + type: string + hostname: + type: string + iface_name: + type: string + ip: + description: IP configuration. + properties: + address: + type: string + family: + format: int64 + type: integer + gateway: + type: string + netmask: + type: string + type: object + lease_time: + format: int64 + type: integer + mac: + pattern: ([0-9a-f]{2}[:]){5}([0-9a-f]{2}) + type: string + name_servers: + items: + type: string + type: array + time_servers: + items: + type: string + type: array + uefi: + type: boolean + vlan_id: + description: validation pattern for VLANDID is a string number between 0-4096 + pattern: ^(([0-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))(,[1-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))*)$ + type: string + type: object + netboot: + description: Netboot configuration. + properties: + allowPXE: + type: boolean + allowWorkflow: + type: boolean + ipxe: + description: IPXE configuration. + properties: + contents: + type: string + url: + type: string + type: object + osie: + description: OSIE configuration. + properties: + baseURL: + type: string + initrd: + type: string + kernel: + type: string + type: object + type: object + type: object + type: array + metadata: + properties: + bonding_mode: + format: int64 + type: integer + custom: + properties: + preinstalled_operating_system_version: + properties: + distro: + type: string + image_tag: + type: string + os_slug: + type: string + slug: + type: string + version: + type: string + type: object + private_subnets: + items: + type: string + type: array + type: object + facility: + properties: + facility_code: + type: string + plan_slug: + type: string + plan_version_slug: + type: string + type: object + instance: + properties: + allow_pxe: + type: boolean + always_pxe: + type: boolean + crypted_root_password: + type: string + hostname: + type: string + id: + type: string + ips: + items: + properties: + address: + type: string + family: + format: int64 + type: integer + gateway: + type: string + management: + type: boolean + netmask: + type: string + public: + type: boolean + type: object + type: array + ipxe_script_url: + type: string + network_ready: + type: boolean + operating_system: + properties: + distro: + type: string + image_tag: + type: string + os_slug: + type: string + slug: + type: string + version: + type: string + type: object + rescue: + type: boolean + ssh_keys: + items: + type: string + type: array + state: + type: string + storage: + properties: + disks: + items: + properties: + device: + type: string + partitions: + items: + properties: + label: + type: string + number: + format: int64 + type: integer + size: + format: int64 + type: integer + start: + format: int64 + type: integer + type_guid: + type: string + type: object + type: array + wipe_table: + type: boolean + type: object + type: array + filesystems: + items: + properties: + mount: + properties: + create: + properties: + force: + type: boolean + options: + items: + type: string + type: array + type: object + device: + type: string + files: + items: + properties: + contents: + type: string + gid: + format: int64 + type: integer + mode: + format: int64 + type: integer + path: + type: string + uid: + format: int64 + type: integer + type: object + type: array + format: + type: string + point: + type: string + type: object + type: object + type: array + raid: + items: + properties: + devices: + items: + type: string + type: array + level: + type: string + name: + type: string + spare: + format: int64 + type: integer + type: object + type: array + type: object + tags: + items: + type: string + type: array + userdata: + type: string + type: object + manufacturer: + properties: + id: + type: string + slug: + type: string + type: object + state: + default: provisioning + type: string + type: object + resources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Resources represents known resources that are available on a machine. Resources may be used for scheduling by orchestrators. + type: object + tinkVersion: + format: int64 + type: integer + userData: + description: UserData is the user data to configure in the hardware's metadata + type: string + vendorData: + description: VendorData is the vendor data to configure in the hardware's metadata + type: string + type: object + status: + description: HardwareStatus defines the observed state of Hardware. + properties: + state: + description: HardwareState represents the hardware state. + type: string + type: object + type: object + type: array + 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 + required: + - items + type: object + served: false + storage: false + - name: v1alpha2 + schema: + openAPIV3Schema: + 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 + items: + items: + description: Hardware is a logical representation of a machine that can execute Workflows. + 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: + properties: + bmcRef: + description: BMCRef references a Rufio Machine object. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + instance: + description: Instance describes instance specific data that is generally unused by Tinkerbell core. + properties: + userdata: + description: Userdata is data with a structure understood by the producer and consumer of the data. + type: string + vendordata: + description: Vendordata is data with a structure understood by the producer and consumer of the data. + type: string + type: object + ipxe: + description: IPXE provides iPXE script override fields. This is useful for debugging or netboot customization. + properties: + inline: + description: Content is an inline iPXE script. + type: string + url: + description: URL is a URL to a hosted iPXE script. + type: string + type: object + kernelParams: + description: KernelParams passed to the kernel when launching the OSIE. Parameters are joined with a space. + items: + type: string + type: array + networkInterfaces: + additionalProperties: + description: NetworkInterface is the desired configuration for a particular network interface. + properties: + dhcp: + description: DHCP is the basic network information for serving DHCP requests. + properties: + gateway: + description: Gateway is the default gateway address to serve. + pattern: (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3} + type: string + hostname: + pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9]"[A-Za-z0-9\-]*[A-Za-z0-9])$ + type: string + ip: + description: IP is an IPv4 address to serve. + pattern: (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3} + type: string + leaseTimeSeconds: + default: 86400 + description: LeaseTimeSeconds to serve. 24h default. Maximum equates to max uint32 as defined by RFC 2132 § 9.2 (https://www.rfc-editor.org/rfc/rfc2132.html#section-9.2). + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + nameservers: + description: Nameservers to serve. + items: + description: Nameserver is an IP or hostname. + pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ + type: string + type: array + netmask: + description: Netmask is an IPv4 netmask to serve. + type: string + timeservers: + description: Timeservers to serve. + items: + description: Timeserver is an IP or hostname. + pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ + type: string + type: array + vlanId: + description: VLANID is a VLAN ID between 0 and 4096. + pattern: ^(([0-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))(,[1-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))*)$ + type: string + required: + - leaseTimeSeconds + type: object + disableDhcp: + default: false + description: DisableDHCP disables DHCP for this interface. Implies DisableNetboot. + type: boolean + disableNetboot: + default: false + description: DisableNetboot disables netbooting for this interface. The interface will still receive network information speified on by DHCP. + type: boolean + type: object + description: NetworkInterfaces defines the desired DHCP and netboot configuration for a network interface. + type: object + osie: + description: OSIE describes the Operating System Installation Environment to be netbooted. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + storageDevices: + description: StorageDevices is a list of storage devices that will be available in the OSIE. + items: + description: "StorageDevice describes a storage device path that will be present in the OSIE. StorageDevices must be valid Linux paths. They should not contain partitions. \n Good \n /dev/sda /dev/nvme0n1 \n Bad (contains partitions) \n /dev/sda1 /dev/nvme0n1p1 \n Bad (invalid Linux path) \n \\dev\\sda" + pattern: ^(/[^/ ]*)+/?$ + type: string + type: array + type: object + type: object + type: array + 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 + required: + - items + type: object + served: true + storage: true diff --git a/config/crd/bases/tinkerbell.org_osielists.yaml b/config/crd/bases/tinkerbell.org_osielists.yaml new file mode 100644 index 000000000..4ff18753d --- /dev/null +++ b/config/crd/bases/tinkerbell.org_osielists.yaml @@ -0,0 +1,56 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.10.0 + creationTimestamp: null + name: osielists.tinkerbell.org +spec: + group: tinkerbell.org + names: + kind: OSIEList + listKind: OSIEListList + plural: osielists + singular: osielist + scope: Namespaced + versions: + - name: v1alpha2 + schema: + openAPIV3Schema: + 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 + items: + items: + description: OSIE describes an Operating System Installation Environment. It is used by Tinkerbell to provision machines and should launch the Tink Worker component. + 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: + properties: + initrdUrl: + description: InitrdURL is a URL to an initrd image. + type: string + kernelUrl: + description: KernelURL is a URL to a kernel image. + type: string + type: object + type: object + type: array + 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 + required: + - items + type: object + served: true + storage: true diff --git a/config/crd/bases/tinkerbell.org_osies.yaml b/config/crd/bases/tinkerbell.org_osies.yaml new file mode 100644 index 000000000..a1bee110b --- /dev/null +++ b/config/crd/bases/tinkerbell.org_osies.yaml @@ -0,0 +1,55 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.10.0 + creationTimestamp: null + name: osies.tinkerbell.org +spec: + group: tinkerbell.org + names: + kind: OSIE + listKind: OSIEList + plural: osies + singular: osie + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: OSIE configuration. + properties: + baseURL: + type: string + initrd: + type: string + kernel: + type: string + type: object + served: true + storage: false + - name: v1alpha2 + schema: + openAPIV3Schema: + description: OSIE describes an Operating System Installation Environment. It is used by Tinkerbell to provision machines and should launch the Tink Worker component. + 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: + properties: + initrdUrl: + description: InitrdURL is a URL to an initrd image. + type: string + kernelUrl: + description: KernelURL is a URL to a kernel image. + type: string + type: object + type: object + served: true + storage: true diff --git a/config/crd/bases/tinkerbell.org_templatelists.yaml b/config/crd/bases/tinkerbell.org_templatelists.yaml new file mode 100644 index 000000000..6eb0232e4 --- /dev/null +++ b/config/crd/bases/tinkerbell.org_templatelists.yaml @@ -0,0 +1,145 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.10.0 + creationTimestamp: null + name: templatelists.tinkerbell.org +spec: + group: tinkerbell.org + names: + kind: TemplateList + listKind: TemplateListList + plural: templatelists + singular: templatelist + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: TemplateList contains a list of Templates. + 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 + items: + items: + description: Template is the Schema for the Templates 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: TemplateSpec defines the desired state of Template. + properties: + data: + type: string + type: object + status: + description: TemplateStatus defines the observed state of Template. + properties: + state: + description: TemplateState represents the template state. + type: string + type: object + type: object + type: array + 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 + required: + - items + type: object + served: false + storage: false + - name: v1alpha2 + schema: + openAPIV3Schema: + 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 + items: + items: + description: Template defines a set of actions to be run on a target machine. The template is rendered prior to execution where it is exposed to Hardware and user defined data. Most fields within the TemplateSpec may contain templates values excluding .TemplateSpec.Actions[].Name. See https://pkg.go.dev/text/template for more details. + 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: + properties: + actions: + description: Actions defines the set of actions to be run on a target machine. Actions are run sequentially in the order they are specified. At least 1 action must be specified. Names of actions must be unique within a Template. + items: + description: Action defines an individual action to be run on a target machine. + properties: + args: + description: Args are a set of arguments to be passed to the container on launch. + items: + type: string + type: array + cmd: + description: Cmd defines the command to use when launching the image. + type: string + env: + additionalProperties: + type: string + description: Env defines environment variables used when launching the container. + type: object + image: + description: Image is an OCI image. + type: string + name: + description: Name is a name for the action. + type: string + networkNamespace: + description: NetworkNamespace defines the network namespace to run the container in. This enables access to the host network namespace. See https://man7.org/linux/man-pages/man7/namespaces.7.html. + type: string + volumes: + description: Volumes defines the volumes to mount into the container. + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. \n # Examples \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details" + type: string + type: array + required: + - image + - name + type: object + minItems: 1 + type: array + env: + additionalProperties: + type: string + description: Env defines environment variables to be available in all actions. If an action specifies the same environment variable it will take precedence. + type: object + volumes: + description: Volumes to be mounted on all actions. If an action specifies the same volume it will take precedence. + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. \n # Examples \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details" + type: string + type: array + type: object + type: object + type: array + 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 + required: + - items + type: object + served: true + storage: true diff --git a/config/crd/bases/tinkerbell.org_templates.yaml b/config/crd/bases/tinkerbell.org_templates.yaml index bff533719..c74214bed 100644 --- a/config/crd/bases/tinkerbell.org_templates.yaml +++ b/config/crd/bases/tinkerbell.org_templates.yaml @@ -13,9 +13,7 @@ spec: kind: Template listKind: TemplateList plural: templates - shortNames: - - tpl - singular: template + singular: workflow scope: Namespaced versions: - additionalPrinterColumns: @@ -49,7 +47,76 @@ spec: type: string type: object type: object - served: true - storage: true + served: false + storage: false subresources: status: {} + - name: v1alpha2 + schema: + openAPIV3Schema: + description: Template defines a set of actions to be run on a target machine. The template is rendered prior to execution where it is exposed to Hardware and user defined data. Most fields within the TemplateSpec may contain templates values excluding .TemplateSpec.Actions[].Name. See https://pkg.go.dev/text/template for more details. + 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: + properties: + actions: + description: Actions defines the set of actions to be run on a target machine. Actions are run sequentially in the order they are specified. At least 1 action must be specified. Names of actions must be unique within a Template. + items: + description: Action defines an individual action to be run on a target machine. + properties: + args: + description: Args are a set of arguments to be passed to the container on launch. + items: + type: string + type: array + cmd: + description: Cmd defines the command to use when launching the image. + type: string + env: + additionalProperties: + type: string + description: Env defines environment variables used when launching the container. + type: object + image: + description: Image is an OCI image. + type: string + name: + description: Name is a name for the action. + type: string + networkNamespace: + description: NetworkNamespace defines the network namespace to run the container in. This enables access to the host network namespace. See https://man7.org/linux/man-pages/man7/namespaces.7.html. + type: string + volumes: + description: Volumes defines the volumes to mount into the container. + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. \n # Examples \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details" + type: string + type: array + required: + - image + - name + type: object + minItems: 1 + type: array + env: + additionalProperties: + type: string + description: Env defines environment variables to be available in all actions. If an action specifies the same environment variable it will take precedence. + type: object + volumes: + description: Volumes to be mounted on all actions. If an action specifies the same volume it will take precedence. + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. \n # Examples \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details" + type: string + type: array + type: object + type: object + served: true + storage: true diff --git a/config/crd/bases/tinkerbell.org_workflowlists.yaml b/config/crd/bases/tinkerbell.org_workflowlists.yaml new file mode 100644 index 000000000..461a18612 --- /dev/null +++ b/config/crd/bases/tinkerbell.org_workflowlists.yaml @@ -0,0 +1,305 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.10.0 + creationTimestamp: null + name: workflowlists.tinkerbell.org +spec: + group: tinkerbell.org + names: + kind: WorkflowList + listKind: WorkflowListList + plural: workflowlists + singular: workflowlist + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: WorkflowList contains a list of Workflows. + 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 + items: + items: + description: Workflow is the Schema for the Workflows 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: WorkflowSpec defines the desired state of Workflow. + properties: + hardwareMap: + additionalProperties: + type: string + description: A mapping of template devices to hadware mac addresses + type: object + hardwareRef: + description: Name of the Hardware associated with this workflow. + type: string + templateRef: + description: Name of the Template associated with this workflow. + type: string + type: object + status: + description: WorkflowStatus defines the observed state of Workflow. + properties: + globalTimeout: + description: GlobalTimeout represents the max execution time + format: int64 + type: integer + state: + description: State is the state of the workflow in Tinkerbell. + type: string + tasks: + description: Tasks are the tasks to be completed + items: + description: Task represents a series of actions to be completed by a worker. + properties: + actions: + items: + description: Action represents a workflow action. + properties: + command: + items: + type: string + type: array + environment: + additionalProperties: + type: string + type: object + image: + type: string + message: + type: string + name: + type: string + pid: + type: string + seconds: + format: int64 + type: integer + startedAt: + format: date-time + type: string + status: + type: string + timeout: + format: int64 + type: integer + volumes: + items: + type: string + type: array + type: object + type: array + environment: + additionalProperties: + type: string + type: object + name: + type: string + volumes: + items: + type: string + type: array + worker: + type: string + required: + - actions + - name + - worker + type: object + type: array + type: object + type: object + type: array + 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 + required: + - items + type: object + served: false + storage: false + - name: v1alpha2 + schema: + openAPIV3Schema: + 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 + items: + items: + description: Workflow describes a set of actions to be run on a specific Hardware. Workflows execute once and should be considered ephemeral. + 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: + properties: + hardwareRef: + description: HardwareRef is a reference to a Hardware resource this workflow will execute on. If no namespace is specified the Workflow's namespace is assumed. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + templateParams: + additionalProperties: + type: string + description: "TemplateParams are a list of key-value pairs that are injected into templates at render time. TemplateParams are exposed to templates using a top level .Params key. \n For example, TemplateParams = {\"foo\": \"bar\"}, the foo key can be accessed via .Params.foo." + type: object + templateRef: + description: TemplateRef is a reference to a Template resource used to render workflow actions. If no namespace is specified the Workflow's namespace is assumed. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + timeout: + default: 0 + description: TimeoutSeconds defines the time the workflow has to complete. The timer begins when the first action is requested. When set to 0, no timeout is applied. + format: int64 + minimum: 0 + type: integer + type: object + status: + properties: + actions: + description: Actions is a list of action states. + items: + description: ActionStatus describes status information about an action. + properties: + failureMessage: + description: FailureMessage is a free-form user friendly message describing why the Action entered the ActionStateFailed state. Typically, this is an elaboration on the Reason. + type: string + failureReason: + description: FailureReason is a short CamelCase word or phrase describing why the Action entered ActionStateFailed. + type: string + id: + description: ID uniquely identifies the action status. + type: string + lastTransitioned: + description: LastTransition is the observed time when State transitioned last. + format: date-time + type: string + rendered: + description: Rendered is the rendered action. + properties: + args: + description: Args are a set of arguments to be passed to the container on launch. + items: + type: string + type: array + cmd: + description: Cmd defines the command to use when launching the image. + type: string + env: + additionalProperties: + type: string + description: Env defines environment variables used when launching the container. + type: object + image: + description: Image is an OCI image. + type: string + name: + description: Name is a name for the action. + type: string + networkNamespace: + description: NetworkNamespace defines the network namespace to run the container in. This enables access to the host network namespace. See https://man7.org/linux/man-pages/man7/namespaces.7.html. + type: string + volumes: + description: Volumes defines the volumes to mount into the container. + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. \n # Examples \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details" + type: string + type: array + required: + - image + - name + type: object + startedAt: + description: StartedAt is the time the action was started as reported by the client. Nil indicates the Action has not started. + format: date-time + type: string + state: + description: State describes the current state of the action. + type: string + required: + - id + type: object + type: array + conditions: + description: Conditions details a set of observations about the Workflow. + items: + description: Condition defines an observation on a resource that is generally attainable by inspecting other status fields. + properties: + lastTransitionTime: + description: LastTransition is the last time the condition transitioned from one status to another. + format: date-time + type: string + message: + description: Message is a human readable message indicating details about the last transition. + type: string + reason: + description: Reason is a short CamelCase description for the conditions last transition. + type: string + severity: + default: Error + description: Severity with which to treat failures of this type of condition. + type: string + status: + description: Status of the condition. + type: string + type: + description: Type of condition. + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + lastTransitioned: + description: LastTransition is the observed time when State transitioned last. + format: date-time + type: string + startedAt: + description: StartedAt is the time the first action was requested. Nil indicates the Workflow has not started. + format: date-time + type: string + state: + description: State describes the current state of the workflow. For the workflow to enter the WorkflowStateSucceeded state all actions must be in ActionStateSucceeded. The Workflow will enter a WorkflowStateFailed if 1 or more Actions fails. + type: string + required: + - actions + - conditions + type: object + type: object + type: array + 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 + type: object + served: true + storage: true diff --git a/config/crd/bases/tinkerbell.org_workflows.yaml b/config/crd/bases/tinkerbell.org_workflows.yaml index 2307cfd2c..0078081a9 100644 --- a/config/crd/bases/tinkerbell.org_workflows.yaml +++ b/config/crd/bases/tinkerbell.org_workflows.yaml @@ -125,6 +125,179 @@ spec: type: array type: object type: object + served: false + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: State of the workflow such as Pending,Running etc + jsonPath: .status.state + name: State + type: string + - description: Hardware object that runs the workflow + jsonPath: .spec.hardwareRef + name: Hardware + type: string + - description: Template to run on the associated Hardware + jsonPath: .spec.templateRef + name: Template + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + description: Workflow describes a set of actions to be run on a specific Hardware. Workflows execute once and should be considered ephemeral. + 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: + properties: + hardwareRef: + description: HardwareRef is a reference to a Hardware resource this workflow will execute on. If no namespace is specified the Workflow's namespace is assumed. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + templateParams: + additionalProperties: + type: string + description: "TemplateParams are a list of key-value pairs that are injected into templates at render time. TemplateParams are exposed to templates using a top level .Params key. \n For example, TemplateParams = {\"foo\": \"bar\"}, the foo key can be accessed via .Params.foo." + type: object + templateRef: + description: TemplateRef is a reference to a Template resource used to render workflow actions. If no namespace is specified the Workflow's namespace is assumed. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + timeout: + default: 0 + description: TimeoutSeconds defines the time the workflow has to complete. The timer begins when the first action is requested. When set to 0, no timeout is applied. + format: int64 + minimum: 0 + type: integer + type: object + status: + properties: + actions: + description: Actions is a list of action states. + items: + description: ActionStatus describes status information about an action. + properties: + failureMessage: + description: FailureMessage is a free-form user friendly message describing why the Action entered the ActionStateFailed state. Typically, this is an elaboration on the Reason. + type: string + failureReason: + description: FailureReason is a short CamelCase word or phrase describing why the Action entered ActionStateFailed. + type: string + id: + description: ID uniquely identifies the action status. + type: string + lastTransitioned: + description: LastTransition is the observed time when State transitioned last. + format: date-time + type: string + rendered: + description: Rendered is the rendered action. + properties: + args: + description: Args are a set of arguments to be passed to the container on launch. + items: + type: string + type: array + cmd: + description: Cmd defines the command to use when launching the image. + type: string + env: + additionalProperties: + type: string + description: Env defines environment variables used when launching the container. + type: object + image: + description: Image is an OCI image. + type: string + name: + description: Name is a name for the action. + type: string + networkNamespace: + description: NetworkNamespace defines the network namespace to run the container in. This enables access to the host network namespace. See https://man7.org/linux/man-pages/man7/namespaces.7.html. + type: string + volumes: + description: Volumes defines the volumes to mount into the container. + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. \n # Examples \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details" + type: string + type: array + required: + - image + - name + type: object + startedAt: + description: StartedAt is the time the action was started as reported by the client. Nil indicates the Action has not started. + format: date-time + type: string + state: + description: State describes the current state of the action. + type: string + required: + - id + type: object + type: array + conditions: + description: Conditions details a set of observations about the Workflow. + items: + description: Condition defines an observation on a resource that is generally attainable by inspecting other status fields. + properties: + lastTransitionTime: + description: LastTransition is the last time the condition transitioned from one status to another. + format: date-time + type: string + message: + description: Message is a human readable message indicating details about the last transition. + type: string + reason: + description: Reason is a short CamelCase description for the conditions last transition. + type: string + severity: + default: Error + description: Severity with which to treat failures of this type of condition. + type: string + status: + description: Status of the condition. + type: string + type: + description: Type of condition. + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + lastTransitioned: + description: LastTransition is the observed time when State transitioned last. + format: date-time + type: string + startedAt: + description: StartedAt is the time the first action was requested. Nil indicates the Workflow has not started. + format: date-time + type: string + state: + description: State describes the current state of the workflow. For the workflow to enter the WorkflowStateSucceeded state all actions must be in ActionStateSucceeded. The Workflow will enter a WorkflowStateFailed if 1 or more Actions fails. + type: string + required: + - actions + - conditions + type: object + type: object served: true storage: true subresources: