v1

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 13 Imported by: 6

Documentation

Overview

Package v1 contains API Schema definitions for the k8s v1 API group +kubebuilder:object:generate=true +groupName=k8s.cloudogu.com

Index

Constants

View Source
const (
	// RequeueTimeMultiplerForEachRequeue defines the factor to multiple the requeue time of a failed dogu crd operation
	RequeueTimeMultiplerForEachRequeue = 2
	// RequeueTimeInitialRequeueTime defines the initial value of the requeue time
	RequeueTimeInitialRequeueTime = time.Second * 5
	// RequeueTimeMaxRequeueTime defines the maximum amount of time to wait for a requeue of a dogu resource
	RequeueTimeMaxRequeueTime = time.Hour * 6
	// DefaultVolumeSize is the default size of a new dogu volume if no volume size is specified in the dogu resource.
	DefaultVolumeSize = "2Gi"
)
View Source
const (
	// DoguLabelName is used to select a dogu pod by name.
	DoguLabelName = "dogu.name"
	// DoguLabelVersion is used to select a dogu pod by version.
	DoguLabelVersion = "dogu.version"
)
View Source
const (
	DoguStatusNotInstalled = ""
	DoguStatusInstalling   = "installing"
	DoguStatusUpgrading    = "upgrading"
	DoguStatusDeleting     = "deleting"
	DoguStatusInstalled    = "installed"
	DoguStatusPVCResizing  = "resizing PVC"
	DoguStatusStarting     = "starting"
	DoguStatusStopping     = "stopping"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "k8s.cloudogu.com", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func GetPodForLabels added in v0.14.0

func GetPodForLabels(ctx context.Context, cli client.Client, doguLabels CesMatchingLabels) (*v1.Pod, error)

GetPodForLabels returns a pod for the given dogu labels. An error is returned if either no pod or more than one pod is found.

Types

type CesMatchingLabels added in v0.14.0

type CesMatchingLabels client.MatchingLabels

CesMatchingLabels provides a convenient way to handle multiple labels for resource selection.

func (CesMatchingLabels) Add added in v0.14.0

Add takes the currently existing labels from this object and returns a sum of all provided labels as a new object.

func (CesMatchingLabels) DeepCopy added in v0.14.0

func (in CesMatchingLabels) DeepCopy() CesMatchingLabels

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

func (CesMatchingLabels) DeepCopyInto added in v0.14.0

func (in CesMatchingLabels) DeepCopyInto(out *CesMatchingLabels)

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

type DevelopmentDoguMap added in v0.12.0

type DevelopmentDoguMap corev1.ConfigMap

DevelopmentDoguMap is a config map that is especially used to when developing a dogu. The map contains a custom dogu.json in the data filed with the "dogu.json" identifier.

func (*DevelopmentDoguMap) DeepCopy added in v0.12.0

func (in *DevelopmentDoguMap) DeepCopy() *DevelopmentDoguMap

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

func (*DevelopmentDoguMap) DeepCopyInto added in v0.12.0

func (in *DevelopmentDoguMap) DeepCopyInto(out *DevelopmentDoguMap)

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

func (*DevelopmentDoguMap) DeleteFromCluster added in v0.12.0

func (ddm *DevelopmentDoguMap) DeleteFromCluster(ctx context.Context, client client.Client) error

DeleteFromCluster deletes this development config map from the cluster.

func (*DevelopmentDoguMap) ToConfigMap added in v0.12.0

func (ddm *DevelopmentDoguMap) ToConfigMap() *corev1.ConfigMap

ToConfigMap returns the development dogu map as config map pointer.

type Dogu

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

	Spec   DoguSpec   `json:"spec,omitempty"`
	Status DoguStatus `json:"status,omitempty"`
}

Dogu is the Schema for the dogus API

func (*Dogu) ChangeRequeuePhaseWithRetry added in v1.0.0

func (d *Dogu) ChangeRequeuePhaseWithRetry(ctx context.Context, client client.Client, phase string) error

ChangeRequeuePhaseWithRetry refreshes the dogu resource and tries to set the requeue phase. If a conflict error occurs this method will retry the operation.

func (*Dogu) ChangeStateWithRetry added in v1.0.0

func (d *Dogu) ChangeStateWithRetry(ctx context.Context, client client.Client, newStatus string) error

ChangeStateWithRetry refreshes the dogu resource and tries to set the state. If a conflict error occurs this method will retry the operation.

func (*Dogu) DeepCopy

func (in *Dogu) DeepCopy() *Dogu

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

func (*Dogu) DeepCopyInto

func (in *Dogu) DeepCopyInto(out *Dogu)

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

func (*Dogu) DeepCopyObject

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

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

func (*Dogu) GetDataPVC added in v0.19.0

func (d *Dogu) GetDataPVC(ctx context.Context, cli client.Client) (*corev1.PersistentVolumeClaim, error)

GetDataPVC returns the data pvc for this dogu.

func (*Dogu) GetDataVolumeName

func (d *Dogu) GetDataVolumeName() string

GetDataVolumeName returns the data volume name for the dogu resource for volumes with backup

func (*Dogu) GetDataVolumeSize added in v0.19.0

func (d *Dogu) GetDataVolumeSize() resource.Quantity

GetDataVolumeSize returns the dataVolumeSize of the dogu. If no size is set the default size will be returned.

func (*Dogu) GetDeployment added in v0.19.0

func (d *Dogu) GetDeployment(ctx context.Context, cli client.Client) (*appsv1.Deployment, error)

GetDeployment returns the deployment for this dogu.

func (*Dogu) GetDevelopmentDoguMapKey added in v0.12.0

func (d *Dogu) GetDevelopmentDoguMapKey() client.ObjectKey

GetDevelopmentDoguMapKey returns the object key for the custom dogu descriptor with the actual name and namespace from the dogu resource.

func (*Dogu) GetDoguNameLabel added in v0.14.0

func (d *Dogu) GetDoguNameLabel() CesMatchingLabels

GetDoguNameLabel returns labels that select any resource being associated with this dogu.

func (*Dogu) GetEphemeralDataVolumeName added in v0.34.0

func (d *Dogu) GetEphemeralDataVolumeName() string

GetEphemeralDataVolumeName returns the data volume name for the dogu resource for volumes without backup

func (*Dogu) GetObjectKey

func (d *Dogu) GetObjectKey() client.ObjectKey

GetObjectKey returns the object key with the actual name and namespace from the dogu resource

func (*Dogu) GetObjectMeta

func (d *Dogu) GetObjectMeta() *metav1.ObjectMeta

GetObjectMeta return the object meta with the actual name and namespace from the dogu resource

func (*Dogu) GetPod added in v0.14.0

func (d *Dogu) GetPod(ctx context.Context, cli client.Client) (*corev1.Pod, error)

GetPod returns a pod for this dogu. An error is returned if either no pod or more than one pod is found.

func (*Dogu) GetPodLabels added in v0.14.0

func (d *Dogu) GetPodLabels() CesMatchingLabels

GetPodLabels returns labels that select a pod being associated with this dogu.

func (*Dogu) GetPrivateKeyObjectKey added in v0.26.0

func (d *Dogu) GetPrivateKeyObjectKey() client.ObjectKey

GetPrivateKeyObjectKey returns the object key for the secret containing the private key for the dogu.

func (*Dogu) GetPrivateKeySecret added in v0.26.0

func (d *Dogu) GetPrivateKeySecret(ctx context.Context, cli client.Client) (*corev1.Secret, error)

GetPrivateKeySecret returns the private key secret for this dogu.

func (*Dogu) GetPrivateKeySecretName added in v0.26.0

func (d *Dogu) GetPrivateKeySecretName() string

GetPrivateKeySecretName returns the name of the dogus secret resource.

func (*Dogu) GetSecretObjectKey added in v0.5.0

func (d *Dogu) GetSecretObjectKey() client.ObjectKey

GetSecretObjectKey returns the object key for the config map containing values that should be encrypted for the dogu

func (*Dogu) NextRequeueWithRetry added in v1.0.0

func (d *Dogu) NextRequeueWithRetry(ctx context.Context, client client.Client) (time.Duration, error)

func (*Dogu) Update added in v0.3.0

func (d *Dogu) Update(ctx context.Context, client client.Client) error

Update updates the dogu's status property in the cluster state.

type DoguList

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

DoguList contains a list of Dogu

func (*DoguList) DeepCopy

func (in *DoguList) DeepCopy() *DoguList

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

func (*DoguList) DeepCopyInto

func (in *DoguList) DeepCopyInto(out *DoguList)

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

func (*DoguList) DeepCopyObject

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

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

type DoguResources added in v0.19.0

type DoguResources struct {
	// dataVolumeSize represents the current size of the volume. Increasing this value leads to an automatic volume
	// expansion. This includes a downtime for the respective dogu. The default size for volumes is "2Gi".
	// It is not possible to lower the volume size after an expansion. This will introduce an inconsistent state for the
	// dogu.
	DataVolumeSize string `json:"dataVolumeSize,omitempty"`
}

DoguResources defines the physical resources used by the dogu.

func (*DoguResources) DeepCopy added in v0.19.0

func (in *DoguResources) DeepCopy() *DoguResources

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

func (*DoguResources) DeepCopyInto added in v0.19.0

func (in *DoguResources) DeepCopyInto(out *DoguResources)

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

type DoguRestart added in v1.0.0

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

	Spec   DoguRestartSpec   `json:"spec,omitempty"`
	Status DoguRestartStatus `json:"status,omitempty"`
}

DoguRestart is the Schema for the dogurestarts API

func (*DoguRestart) DeepCopy added in v1.0.0

func (in *DoguRestart) DeepCopy() *DoguRestart

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

func (*DoguRestart) DeepCopyInto added in v1.0.0

func (in *DoguRestart) DeepCopyInto(out *DoguRestart)

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

func (*DoguRestart) DeepCopyObject added in v1.0.0

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

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

type DoguRestartList added in v1.0.0

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

DoguRestartList contains a list of DoguRestart

func (*DoguRestartList) DeepCopy added in v1.0.0

func (in *DoguRestartList) DeepCopy() *DoguRestartList

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

func (*DoguRestartList) DeepCopyInto added in v1.0.0

func (in *DoguRestartList) DeepCopyInto(out *DoguRestartList)

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

func (*DoguRestartList) DeepCopyObject added in v1.0.0

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

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

type DoguRestartSpec added in v1.0.0

type DoguRestartSpec struct {
	// DoguName references the dogu that should get restarted.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Dogu name is immutable"
	DoguName string `json:"doguName"`
}

DoguRestartSpec defines the desired state of DoguRestart

func (*DoguRestartSpec) DeepCopy added in v1.0.0

func (in *DoguRestartSpec) DeepCopy() *DoguRestartSpec

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

func (*DoguRestartSpec) DeepCopyInto added in v1.0.0

func (in *DoguRestartSpec) DeepCopyInto(out *DoguRestartSpec)

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

type DoguRestartStatus added in v1.0.0

type DoguRestartStatus struct {
	// Phase tracks the state of the restart process.
	Phase RestartStatusPhase `json:"phase,omitempty"`
}

DoguRestartStatus defines the observed state of DoguRestart

func (*DoguRestartStatus) DeepCopy added in v1.0.0

func (in *DoguRestartStatus) DeepCopy() *DoguRestartStatus

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

func (*DoguRestartStatus) DeepCopyInto added in v1.0.0

func (in *DoguRestartStatus) DeepCopyInto(out *DoguRestartStatus)

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

type DoguSpec

type DoguSpec struct {
	// Name of the dogu (e.g. official/ldap)
	Name string `json:"name,omitempty"`
	// Version of the dogu (e.g. 2.4.48-3)
	Version string `json:"version,omitempty"`
	// Resources of the dogu (e.g. dataVolumeSize)
	Resources DoguResources `json:"resources,omitempty"`
	// SupportMode indicates whether the dogu should be restarted in the support mode (f. e. to recover manually from
	// a crash loop).
	SupportMode bool `json:"supportMode,omitempty"`
	// Stopped indicates whether the dogu should be running (stopped=false) or not (stopped=true).
	Stopped bool `json:"stopped,omitempty"`
	// UpgradeConfig contains options to manipulate the upgrade process.
	UpgradeConfig UpgradeConfig `json:"upgradeConfig,omitempty"`
	// AdditionalIngressAnnotations provides additional annotations that get included into the dogu's ingress rules.
	AdditionalIngressAnnotations IngressAnnotations `json:"additionalIngressAnnotations,omitempty"`
}

DoguSpec defines the desired state of a Dogu

func (*DoguSpec) DeepCopy

func (in *DoguSpec) DeepCopy() *DoguSpec

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

func (*DoguSpec) DeepCopyInto

func (in *DoguSpec) DeepCopyInto(out *DoguSpec)

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

type DoguStatus

type DoguStatus struct {
	// Status represents the state of the Dogu in the ecosystem
	Status string `json:"status"`
	// RequeueTime contains time necessary to perform the next requeue
	RequeueTime time.Duration `json:"requeueTime"`
	// RequeuePhase is the actual phase of the dogu resource used for a currently running async process.
	RequeuePhase string `json:"requeuePhase"`
	// Health describes the health status of the dogu
	Health HealthStatus `json:"health,omitempty"`
	// Installed version of the dogu (e.g. 2.4.48-3)
	InstalledVersion string `json:"installedVersion,omitempty"`
	// Stopped shows if the dogu has been stopped or not.
	Stopped bool `json:"stopped,omitempty"`
}

DoguStatus defines the observed state of a Dogu.

func (*DoguStatus) DeepCopy

func (in *DoguStatus) DeepCopy() *DoguStatus

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

func (*DoguStatus) DeepCopyInto

func (in *DoguStatus) DeepCopyInto(out *DoguStatus)

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

func (*DoguStatus) NextRequeue added in v0.3.0

func (ds *DoguStatus) NextRequeue() time.Duration

NextRequeue increases the requeue time of the dogu status and returns the new requeue time

func (*DoguStatus) ResetRequeueTime added in v0.3.0

func (ds *DoguStatus) ResetRequeueTime()

ResetRequeueTime resets the requeue timer to the initial value

type HealthStatus added in v0.40.0

type HealthStatus string
const (
	PendingHealthStatus     HealthStatus = ""
	AvailableHealthStatus   HealthStatus = "available"
	UnavailableHealthStatus HealthStatus = "unavailable"
	UnknownHealthStatus     HealthStatus = "unknown"
)

type IngressAnnotations added in v0.29.0

type IngressAnnotations map[string]string

IngressAnnotations are annotations of nginx-ingress rules.

func (IngressAnnotations) DeepCopy added in v0.29.0

func (in IngressAnnotations) DeepCopy() IngressAnnotations

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

func (IngressAnnotations) DeepCopyInto added in v0.29.0

func (in IngressAnnotations) DeepCopyInto(out *IngressAnnotations)

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

type RestartStatusPhase added in v1.0.0

type RestartStatusPhase string
const (
	RestartStatusPhaseNew           RestartStatusPhase = ""
	RestartStatusPhaseStopping      RestartStatusPhase = "stopping"
	RestartStatusPhaseStopped       RestartStatusPhase = "stopped"
	RestartStatusPhaseStarting      RestartStatusPhase = "starting"
	RestartStatusPhaseCompleted     RestartStatusPhase = "completed"
	RestartStatusPhaseDoguNotFound  RestartStatusPhase = "dogu not found"
	RestartStatusPhaseFailedGetDogu RestartStatusPhase = "failed getting dogu"
	RestartStatusPhaseFailedStop    RestartStatusPhase = "stop failed"
	RestartStatusPhaseFailedStart   RestartStatusPhase = "start failed"
)

func (RestartStatusPhase) IsFailed added in v1.0.0

func (rsp RestartStatusPhase) IsFailed() bool

type UpgradeConfig added in v0.12.0

type UpgradeConfig struct {
	// AllowNamespaceSwitch lets a dogu switch its dogu namespace during an upgrade. The dogu must be technically the
	// same dogu which did reside in a different namespace. The remote dogu's version must be equal to or greater than
	// the version of the local dogu.
	AllowNamespaceSwitch bool `json:"allowNamespaceSwitch,omitempty"`
	// ForceUpgrade allows to install the same or even lower dogu version than already is installed. Please note, that
	// possible data loss may occur by inappropriate dogu downgrading.
	ForceUpgrade bool `json:"forceUpgrade,omitempty"`
}

UpgradeConfig contains configuration hints for the dogu operator regarding aspects during the upgrade of dogus.

func (*UpgradeConfig) DeepCopy added in v0.12.0

func (in *UpgradeConfig) DeepCopy() *UpgradeConfig

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

func (*UpgradeConfig) DeepCopyInto added in v0.12.0

func (in *UpgradeConfig) DeepCopyInto(out *UpgradeConfig)

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