v1alpha1

package
v0.0.0-...-e789424 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=kubelight.dev

Index

Constants

View Source
const (
	BackendTypeBareMetal = "bare-metal"

	PoolFlavorOpenShift       = "openshift"
	PoolFlavorKubernetes      = "kubernetes"
	PoolStrategyAggressive    = "aggressive"
	PoolBackendTypeCRC        = "crc"
	PoolBackendTypeClusterBot = "cluster-bot"
)
View Source
const (
	// BackendConditionReady is set when the revision is starting to materialize
	// runtime resources, and becomes true when those resources are ready.
	BackendConditionReady = apis.ConditionReady
)
View Source
const (
	GroupName = "kubelight.dev"
)

GroupName is the group name used in this package

View Source
const (
	// PoolConditionReady is set when the revision is starting to materialize
	// runtime resources, and becomes true when those resources are ready.
	PoolConditionReady = apis.ConditionReady
)

Variables

View Source
var (
	// SchemeBuilder builds a scheme with the types known to the package.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme adds the types known to this package to an existing schema.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Backend

type Backend struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`

	// Spec holds the desired state of the Backend (from the client).
	Spec BackendSpec `json:"spec"`

	// Status communicates the observed state of the Backend (from the controller).
	// +optional
	Status BackendStatus `json:"status,omitempty"`
}

Backend is a Knative abstraction that encapsulates the interface by which Knative components express a desire to have a particular image cached.

+genclient +genreconciler +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Backend) DeepCopy

func (in *Backend) DeepCopy() *Backend

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend.

func (*Backend) DeepCopyInto

func (in *Backend) DeepCopyInto(out *Backend)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Backend) DeepCopyObject

func (in *Backend) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Backend) GetConditionSet

func (b *Backend) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*Backend) GetGroupVersionKind

func (b *Backend) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable

func (*Backend) GetStatus

func (b *Backend) GetStatus() *duckv1.Status

GetStatus retrieves the status of the resource. Implements the KRShaped interface.

func (*Backend) Init

func (b *Backend) Init(ctx context.Context, client kubernetes.Interface) error

func (*Backend) SetDefaults

func (b *Backend) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*Backend) Validate

func (b *Backend) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type BackendList

type BackendList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Backend `json:"items"`
}

BackendList is a list of Backend resources +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*BackendList) DeepCopy

func (in *BackendList) DeepCopy() *BackendList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendList.

func (*BackendList) DeepCopyInto

func (in *BackendList) DeepCopyInto(out *BackendList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackendList) DeepCopyObject

func (in *BackendList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackendSpec

type BackendSpec struct {
	// Type of the backend; bare-metal, gke, aws, etc
	Type string `json:"type"`
	// Machines is supported only for bare metal backend
	Machines []Machine `json:"machines,omitempty"`
	// Secret that contains GKE/AWS credentials
	Secret string `json:"secret"`
	// Wake on LAN proxy details
	WakeOnLAN WakeOnLAN `json:"wake-on-lan"`
}

BackendSpec holds the desired state of the Backend (from the client).

func (*BackendSpec) DeepCopy

func (in *BackendSpec) DeepCopy() *BackendSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendSpec.

func (*BackendSpec) DeepCopyInto

func (in *BackendSpec) DeepCopyInto(out *BackendSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackendSpec) Validate

func (bs *BackendSpec) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type BackendStatus

type BackendStatus struct {
	duckv1.Status `json:",inline"`
}

BackendStatus communicates the observed state of the Backend (from the controller).

func (*BackendStatus) DeepCopy

func (in *BackendStatus) DeepCopy() *BackendStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendStatus.

func (*BackendStatus) DeepCopyInto

func (in *BackendStatus) DeepCopyInto(out *BackendStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackendStatus) InitializeConditions

func (bs *BackendStatus) InitializeConditions()

InitializeConditions sets the initial values to the conditions.

func (*BackendStatus) MarkBackendAvailable

func (bs *BackendStatus) MarkBackendAvailable()

func (*BackendStatus) MarkBackendUnavailable

func (bs *BackendStatus) MarkBackendUnavailable()

type BackendType

type BackendType interface {
}

TODO

type ClusterResources

type ClusterResources struct {
	CPU    int    `json:"cpu"`
	Memory string `json:"memory"`
	Disk   string `json:"disk"`
}

func (*ClusterResources) DeepCopy

func (in *ClusterResources) DeepCopy() *ClusterResources

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResources.

func (*ClusterResources) DeepCopyInto

func (in *ClusterResources) DeepCopyInto(out *ClusterResources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Flavor

type Flavor struct {
	// Name of the flavor - Kubernetes or OpenShift
	Name string `json:"name"`
	// Kubernetes or OpenShift version to be run
	Version string `json:"version"`
}

func (*Flavor) DeepCopy

func (in *Flavor) DeepCopy() *Flavor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Flavor.

func (*Flavor) DeepCopyInto

func (in *Flavor) DeepCopyInto(out *Flavor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Machine

type Machine struct {
	// Hostname or IP of the machine
	Host string `json:"host"`
	// SSH credentials for the machine
	SSHSecret string `json:"ssh-secret"`
	// Should the machine be WOLed if it's down
	WakeOnLan string `json:"wake-on-lan"`
}

func (*Machine) DeepCopy

func (in *Machine) DeepCopy() *Machine

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine.

func (*Machine) DeepCopyInto

func (in *Machine) DeepCopyInto(out *Machine)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Machine) Init

func (m *Machine) Init(ctx context.Context, client kubernetes.Interface, wolProxy WOLProxy, namespace string) error

type Pool

type Pool struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`

	// Spec holds the desired state of the Pool (from the client).
	Spec PoolSpec `json:"spec"`

	// Status communicates the observed state of the Pool (from the controller).
	// +optional
	Status PoolStatus `json:"status,omitempty"`
}

Pool defined the desired state of the cluster pool that user wants to create

+genclient +genreconciler +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Pool) DeepCopy

func (in *Pool) DeepCopy() *Pool

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pool.

func (*Pool) DeepCopyInto

func (in *Pool) DeepCopyInto(out *Pool)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Pool) DeepCopyObject

func (in *Pool) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Pool) GetConditionSet

func (p *Pool) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*Pool) GetGroupVersionKind

func (*Pool) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable

func (*Pool) GetStatus

func (p *Pool) GetStatus() *duckv1.Status

GetStatus retrieves the status of the resource. Implements the KRShaped interface.

func (*Pool) SetDefaults

func (p *Pool) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*Pool) Validate

func (p *Pool) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type PoolBackend

type PoolBackend struct {
	// Name of the backend to be used for this pool
	Name string `json:"name"`
	// Type of the backend to be used
	Type string `json:"type"`
}

func (*PoolBackend) DeepCopy

func (in *PoolBackend) DeepCopy() *PoolBackend

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolBackend.

func (*PoolBackend) DeepCopyInto

func (in *PoolBackend) DeepCopyInto(out *PoolBackend)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PoolConfig

type PoolConfig struct {
	// Number of nodes to be run in one cluster
	Nodes int `json:"nodes"`
	// Resources required per cluster
	Resources ClusterResources `json:"resources"`
}

func (*PoolConfig) DeepCopy

func (in *PoolConfig) DeepCopy() *PoolConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolConfig.

func (*PoolConfig) DeepCopyInto

func (in *PoolConfig) DeepCopyInto(out *PoolConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PoolList

type PoolList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Pool `json:"items"`
}

PoolList is a list of Pool resources +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PoolList) DeepCopy

func (in *PoolList) DeepCopy() *PoolList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolList.

func (*PoolList) DeepCopyInto

func (in *PoolList) DeepCopyInto(out *PoolList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PoolList) DeepCopyObject

func (in *PoolList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PoolSpec

type PoolSpec struct {
	// List of backends that will support the Pool
	Backends []PoolBackend `json:"backends"`
	// Number of clusters that will be running in the Pool
	Count int `json:"count"`
	// Flavor of Kubernetes or OpenShift to run in the Pool
	Flavor Flavor `json:"flavor"`
	// Configuration of the Pool
	Config PoolConfig `json:"config"`
	// Strategy to support for the Pool
	Strategy string `json:"strategy"`
}

PoolSpec holds the desired state of the Pool (from the client).

func (*PoolSpec) DeepCopy

func (in *PoolSpec) DeepCopy() *PoolSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolSpec.

func (*PoolSpec) DeepCopyInto

func (in *PoolSpec) DeepCopyInto(out *PoolSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PoolSpec) Validate

func (ps *PoolSpec) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type PoolStatus

type PoolStatus struct {
	duckv1.Status `json:",inline"`
}

PoolStatus communicates the observed state of the Pool (from the controller).

func (*PoolStatus) DeepCopy

func (in *PoolStatus) DeepCopy() *PoolStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolStatus.

func (*PoolStatus) DeepCopyInto

func (in *PoolStatus) DeepCopyInto(out *PoolStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PoolStatus) InitializeConditions

func (ps *PoolStatus) InitializeConditions()

InitializeConditions sets the initial values to the conditions.

func (*PoolStatus) MarkServiceAvailable

func (ps *PoolStatus) MarkServiceAvailable()

func (*PoolStatus) MarkServiceUnavailable

func (ps *PoolStatus) MarkServiceUnavailable(name string)

type WOLProxy

type WOLProxy struct {
	ProxyClient *ssh.Client
	WakeOnLAN   WakeOnLAN
}

+k8s:deepcopy-gen=false

type WakeOnLAN

type WakeOnLAN struct {
	// WOL proxy host
	Proxy string `json:"proxy"`
	// SSH credentials for the proxy
	SSHSecret string `json:"ssh-secret"`
	// Command to run for WOL
	Command string `json:"command"`
}

func (*WakeOnLAN) DeepCopy

func (in *WakeOnLAN) DeepCopy() *WakeOnLAN

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WakeOnLAN.

func (*WakeOnLAN) DeepCopyInto

func (in *WakeOnLAN) DeepCopyInto(out *WakeOnLAN)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL