v1alpha1

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Overview

Package v1alpha1 is the v1 alpha 1 version of the API.

+groupName=pvpool.puppet.com +kubebuilder:object:generate=true

Index

Constants

View Source
const (
	// CheckoutAcquired indicates whether a Checkout has successfully taken a
	// PVC from the pool.
	CheckoutAcquired CheckoutConditionType = "Acquired"

	// CheckoutAcquiredReasonPoolDoesNotExist is used to indicate that the
	// poolRef points to a nonexistent pool.
	CheckoutAcquiredReasonPoolDoesNotExist = "PoolDoesNotExist"

	// CheckoutAcquiredReasonNotAvailable is used to indicate that the pool does
	// not have any available PVCs.
	CheckoutAcquiredReasonNotAvailable = "NotAvailable"

	// CheckoutAcquiredReasonInvalid is used to indicate that the PVC template
	// for this checkout is invalid.
	CheckoutAcquiredReasonInvalid = "Invalid"

	// CheckoutAcquiredReasonConflict is used to indicate that another PVC that
	// isn't owned by this checkout already exists with the name this checkout
	// wants to use.
	CheckoutAcquiredReasonConflict = "Conflict"

	// CheckoutAcquiredReasonCheckedOut is used to indicate that a PVC was
	// successfully taken and is now available.
	CheckoutAcquiredReasonCheckedOut = "CheckedOut"
)
View Source
const (
	// PoolAvailable indicates whether a Pool contains one or more usable
	// replicas.
	PoolAvailable PoolConditionType = "Available"

	// PoolAvailableReasonNoReplicasRequested is used to indicate that this pool
	// has no replicas in its spec.
	PoolAvailableReasonNoReplicasRequested = "NoReplicasRequested"

	// PoolAvailableReasonMinimumReplicasAvailable is used to indicate
	// successful binding and initialization of one or more PVCs in the pool.
	PoolAvailableReasonMinimumReplicasAvailable = "MinimumReplicasAvailable"

	// PoolSettlement indicates whether all of the desired replicas for the Pool
	// are now set up and ready to use.
	PoolSettlement PoolConditionType = "Settlement"

	// PoolSettlementReasonInvalid is used when user-specified configuration
	// that could not be statically checked is invalid.
	PoolSettlementReasonInvalid = "Invalid"

	// PoolSettlementReasonInitJobFailed is used when the job used to initialize
	// the PVC has failed, either temporarily or permanently.
	PoolSettlementReasonInitJobFailed = "InitJobFailed"

	// PoolSettlementReasonSettled is used to indicate that the observed
	// generation matches the object generation and exactly the number of
	// desired replicas are in place.
	PoolSettlementReasonSettled = "Settled"
)

Variables

View Source
var (
	// SchemeBuilder allows this package to be used with dynamic Kubernetes
	// clients to manage Kubernetes objects.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme adds the types from this package to another scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var CheckoutKind = SchemeGroupVersion.WithKind("Checkout")

CheckoutKind is the public Kubernetes group-version-kind triple for the Checkout type.

View Source
var PoolKind = SchemeGroupVersion.WithKind("Pool")

PoolKind is the public Kubernetes group-version-kind triple for the Pool type.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: "pvpool.puppet.com", Version: "v1alpha1"}

SchemeGroupVersion is the public Kubernetes group-version pair for this package.

Functions

func Resource

func Resource(resource string) schema.GroupVersionResource

Resource returns the public Kubernetes group-version-resource triple for a given resource in this package.

Types

type Checkout

type Checkout struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              CheckoutSpec `json:"spec"`

	// +optional
	Status CheckoutStatus `json:"status"`
}

Checkout requests a PVC from a Pool.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:storageversion +kubebuilder:printcolumn:name="Claim",type="string",JSONPath=".status.volumeClaimRef.name" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*Checkout) DeepCopy

func (in *Checkout) DeepCopy() *Checkout

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

func (*Checkout) DeepCopyInto

func (in *Checkout) DeepCopyInto(out *Checkout)

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

func (*Checkout) DeepCopyObject

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

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

type CheckoutCondition

type CheckoutCondition struct {
	Condition `json:",inline"`

	// Type is the identifier for this condition.
	//
	// +kubebuilder:validation:Enum=Acquired
	Type CheckoutConditionType `json:"type"`
}

CheckoutCondition is a status condition for a Checkout.

func (*CheckoutCondition) DeepCopy

func (in *CheckoutCondition) DeepCopy() *CheckoutCondition

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

func (*CheckoutCondition) DeepCopyInto

func (in *CheckoutCondition) DeepCopyInto(out *CheckoutCondition)

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

type CheckoutConditionType

type CheckoutConditionType string

CheckoutConditionType is the type of a Checkout condition.

type CheckoutList

type CheckoutList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Checkout `json:"items"`
}

CheckoutList enumerates many Checkout resources.

+kubebuilder:object:root=true

func (*CheckoutList) DeepCopy

func (in *CheckoutList) DeepCopy() *CheckoutList

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

func (*CheckoutList) DeepCopyInto

func (in *CheckoutList) DeepCopyInto(out *CheckoutList)

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

func (*CheckoutList) DeepCopyObject

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

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

type CheckoutSpec

type CheckoutSpec struct {
	// PoolRef is the pool to check out a PVC from.
	PoolRef PoolReference `json:"poolRef"`

	// ClaimName is the name of the PVC to allocate.
	//
	// If not specified, the controller will generate a name for you.
	//
	// +optional
	ClaimName string `json:"claimName,omitempty"`

	// AccessModes are the access modes to assign to the checked out PVC.
	// Defaults to ReadWriteOnce.
	//
	// +optional
	// +kubebuilder:default={"ReadWriteOnce"}
	AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`
}

CheckoutSpec is the configuration to request a particular PV from a Pool.

func (*CheckoutSpec) DeepCopy

func (in *CheckoutSpec) DeepCopy() *CheckoutSpec

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

func (*CheckoutSpec) DeepCopyInto

func (in *CheckoutSpec) DeepCopyInto(out *CheckoutSpec)

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

type CheckoutStatus

type CheckoutStatus struct {
	// VolumeName is the name of the volume being configured for the checkout.
	// It will track a volume from the upstream pool until its configuration is
	// copied to a new volume, at which point it will be permanently set to that
	// new volume.
	//
	// This field will be set as soon as a PVC is available in the pool.
	//
	// +optional
	VolumeName string `json:"volumeName,omitempty"`

	// VolumeClaimRef is a reference to the PVC checked out from the pool.
	//
	// This field will only be set when the checked out PVC is ready to be used.
	//
	// +optional
	VolumeClaimRef corev1.LocalObjectReference `json:"volumeClaimRef,omitempty"`

	// Conditions are the possible observable conditions for the checkout.
	//
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []CheckoutCondition `json:"conditions,omitempty"`
}

CheckoutStatus is the runtime state of a checkout.

func (*CheckoutStatus) DeepCopy

func (in *CheckoutStatus) DeepCopy() *CheckoutStatus

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

func (*CheckoutStatus) DeepCopyInto

func (in *CheckoutStatus) DeepCopyInto(out *CheckoutStatus)

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

type Condition

type Condition struct {
	Status             corev1.ConditionStatus `json:"status"`
	LastTransitionTime metav1.Time            `json:"lastTransitionTime"`

	// Reason identifies the cause of the given status using an API-locked
	// camel-case identifier.
	//
	// +optional
	Reason string `json:"reason,omitempty"`

	// Message is a human-readable description of the given status.
	//
	// +optional
	Message string `json:"message,omitempty"`
}

Condition is the base type for conditions, inlined into each condition type.

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

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

type JobTemplate

type JobTemplate struct {
	// +kubebuilder:pruning:PreserveUnknownFields
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec batchv1.JobSpec `json:"spec"`
}

JobTemplate is a subset of a batch job that can be used as a template in an object spec.

func (*JobTemplate) DeepCopy

func (in *JobTemplate) DeepCopy() *JobTemplate

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

func (*JobTemplate) DeepCopyInto

func (in *JobTemplate) DeepCopyInto(out *JobTemplate)

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

type MountJob

type MountJob struct {
	// Template is the configuration for the job.
	Template JobTemplate `json:"template"`

	// VolumeName is the name of the volume to be added to the template to
	// access the persistent volume. The volume must either not exist in the
	// template or must have a persistent volume claim source.
	//
	// +optional
	// +kubebuilder:default="workspace"
	VolumeName string `json:"volumeName,omitempty"`
}

MountJob is a job that has a persistent volume attached to it with a configured name.

func (*MountJob) DeepCopy

func (in *MountJob) DeepCopy() *MountJob

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

func (*MountJob) DeepCopyInto

func (in *MountJob) DeepCopyInto(out *MountJob)

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

type PersistentVolumeClaimTemplate

type PersistentVolumeClaimTemplate struct {
	// +kubebuilder:pruning:PreserveUnknownFields
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec corev1.PersistentVolumeClaimSpec `json:"spec"`
}

PersistentVolumeClaimTemplate is a subset of a core persistent volume claim that can be used as a template in an object spec.

func (*PersistentVolumeClaimTemplate) DeepCopy

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

func (*PersistentVolumeClaimTemplate) DeepCopyInto

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

type Pool

type Pool struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              PoolSpec `json:"spec"`

	// +optional
	Status PoolStatus `json:"status"`
}

Pool is a collection of preconfigured persistent volumes that can be taken and recycled as needed.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:storageversion +kubebuilder:printcolumn:name="Available",type="string",JSONPath=".status.availableReplicas" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

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.

type PoolCondition

type PoolCondition struct {
	Condition `json:",inline"`

	// Type is the identifier for this condition.
	//
	// +kubebuilder:validation:Enum=Available;Settlement
	Type PoolConditionType `json:"type"`
}

PoolCondition is a status condition for a Pool.

func (*PoolCondition) DeepCopy

func (in *PoolCondition) DeepCopy() *PoolCondition

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

func (*PoolCondition) DeepCopyInto

func (in *PoolCondition) DeepCopyInto(out *PoolCondition)

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

type PoolConditionType

type PoolConditionType string

PoolConditionType is the type of a Pool condition.

type PoolList

type PoolList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Pool `json:"items"`
}

PoolList enumerates many Pool resources.

+kubebuilder:object:root=true

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 PoolReference

type PoolReference struct {
	// Namespace identifies the Kubernetes namespace of the pool.
	//
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name identifies the name of the pool within the namespace.
	Name string `json:"name"`
}

PoolReference is a reference to a Pool.

func (*PoolReference) DeepCopy

func (in *PoolReference) DeepCopy() *PoolReference

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

func (*PoolReference) DeepCopyInto

func (in *PoolReference) DeepCopyInto(out *PoolReference)

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

type PoolSpec

type PoolSpec struct {
	// Replicas are the number of PVs to make available in the pool.
	//
	// Once a PV is checked out from the pool, it no longer counts toward the
	// number replicas. Setting this field to 0 will make the pool unusable.
	//
	// +optional
	// +kubebuilder:default=1
	Replicas *int32 `json:"replicas,omitempty"`

	// Selector is the label selector for PVCs maintained in the pool.
	//
	// The selector must match a subset of the labels in the template.
	Selector metav1.LabelSelector `json:"selector"`

	// Template describes the configuration of the dynamic PVCs that this
	// controller should manage.
	Template PersistentVolumeClaimTemplate `json:"template"`

	// InitJob configures a job to process newly created PVs before they are
	// made available as part of the pool.
	//
	// +optional
	InitJob *MountJob `json:"initJob,omitempty"`
}

PoolSpec is the configuration for a pool.

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.

type PoolStatus

type PoolStatus struct {
	// ObservedGeneration is the generation of the resource specification that
	// this status matches.
	//
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Replicas are the number of PVCs that currently exist that match this
	// pool's selector.
	//
	// +optional
	Replicas int32 `json:"replicas,omitempty"`

	// AvailableReplicas are the number of PVs from this pool that are ready to
	// be checked out.
	//
	// +optional
	AvailableReplicas int32 `json:"availableReplicas,omitempty"`

	// Conditions are the possible observable conditions for this pool.
	//
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []PoolCondition `json:"conditions,omitempty"`
}

PoolStatus is the runtime state of an existing pool.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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