Documentation ¶
Overview ¶
Package v2 contains API Schema definitions for the k8s v2 API group +kubebuilder:object:generate=true +groupName=k8s.cloudogu.com
Index ¶
- Constants
- Variables
- func GetPodForLabels(ctx context.Context, cli client.Client, doguLabels CesMatchingLabels) (*v1.Pod, error)
- type CesMatchingLabels
- type DevelopmentDoguMap
- type Dogu
- func (d *Dogu) ChangeRequeuePhaseWithRetry(ctx context.Context, client client.Client, phase string) error
- func (d *Dogu) ChangeStateWithRetry(ctx context.Context, client client.Client, newStatus string) error
- func (in *Dogu) DeepCopy() *Dogu
- func (in *Dogu) DeepCopyInto(out *Dogu)
- func (in *Dogu) DeepCopyObject() runtime.Object
- func (d *Dogu) GetDataPVC(ctx context.Context, cli client.Client) (*corev1.PersistentVolumeClaim, error)
- func (d *Dogu) GetDataVolumeName() string
- func (d *Dogu) GetDataVolumeSize() resource.Quantity
- func (d *Dogu) GetDeployment(ctx context.Context, cli client.Client) (*appsv1.Deployment, error)
- func (d *Dogu) GetDevelopmentDoguMapKey() client.ObjectKey
- func (d *Dogu) GetDoguNameLabel() CesMatchingLabels
- func (d *Dogu) GetEphemeralDataVolumeName() string
- func (d *Dogu) GetObjectKey() client.ObjectKey
- func (d *Dogu) GetObjectMeta() *metav1.ObjectMeta
- func (d *Dogu) GetPod(ctx context.Context, cli client.Client) (*corev1.Pod, error)
- func (d *Dogu) GetPodLabels() CesMatchingLabels
- func (d *Dogu) GetPrivateKeyObjectKey() client.ObjectKey
- func (d *Dogu) GetPrivateKeySecret(ctx context.Context, cli client.Client) (*corev1.Secret, error)
- func (d *Dogu) GetPrivateKeySecretName() string
- func (d *Dogu) GetSecretObjectKey() client.ObjectKey
- func (d *Dogu) NextRequeueWithRetry(ctx context.Context, client client.Client) (time.Duration, error)
- func (d *Dogu) Update(ctx context.Context, client client.Client) error
- type DoguList
- type DoguResources
- type DoguRestart
- type DoguRestartList
- type DoguRestartSpec
- type DoguRestartStatus
- type DoguSpec
- type DoguStatus
- type HealthStatus
- type IngressAnnotations
- type RestartStatusPhase
- type UpgradeConfig
Constants ¶
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" )
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" )
const ( DoguStatusNotInstalled = "" DoguStatusInstalling = "installing" DoguStatusUpgrading = "upgrading" DoguStatusDeleting = "deleting" DoguStatusInstalled = "installed" DoguStatusPVCResizing = "resizing PVC" DoguStatusStarting = "starting" DoguStatusStopping = "stopping" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "k8s.cloudogu.com", Version: "v2"} // 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 ¶
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 ¶
type CesMatchingLabels client.MatchingLabels
CesMatchingLabels provides a convenient way to handle multiple labels for resource selection.
func (CesMatchingLabels) Add ¶
func (cml CesMatchingLabels) Add(moreLabels CesMatchingLabels) CesMatchingLabels
Add takes the currently existing labels from this object and returns a sum of all provided labels as a new object.
func (CesMatchingLabels) DeepCopy ¶
func (in CesMatchingLabels) DeepCopy() CesMatchingLabels
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CesMatchingLabels.
func (CesMatchingLabels) DeepCopyInto ¶
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 ¶
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 ¶
func (in *DevelopmentDoguMap) DeepCopy() *DevelopmentDoguMap
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevelopmentDoguMap.
func (*DevelopmentDoguMap) DeepCopyInto ¶
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 ¶
DeleteFromCluster deletes this development config map from the cluster.
func (*DevelopmentDoguMap) ToConfigMap ¶
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 ¶
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 ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dogu.
func (*Dogu) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Dogu) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Dogu) GetDataPVC ¶
func (d *Dogu) GetDataPVC(ctx context.Context, cli client.Client) (*corev1.PersistentVolumeClaim, error)
GetDataPVC returns the data pvc for this dogu.
func (*Dogu) GetDataVolumeName ¶
GetDataVolumeName returns the data volume name for the dogu resource for volumes with backup
func (*Dogu) GetDataVolumeSize ¶
GetDataVolumeSize returns the dataVolumeSize of the dogu. If no size is set the default size will be returned.
func (*Dogu) GetDeployment ¶
GetDeployment returns the deployment for this dogu.
func (*Dogu) GetDevelopmentDoguMapKey ¶
GetDevelopmentDoguMapKey returns the object key for the custom dogu descriptor with the actual name and namespace from the dogu resource.
func (*Dogu) GetDoguNameLabel ¶
func (d *Dogu) GetDoguNameLabel() CesMatchingLabels
GetDoguNameLabel returns labels that select any resource being associated with this dogu.
func (*Dogu) GetEphemeralDataVolumeName ¶
GetEphemeralDataVolumeName returns the data volume name for the dogu resource for volumes without backup
func (*Dogu) GetObjectKey ¶
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 ¶
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 ¶
func (d *Dogu) GetPodLabels() CesMatchingLabels
GetPodLabels returns labels that select a pod being associated with this dogu.
func (*Dogu) GetPrivateKeyObjectKey ¶
GetPrivateKeyObjectKey returns the object key for the secret containing the private key for the dogu.
func (*Dogu) GetPrivateKeySecret ¶
GetPrivateKeySecret returns the private key secret for this dogu.
func (*Dogu) GetPrivateKeySecretName ¶
GetPrivateKeySecretName returns the name of the dogus secret resource.
func (*Dogu) GetSecretObjectKey ¶
GetSecretObjectKey returns the object key for the config map containing values that should be encrypted for the dogu
func (*Dogu) NextRequeueWithRetry ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoguList.
func (*DoguList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DoguList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DoguResources ¶
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 ¶
func (in *DoguResources) DeepCopy() *DoguResources
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoguResources.
func (*DoguResources) DeepCopyInto ¶
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 ¶
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 ¶
func (in *DoguRestart) DeepCopy() *DoguRestart
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoguRestart.
func (*DoguRestart) DeepCopyInto ¶
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 ¶
func (in *DoguRestart) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DoguRestartList ¶
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 ¶
func (in *DoguRestartList) DeepCopy() *DoguRestartList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoguRestartList.
func (*DoguRestartList) DeepCopyInto ¶
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 ¶
func (in *DoguRestartList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DoguRestartSpec ¶
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 ¶
func (in *DoguRestartSpec) DeepCopy() *DoguRestartSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoguRestartSpec.
func (*DoguRestartSpec) DeepCopyInto ¶
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 ¶
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 ¶
func (in *DoguRestartStatus) DeepCopy() *DoguRestartStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoguRestartStatus.
func (*DoguRestartStatus) DeepCopyInto ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoguSpec.
func (*DoguSpec) DeepCopyInto ¶
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"` // InstalledVersion 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 ¶
func (ds *DoguStatus) NextRequeue() time.Duration
NextRequeue increases the requeue time of the dogu status and returns the new requeue time
func (*DoguStatus) ResetRequeueTime ¶
func (ds *DoguStatus) ResetRequeueTime()
ResetRequeueTime resets the requeue timer to the initial value
type HealthStatus ¶
type HealthStatus string
const ( PendingHealthStatus HealthStatus = "" AvailableHealthStatus HealthStatus = "available" UnknownHealthStatus HealthStatus = "unknown" )
type IngressAnnotations ¶
IngressAnnotations are annotations of nginx-ingress rules.
func (IngressAnnotations) DeepCopy ¶
func (in IngressAnnotations) DeepCopy() IngressAnnotations
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressAnnotations.
func (IngressAnnotations) DeepCopyInto ¶
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 ¶
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 ¶
func (rsp RestartStatusPhase) IsFailed() bool
type UpgradeConfig ¶
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 ¶
func (in *UpgradeConfig) DeepCopy() *UpgradeConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeConfig.
func (*UpgradeConfig) DeepCopyInto ¶
func (in *UpgradeConfig) DeepCopyInto(out *UpgradeConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.