Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Start building out shim layer for Tinkerbell #8

Closed
wants to merge 15 commits into from
Closed
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# editor and IDE paraphernalia
.idea
.vscode
*.swp
*.swo
*~
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ generate-manifests: $(CONTROLLER_GEN) # Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) \
paths=./api/... \
paths=./controllers/... \
paths=./tink/api/... \
paths=./tink/controllers/... \
crd:crdVersions=v1 \
rbac:roleName=manager-role \
output:crd:dir=./config/crd/bases \
Expand Down
18 changes: 18 additions & 0 deletions api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright 2020 The Kubernetes 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.
*/

// Package v1alpha3 contains API Schema definitions for the infrastructure v1alpha3 API group.
package v1alpha3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this mainly for completeness

1 change: 0 additions & 1 deletion api/v1alpha3/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains API Schema definitions for the infrastructure v1alpha3 API group.
// +kubebuilder:object:generate=true
// +groupName=infrastructure.cluster.x-k8s.io
package v1alpha3
Expand Down
133 changes: 133 additions & 0 deletions config/crd/bases/tinkerbell.org_hardware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: hardware.tinkerbell.org
spec:
group: tinkerbell.org
names:
categories:
- tinkerbell
kind: Hardware
listKind: HardwareList
plural: hardware
singular: hardware
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
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:
id:
description: ID is the ID of the hardware in Tinkerbell
minLength: 1
type: string
required:
- id
type: object
status:
description: HardwareStatus defines the observed state of Hardware.
properties:
state:
type: string
tinkInterfaces:
items:
properties:
dhcp:
properties:
arch:
type: string
hostname:
type: string
iface_name:
type: string
ip:
properties:
address:
type: string
family:
format: int64
type: integer
gateway:
type: string
netmask:
type: string
type: object
lease_time:
format: int64
type: integer
mac:
type: string
name_servers:
items:
type: string
type: array
time_servers:
items:
type: string
type: array
uefi:
type: boolean
type: object
netboot:
properties:
allowPXE:
type: boolean
allowWorkflow:
type: boolean
ipxe:
properties:
contents:
type: string
url:
type: string
type: object
osie:
properties:
baseURL:
type: string
initrd:
type: string
kernel:
type: string
type: object
type: object
type: object
type: array
tinkMetadata:
type: string
tinkVersion:
format: int64
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
60 changes: 60 additions & 0 deletions config/crd/bases/tinkerbell.org_templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: templates.tinkerbell.org
spec:
group: tinkerbell.org
names:
categories:
- tinkerbell
kind: Template
listKind: TemplateList
plural: templates
singular: template
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
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:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
130 changes: 130 additions & 0 deletions config/crd/bases/tinkerbell.org_workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: workflows.tinkerbell.org
spec:
group: tinkerbell.org
names:
categories:
- tinkerbell
kind: Workflow
listKind: WorkflowList
plural: workflows
singular: workflow
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
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:
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:
actions:
description: Actions are the actions for this Workflow.
items:
properties:
command:
items:
type: string
type: array
environment:
items:
type: string
type: array
image:
type: string
name:
type: string
on_failure:
items:
type: string
type: array
on_timeout:
items:
type: string
type: array
task_name:
type: string
timeout:
format: int64
type: integer
volumes:
items:
type: string
type: array
worker_id:
type: string
type: object
type: array
data:
description: Data is the populated Workflow Data in Tinkerbell.
type: string
events:
description: Events are events for this Workflow.
items:
properties:
action_name:
type: string
action_status:
type: string
created_at:
format: date-time
type: string
message:
type: string
seconds:
format: int64
type: integer
task_name:
type: string
worker_id:
type: string
type: object
type: array
metadata:
description: Metadata is the metadata stored in Tinkerbell.
type: string
state:
description: State is the state of the workflow in Tinkerbell.
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
3 changes: 3 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ resources:
- bases/infrastructure.cluster.x-k8s.io_tinkerbellclusters.yaml
- bases/infrastructure.cluster.x-k8s.io_tinkerbellmachines.yaml
- bases/infrastructure.cluster.x-k8s.io_tinkerbellmachinetemplates.yaml
- bases/tinkerbell.org_hardware.yaml
- bases/tinkerbell.org_templates.yaml
- bases/tinkerbell.org_workflows.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
Expand Down
Loading