Documentation
¶
Index ¶
- Constants
- Variables
- func NewDoguAdditionalIngressAnnotationsManager(client client.Client, eventRecorder record.EventRecorder) *doguAdditionalIngressAnnotationsManager
- func NewDoguAdditionalMountManager(deploymentInterface deploymentInterface, mgrSet *util.ManagerSet, ...) *doguAdditionalMountManager
- func NewDoguDeleteManager(client client.Client, operatorConfig *config.OperatorConfig, ...) *doguDeleteManager
- func NewDoguExportManager(doguClient doguClient.DoguInterface, podClient podInterface, ...) *doguExportManager
- func NewDoguInstallManager(client client.Client, mgrSet *util.ManagerSet, ...) *doguInstallManager
- func NewDoguReconciler(client client.Client, doguInterface doguClient.DoguInterface, ...) (*doguReconciler, error)
- func NewDoguRequeueHandler(doguInterface doguClient.DoguInterface, recorder record.EventRecorder, ...) (*doguRequeueHandler, error)
- func NewDoguSupportManager(client client.Client, mgrSet *util.ManagerSet, ...) *doguSupportManager
- func NewDoguUpgradeManager(client client.Client, mgrSet *util.ManagerSet, ...) *doguUpgradeManager
- func NewDoguVolumeManager(client client.Client, eventRecorder record.EventRecorder, ...) *doguVolumeManager
- type ClientSet
- type CombinedDoguManager
- type DeploymentReconciler
- type DoguManager
- func (m *DoguManager) AdditionalMountsChanged(ctx context.Context, doguResource *doguv2.Dogu) (bool, error)
- func (m *DoguManager) Delete(ctx context.Context, doguResource *doguv2.Dogu) error
- func (m *DoguManager) HandleSupportMode(ctx context.Context, doguResource *doguv2.Dogu) (bool, error)
- func (m *DoguManager) Install(ctx context.Context, doguResource *doguv2.Dogu) error
- func (m *DoguManager) SetDoguAdditionalIngressAnnotations(ctx context.Context, doguResource *doguv2.Dogu) error
- func (m *DoguManager) SetDoguDataVolumeSize(ctx context.Context, doguResource *doguv2.Dogu) error
- func (m *DoguManager) StartStopDogu(ctx context.Context, doguResource *doguv2.Dogu) error
- func (m *DoguManager) UpdateAdditionalMounts(ctx context.Context, doguResource *doguv2.Dogu) error
- func (m *DoguManager) UpdateDeploymentWithSecurityContext(ctx context.Context, doguResource *doguv2.Dogu) error
- func (m *DoguManager) UpdateExportMode(ctx context.Context, doguResource *doguv2.Dogu) error
- func (m *DoguManager) Upgrade(ctx context.Context, doguResource *doguv2.Dogu) error
- type DoguResourceGenerator
- type DoguRestartGarbageCollector
- type DoguRestartReconciler
- type DoguSecurityContextManager
- type K8sClient
- type PvcReconciler
- type RestartOperation
Constants ¶
const ( // ChangeDoguAdditionalMountsEventReason is the reason string for firing events for changing additional mounts in the dogu cr. ChangeDoguAdditionalMountsEventReason = "ChangeDoguAdditionalMounts" // ErrorOnChangeDoguAdditionalMountsEventReason is the error string for firing change dogu additional mounts. ErrorOnChangeDoguAdditionalMountsEventReason = "ErrChangeDoguAdditionalMounts" )
const ( // ChangeExportModeEventReason is the reason string for firing events for activating/deactivating the export mode. ChangeExportModeEventReason = "ChangeExportMode" // ErrorOnChangeExportModeEventReason is the error string for firing change export mode error events. ErrorOnChangeExportModeEventReason = "ErrChangeExportMode" )
const ( // AdditionalIngressAnnotationsChangeEventReason is the reason string for firing additional ingress annotations change events. AdditionalIngressAnnotationsChangeEventReason = "AdditionalIngressAnnotationsChange" // ErrorOnAdditionalIngressAnnotationsChangeEventReason is the error string for firing additional ingress annotations change error events. ErrorOnAdditionalIngressAnnotationsChangeEventReason = "ErrAdditionalIngressAnnotationsChange" )
const ( // SecurityContextChangeEventReason is the reason string for firing security context change events. SecurityContextChangeEventReason = "SecurityContextChange" // ErrorOnSecurityContextChangeEventReason is the error string for firing security context change error events. ErrorOnSecurityContextChangeEventReason = "ErrSecurityContextChange" )
const ( // StartStopDoguEventReason is the reason string for firing start/stop dogu events. StartStopDoguEventReason = "StartStopDogu" // ErrorOnStartStopDoguEventReason is the error string for firing start/stop dogu error events. ErrorOnStartStopDoguEventReason = "ErrStartStopDogu" )
const ( // VolumeExpansionEventReason is the reason string for firing volume expansion events. VolumeExpansionEventReason = "VolumeExpansion" // ErrorOnVolumeExpansionEventReason is the error string for firing volume expansion error events. ErrorOnVolumeExpansionEventReason = "ErrVolumeExpansion" )
const ( InstallEventReason = "Installation" ErrorOnInstallEventReason = "ErrInstallation" )
const ( DeinstallEventReason = "Deinstallation" ErrorDeinstallEventReason = "ErrDeinstallation" )
const ( SupportEventReason = "Support" ErrorOnSupportEventReason = "ErrSupport" )
const ( RequeueEventReason = "Requeue" ErrorOnRequeueEventReason = "ErrRequeue" )
const ( FailedNameValidationEventReason = "FailedNameValidation" FailedVolumeSizeParsingValidationEventReason = "FailedVolumeSizeParsingValidation" FailedVolumeSizeSIValidationEventReason = "FailedVolumeSizeSIValidation" )
const ( Install = operation("Install") Upgrade = operation("Upgrade") Delete = operation("Delete") Wait = operation("Wait") ExpandVolume = operation("ExpandVolume") ChangeAdditionalIngressAnnotations = operation("ChangeAdditionalIngressAnnotations") StartStopDogu = operation("StartStopDogu") ChangeSecurityContext = operation("ChangeSecurityContext") ChangeExportMode = operation("ChangeExportMode") ChangeAdditionalMounts = operation("ChangeAdditionalMounts") )
const SupportModeEnvVar = "SUPPORT_MODE"
Variables ¶
var NewManager = NewDoguManager
NewManager is an alias mainly used for testing the main package
Functions ¶
func NewDoguAdditionalIngressAnnotationsManager ¶
func NewDoguAdditionalIngressAnnotationsManager(client client.Client, eventRecorder record.EventRecorder) *doguAdditionalIngressAnnotationsManager
NewDoguAdditionalIngressAnnotationsManager creates a new instance of a manager to append ingress annotations to a dogu service.
func NewDoguAdditionalMountManager ¶ added in v3.8.0
func NewDoguAdditionalMountManager(deploymentInterface deploymentInterface, mgrSet *util.ManagerSet, doguInterface doguClient.DoguInterface) *doguAdditionalMountManager
func NewDoguDeleteManager ¶
func NewDoguDeleteManager( client client.Client, operatorConfig *config.OperatorConfig, mgrSet *util.ManagerSet, recorder record.EventRecorder, configRepos util.ConfigRepositories, ) *doguDeleteManager
NewDoguDeleteManager creates a new instance of doguDeleteManager.
func NewDoguExportManager ¶ added in v3.3.0
func NewDoguExportManager( doguClient doguClient.DoguInterface, podClient podInterface, deploymentClient deploymentInterface, resourceUpserter resource.ResourceUpserter, doguFetcher localDoguFetcher, eventRecorder record.EventRecorder, ) *doguExportManager
NewDoguExportManager creates a new doguExportManager
func NewDoguInstallManager ¶
func NewDoguInstallManager(client client.Client, mgrSet *util.ManagerSet, eventRecorder record.EventRecorder, configRepos util.ConfigRepositories) *doguInstallManager
NewDoguInstallManager creates a new instance of doguInstallManager.
func NewDoguReconciler ¶
func NewDoguReconciler(client client.Client, doguInterface doguClient.DoguInterface, doguManager CombinedDoguManager, eventRecorder record.EventRecorder, namespace string, doguFetcher localDoguFetcher) (*doguReconciler, error)
NewDoguReconciler creates a new reconciler instance for the dogu resource
func NewDoguRequeueHandler ¶
func NewDoguRequeueHandler(doguInterface doguClient.DoguInterface, recorder record.EventRecorder, namespace string) (*doguRequeueHandler, error)
NewDoguRequeueHandler creates a new dogu requeue handler.
func NewDoguSupportManager ¶
func NewDoguSupportManager(client client.Client, mgrSet *util.ManagerSet, eventRecorder record.EventRecorder) *doguSupportManager
NewDoguSupportManager creates a new instance of doguSupportManager.
func NewDoguUpgradeManager ¶
func NewDoguUpgradeManager(client client.Client, mgrSet *util.ManagerSet, eventRecorder record.EventRecorder) *doguUpgradeManager
NewDoguUpgradeManager creates a new instance of doguUpgradeManager which handles dogu upgrades.
func NewDoguVolumeManager ¶
func NewDoguVolumeManager(client client.Client, eventRecorder record.EventRecorder, doguInterface doguClient.DoguInterface) *doguVolumeManager
NewDoguVolumeManager creates a new instance of the doguVolumeManager.
Types ¶
type ClientSet ¶
type ClientSet interface { kubernetes.Interface }
type CombinedDoguManager ¶
type CombinedDoguManager interface {
// contains filtered or unexported methods
}
CombinedDoguManager abstracts the simple dogu operations in a k8s CES.
type DeploymentReconciler ¶
type DeploymentReconciler struct {
// contains filtered or unexported fields
}
DeploymentReconciler watches every Deployment object in the cluster and writes the state of dogus into their respective custom resources.
func NewDeploymentReconciler ¶
func NewDeploymentReconciler(k8sClientSet ClientSet, availabilityChecker *health.AvailabilityChecker, doguHealthStatusUpdater health.DoguHealthStatusUpdater, doguFetcher localDoguFetcher) *DeploymentReconciler
func (*DeploymentReconciler) Reconcile ¶
func (dr *DeploymentReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*DeploymentReconciler) SetupWithManager ¶
func (dr *DeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DoguManager ¶
type DoguManager struct {
// contains filtered or unexported fields
}
DoguManager is a central unit in the process of handling dogu custom resources The DoguManager creates, updates and deletes dogus
func NewDoguManager ¶
func NewDoguManager(client client.Client, ecosystemClient doguClient.EcoSystemV2Interface, operatorConfig *config.OperatorConfig, eventRecorder record.EventRecorder) (*DoguManager, error)
NewDoguManager creates a new instance of DoguManager
func (*DoguManager) AdditionalMountsChanged ¶ added in v3.8.0
func (*DoguManager) HandleSupportMode ¶
func (m *DoguManager) HandleSupportMode(ctx context.Context, doguResource *doguv2.Dogu) (bool, error)
HandleSupportMode handles the support flag in the dogu spec.
func (*DoguManager) SetDoguAdditionalIngressAnnotations ¶
func (m *DoguManager) SetDoguAdditionalIngressAnnotations(ctx context.Context, doguResource *doguv2.Dogu) error
SetDoguAdditionalIngressAnnotations edits the additional ingress annotations in the given dogu's service.
func (*DoguManager) SetDoguDataVolumeSize ¶
SetDoguDataVolumeSize sets the dataVolumeSize from the dogu resource to the data PVC from the dogu.
func (*DoguManager) StartStopDogu ¶ added in v3.7.0
StartStopDogu starts or stops the dogu.
func (*DoguManager) UpdateAdditionalMounts ¶ added in v3.8.0
func (*DoguManager) UpdateDeploymentWithSecurityContext ¶ added in v3.2.0
func (m *DoguManager) UpdateDeploymentWithSecurityContext(ctx context.Context, doguResource *doguv2.Dogu) error
UpdateDeploymentWithSecurityContext edits the securityContext of the deployment
func (*DoguManager) UpdateExportMode ¶ added in v3.3.0
UpdateExportMode activates/deactivates the export mode for the dogu
type DoguResourceGenerator ¶ added in v3.8.0
type DoguResourceGenerator interface { // CreateDoguDeployment creates a new instance of a deployment with a given dogu.json and dogu custom resource. CreateDoguDeployment(ctx context.Context, doguResource *v2.Dogu, dogu *cesappcore.Dogu) (*appsv1.Deployment, error) // CreateDoguService creates a new instance of a service with the given dogu custom resource and container image. // The container image is used to extract the exposed ports. The created service is rather meant for cluster-internal // apps and dogus (f. e. postgresql) which do not need external access. The given container image config provides // the service ports to the created service. CreateDoguService(doguResource *v2.Dogu, dogu *cesappcore.Dogu, imageConfig *imagev1.ConfigFile) (*coreV1.Service, error) // CreateDoguPVC creates a persistent volume claim with a 5Gi storage for the given dogu. CreateDoguPVC(doguResource *v2.Dogu) (*coreV1.PersistentVolumeClaim, error) // contains filtered or unexported methods }
DoguResourceGenerator handles resource generation for dogus.
type DoguRestartReconciler ¶
type DoguRestartReconciler struct {
// contains filtered or unexported fields
}
DoguRestartReconciler reconciles a DoguRestart object
func NewDoguRestartReconciler ¶
func NewDoguRestartReconciler(doguRestartInterface doguClient.DoguRestartInterface, doguInterface doguClient.DoguInterface, recorder record.EventRecorder, gc DoguRestartGarbageCollector) *DoguRestartReconciler
func (*DoguRestartReconciler) Reconcile ¶
func (r *DoguRestartReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile
func (*DoguRestartReconciler) SetupWithManager ¶
func (r *DoguRestartReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DoguSecurityContextManager ¶ added in v3.2.0
type DoguSecurityContextManager struct {
// contains filtered or unexported fields
}
func NewDoguSecurityContextManager ¶ added in v3.2.0
func NewDoguSecurityContextManager(mgrSet *util.ManagerSet, eventRecorder record.EventRecorder) *DoguSecurityContextManager
NewDoguSecurityContextManager creates a new *DoguSecurityContextManager.
func (DoguSecurityContextManager) UpdateDeploymentWithSecurityContext ¶ added in v3.2.0
func (d DoguSecurityContextManager) UpdateDeploymentWithSecurityContext(ctx context.Context, doguResource *doguv2.Dogu) error
UpdateDeploymentWithSecurityContext regenerates the security context of a dogu deployment.
type PvcReconciler ¶ added in v3.9.0
type PvcReconciler struct {
// contains filtered or unexported fields
}
PvcReconciler watches every pvc object with a dogu.name label in the cluster and sets the Min-Data-size condition for the corresponding dogu and the PVC request size if the status capacity is larger than the current request
func NewPvcReconciler ¶ added in v3.9.0
func NewPvcReconciler(client K8sClient, k8sClientSet ClientSet, ecoSystemClientSet ecosystemInterface) *PvcReconciler
func (*PvcReconciler) Reconcile ¶ added in v3.9.0
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*PvcReconciler) SetupWithManager ¶ added in v3.9.0
func (r *PvcReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the manager.
type RestartOperation ¶
type RestartOperation string
func RestartOperationFromRestartStatusPhase ¶
func RestartOperationFromRestartStatusPhase(phase doguv2.RestartStatusPhase) RestartOperation
Source Files
¶
- additionalImages.go
- deploymentController.go
- doguAdditionalMountManager.go
- doguDeleteManager.go
- doguExportManager.go
- doguIngressAnnotationsManager.go
- doguInstallManager.go
- doguSecurityContextManager.go
- doguStartStopManager.go
- doguSupportManager.go
- doguUpgradeManager.go
- doguVolumeManager.go
- dogu_controller.go
- dogu_manager.go
- dogu_requeue_handler.go
- dogurestart_controller.go
- interfaces.go
- pvcController.go
- restartInstruction.go
- upgradeabilityChecker.go