diff --git a/apis/infrastructure/v1beta1/byohost_types.go b/apis/infrastructure/v1beta1/byohost_types.go index 3f937458a..10baac2c4 100644 --- a/apis/infrastructure/v1beta1/byohost_types.go +++ b/apis/infrastructure/v1beta1/byohost_types.go @@ -30,6 +30,11 @@ type ByoHostSpec struct { // for bootstrap purpose // +optional BootstrapSecret *corev1.ObjectReference `json:"bootstrapSecret,omitempty"` + + // InstallationSecret is an optional reference to InstallationSecret + // generated by InstallerController for K8s installation + // +optional + InstallationSecret *corev1.ObjectReference `json:"installationSecret,omitempty"` } // HostInfo is a set of details about the host platform. diff --git a/apis/infrastructure/v1beta1/byomachine_types.go b/apis/infrastructure/v1beta1/byomachine_types.go index b57a69a34..ed744ca86 100644 --- a/apis/infrastructure/v1beta1/byomachine_types.go +++ b/apis/infrastructure/v1beta1/byomachine_types.go @@ -4,6 +4,7 @@ package v1beta1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) @@ -21,6 +22,11 @@ type ByoMachineSpec struct { Selector *metav1.LabelSelector `json:"selector,omitempty"` ProviderID string `json:"providerID,omitempty"` + + // InstallerRef is an optional reference to a installer-specific resource that holds + // the details of InstallationSecret to be used to install BYOH Bundle. + // +optional + InstallerRef *corev1.ObjectReference `json:"installerRef,omitempty"` } // NetworkStatus provides information about one of a VM's networks. @@ -50,6 +56,10 @@ type ByoMachineStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file + // HostInfo has the attached host platform details. + // +optional + HostInfo HostInfo `json:"hostinfo,omitempty"` + // +optional Ready bool `json:"ready"` diff --git a/apis/infrastructure/v1beta1/zz_generated.deepcopy.go b/apis/infrastructure/v1beta1/zz_generated.deepcopy.go index 985424aa3..49a7eb60a 100644 --- a/apis/infrastructure/v1beta1/zz_generated.deepcopy.go +++ b/apis/infrastructure/v1beta1/zz_generated.deepcopy.go @@ -201,6 +201,11 @@ func (in *ByoHostSpec) DeepCopyInto(out *ByoHostSpec) { *out = new(v1.ObjectReference) **out = **in } + if in.InstallationSecret != nil { + in, out := &in.InstallationSecret, &out.InstallationSecret + *out = new(v1.ObjectReference) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ByoHostSpec. @@ -315,6 +320,11 @@ func (in *ByoMachineSpec) DeepCopyInto(out *ByoMachineSpec) { *out = new(metav1.LabelSelector) (*in).DeepCopyInto(*out) } + if in.InstallerRef != nil { + in, out := &in.InstallerRef, &out.InstallerRef + *out = new(v1.ObjectReference) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ByoMachineSpec. @@ -330,6 +340,7 @@ func (in *ByoMachineSpec) DeepCopy() *ByoMachineSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ByoMachineStatus) DeepCopyInto(out *ByoMachineStatus) { *out = *in + out.HostInfo = in.HostInfo if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make(apiv1beta1.Conditions, len(*in)) diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_byohosts.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_byohosts.yaml index 08dc723e5..4fd6d0a26 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_byohosts.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_byohosts.yaml @@ -75,6 +75,43 @@ spec: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object + installationSecret: + description: InstallationSecret is an optional reference to InstallationSecret + generated by InstallerController for k8s installation + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object type: object status: description: ByoHostStatus defines the observed state of ByoHost diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_byomachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_byomachines.yaml index 93144b1a6..8b32a3cf1 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_byomachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_byomachines.yaml @@ -38,6 +38,44 @@ spec: spec: description: ByoMachineSpec defines the desired state of ByoMachine properties: + installerRef: + description: InstallerRef is an optional reference to a installer-specific + resource that holds the details of InstallationSecret to be used + to install BYOH Bundle. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object providerID: type: string selector: @@ -133,6 +171,19 @@ spec: - type type: object type: array + hostinfo: + description: HostInfo has the attached host platform details. + properties: + architecture: + description: The Architecture reported by the host. + type: string + osimage: + description: OS Image reported by the host. + type: string + osname: + description: The Operating System reported by the host. + type: string + type: object ready: type: boolean type: object diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_byomachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_byomachinetemplates.yaml index cd2251e1d..9b746c9ad 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_byomachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_byomachinetemplates.yaml @@ -45,6 +45,45 @@ spec: description: Spec is the specification of the desired behavior of the machine. properties: + installerRef: + description: InstallerRef is an optional reference to a installer-specific + resource that holds the details of InstallationSecret to + be used to install BYOH Bundle. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this + pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object. TODO: this design + is not final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object providerID: type: string selector: