Skip to content

Commit

Permalink
Add Hardware resources and BMCRef
Browse files Browse the repository at this point in the history
Signed-off-by: Micah Hausler <mhausler@amazon.com>
  • Loading branch information
micahhausler committed May 6, 2022
1 parent f48c79b commit 105c9df
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
34 changes: 34 additions & 0 deletions config/crd/bases/tinkerbell.org_hardware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ spec:
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
disks:
items:
description: Disk represents a disk device for Tinkerbell Hardware.
Expand Down Expand Up @@ -318,6 +341,17 @@ spec:
state:
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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ require (
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.23.0
k8s.io/apimachinery v0.23.0
k8s.io/client-go v0.23.0
knative.dev/pkg v0.0.0-20211119170723-a99300deff34
Expand Down Expand Up @@ -160,7 +161,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.23.0 // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/component-base v0.23.0 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
Expand Down
13 changes: 13 additions & 0 deletions pkg/apis/core/v1alpha1/hardware_types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -42,6 +44,12 @@ type Hardware struct {
// HardwareSpec defines the desired state of Hardware.
type HardwareSpec struct {

// 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.
//+optional
BMCRef *corev1.TypedLocalObjectReference `json:"bmcRef,omitempty"`

//+optional
Interfaces []Interface `json:"interfaces,omitempty"`

Expand All @@ -57,6 +65,11 @@ type HardwareSpec struct {
//+optional
Disks []Disk `json:"disks,omitempty"`

// Resources represents known resources that are available on a machine.
// Resources may be used for scheduling by orchestrators.
//+optional
Resources map[string]resource.Quantity `json:"resources,omitempty"`

// UserData is the user data to configure in the hardware's
// metadata
//+optional
Expand Down
14 changes: 14 additions & 0 deletions pkg/apis/core/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 105c9df

Please sign in to comment.