v1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1 is the v1 version of the API. +groupName=apate.opendc.org +k8s:deepcopy-gen=package,register +k8s:openapi-gen=true

Index

Constants

View Source
const (
	// PodConfigurationLabel defines the label which is used to define which pod configuration resource belongs to the pod
	PodConfigurationLabel = "apate"
)

Variables

View Source
var (
	// SchemeBuilder initialises a scheme builder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is a global function that registers this API group & version to a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: podconfiguration.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

func UpdateInKubernetes

func UpdateInKubernetes(config *kubeconfig.KubeConfig, deleteCRD bool) error

UpdateInKubernetes registers or deletes the generated CRD YAML to Kubernetes

Types

type PodConfiguration

type PodConfiguration struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`

	Spec PodConfigurationSpec `json:"spec"`
}

PodConfiguration is a definition of PodConfiguration resource. +genclient +genclient:noStatus +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:resource:path=podconfigurations,shortName=pc,singular=podconfiguration

func (*PodConfiguration) DeepCopy

func (in *PodConfiguration) DeepCopy() *PodConfiguration

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

func (*PodConfiguration) DeepCopyInto

func (in *PodConfiguration) DeepCopyInto(out *PodConfiguration)

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

func (*PodConfiguration) DeepCopyObject

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

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

type PodConfigurationList

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

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

PodConfigurationList is a list of PodConfigurations. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PodConfigurationList) DeepCopy

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

func (*PodConfigurationList) DeepCopyInto

func (in *PodConfigurationList) DeepCopyInto(out *PodConfigurationList)

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

func (*PodConfigurationList) DeepCopyObject

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

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

type PodConfigurationSpec

type PodConfigurationSpec struct {
	// A direct way to update state, this will circumvent the timestamps / scenario
	// +kubebuilder:validation:Optional
	PodConfigurationState `json:",inline,omitempty"`

	// The tasks to be executed
	// +kubebuilder:validation:Optional
	Tasks []PodConfigurationTask `json:"tasks,omitempty"`
}

PodConfigurationSpec is the spec which belongs to the PodConfiguration CRD

func (*PodConfigurationSpec) DeepCopy

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

func (*PodConfigurationSpec) DeepCopyInto

func (in *PodConfigurationSpec) DeepCopyInto(out *PodConfigurationSpec)

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

type PodConfigurationState

type PodConfigurationState struct {
	// CreatePodResponse determines how to respond to the CreatePod request
	// +kubebuilder:default=UNSET
	// +kubebuilder:validation:Optional
	CreatePodResponse PodResponse `json:"create_pod_response,omitempty"`

	// UpdatePodResponse determines how to respond to the UpdatePod request
	// +kubebuilder:default=UNSET
	// +kubebuilder:validation:Optional
	UpdatePodResponse PodResponse `json:"update_pod_response,omitempty"`

	// DeletePodResponse determines how to respond to the DeletePod request
	// +kubebuilder:default=UNSET
	// +kubebuilder:validation:Optional
	DeletePodResponse PodResponse `json:"delete_pod_response,omitempty"`

	// PodGetPodResponse determines how to respond to the GetPod request
	// +kubebuilder:default=UNSET
	// +kubebuilder:validation:Optional
	GetPodResponse PodResponse `json:"get_pod_response,omitempty"`

	// GetPodStatusResponse determines how to respond to the GetPodStatus request
	// +kubebuilder:default=UNSET
	// +kubebuilder:validation:Optional
	GetPodStatusResponse PodResponse `json:"get_pod_status_response,omitempty"`

	// PodResources sets the amount of resources the related pods are using
	// +kubebuilder:validation:Optional
	PodResources *PodResources `json:"pod_resources,omitempty"`

	// PodStatus updates the current pod status
	// +kubebuilder:default=UNSET
	PodStatus PodStatus `json:"pod_status,omitempty"`
}

PodConfigurationState is the state to be set for the related pods

func (*PodConfigurationState) DeepCopy

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

func (*PodConfigurationState) DeepCopyInto

func (in *PodConfigurationState) DeepCopyInto(out *PodConfigurationState)

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

type PodConfigurationTask

type PodConfigurationTask struct {
	// The timestamp at which the task is executed
	// Any time.ParseDuration format is accepted, such as "10ms" or "42s"
	// +kubebuilder:validation:Required
	Timestamp string `json:"timestamp"`

	// Indicates whether the timestamp is relative to the start of the pod or not.
	// If set to true, a timestamp of 10s means this task will be executed 10 seconds after the pod started.
	// +kubebuilder:default=false
	// +kubebuilder:validation:Optional
	RelativeToPod bool `json:"relative_to_pod"`

	// The state to be set
	// +kubebuilder:validation:Required
	State PodConfigurationState `json:"state"`
}

PodConfigurationTask is a single task which updates a pod state and is executed at a timestamp

func (*PodConfigurationTask) DeepCopy

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

func (*PodConfigurationTask) DeepCopyInto

func (in *PodConfigurationTask) DeepCopyInto(out *PodConfigurationTask)

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

type PodResources

type PodResources struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default="0B"
	Memory string `json:"memory,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default=0
	CPU uint64 `json:"cpu,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default="0B"
	Storage string `json:"storage,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default="0B"
	EphemeralStorage string `json:"ephemeral_storage,omitempty"`
}

PodResources defines the current resource usage of the pod

func (*PodResources) DeepCopy

func (in *PodResources) DeepCopy() *PodResources

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

func (*PodResources) DeepCopyInto

func (in *PodResources) DeepCopyInto(out *PodResources)

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

type PodResponse

type PodResponse string

PodResponse can be NORMAL, TIMEOUT, ERROR or UNSET, and describes how a pod should respond +kubebuilder:validation:Enum=NORMAL;TIMEOUT;ERROR;UNSET

const (
	ResponseNormal  PodResponse = "NORMAL"
	ResponseTimeout PodResponse = "TIMEOUT"
	ResponseError   PodResponse = "ERROR"
	ResponseUnset   PodResponse = "UNSET"
)

Enum variants for PodResponse

type PodStatus

type PodStatus string

PodStatus can be PENDING, RUNNING, SUCCEEDED, FAILED, UNKNOWN or UNSET, and describes the state of a pod. +kubebuilder:validation:Enum=PENDING;RUNNING;SUCCEEDED;FAILED;UNKNOWN;UNSET

const (
	PodStatusPending   PodStatus = "PENDING"
	PodStatusRunning   PodStatus = "RUNNING"
	PodStatusSucceeded PodStatus = "SUCCEEDED"
	PodStatusFailed    PodStatus = "FAILED"
	PodStatusUnknown   PodStatus = "UNKNOWN"
	PodStatusUnset     PodStatus = "UNSET"
)

Enum variants for PodStatus

Jump to

Keyboard shortcuts

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