care

package
v1.7.1-0...-23dd39d Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const GardenerDeletionGracePeriod = 5 * time.Minute

GardenerDeletionGracePeriod is the default grace period for Gardener's force deletion methods.

View Source
const WebhookMaximumTimeoutSecondsNotProblematic = 15

WebhookMaximumTimeoutSecondsNotProblematic is the maximum timeout in seconds a webhooks on critical resources can have in order to not be considered as a problematic webhook by the constraints checks. Any webhook on critical resources with a larger timeout is considered to be problematic.

Variables

View Source
var Now = time.Now

Now determines the current time.

Functions

func IsProblematicWebhook

func IsProblematicWebhook(
	failurePolicy *admissionregistrationv1beta1.FailurePolicyType,
	objSelector *metav1.LabelSelector,
	nsSelector *metav1.LabelSelector,
	rules []admissionregistrationv1beta1.RuleWithOperations,
	timeoutSeconds *int32,
) bool

IsProblematicWebhook checks if a single webhook of the Shoot Cluster is problematic. Problematic webhooks are webhooks with rules for CREATE/UPDATE/* pods or nodes and failurePolicy=Fail/nil. If the Shoot contains such a webhook, we can never wake up this shoot cluster again as new nodes cannot get created/ready, or our system component pods cannot get created/ready (because the webhook's backing pod is not yet running).

func NewConditionOrError

func NewConditionOrError(oldCondition gardencorev1beta1.Condition, newCondition *gardencorev1beta1.Condition, err error) gardencorev1beta1.Condition

NewConditionOrError returns the given new condition or returns an unknown error condition if an error occurred or `newCondition` is nil.

func PardonConditions

PardonConditions pardons the given condition if the Shoot is either in create (except successful create) or delete state.

Types

type Constraint

type Constraint struct {
	// contains filtered or unexported fields
}

Constraint contains required information for shoot constraint checks.

func NewConstraint

func NewConstraint(op *operation.Operation, shootClientInit ShootClientInit) *Constraint

NewConstraint returns a new constraint instance.

func (*Constraint) Check

ConstraintsChecks conducts the constraints checks on all the given constraints.

func (*Constraint) CheckForProblematicWebhooks

func (c *Constraint) CheckForProblematicWebhooks(ctx context.Context) (gardencorev1beta1.ConditionStatus, string, string, error)

CheckForProblematicWebhooks checks the Shoot for problematic webhooks which could prevent shoot worker nodes from joining the cluster.

type ExtensionCondition

type ExtensionCondition struct {
	Condition          gardencorev1beta1.Condition
	ExtensionType      string
	ExtensionName      string
	ExtensionNamespace string
}

ExtensionCondition contains information about the extension type, name, namespace and the respective condition object.

type GarbageCollection

type GarbageCollection struct {
	// contains filtered or unexported fields
}

GarbageCollection contains required information for shoot and seed garbage collection.

func NewGarbageCollection

func NewGarbageCollection(op *operation.Operation, shootClientInit ShootClientInit) *GarbageCollection

NewGarbageCollection creates a new garbage collection instance.

func (*GarbageCollection) Collect

func (g *GarbageCollection) Collect(ctx context.Context)

Collect cleans the Seed and the Shoot cluster from no longer required objects. It receives a botanist object <botanist> which stores the Shoot object.

type Health

type Health struct {
	// contains filtered or unexported fields
}

Health contains information needed to execute shoot health checks.

func NewHealth

func NewHealth(op *operation.Operation, shootClientInit ShootClientInit) *Health

NewHealth creates a new Health instance with the given parameters.

func (*Health) Check

func (h *Health) Check(
	ctx context.Context,
	thresholdMappings map[gardencorev1beta1.ConditionType]time.Duration,
	healthCheckOutdatedThreshold *metav1.Duration,
	conditions []gardencorev1beta1.Condition,
) []gardencorev1beta1.Condition

Check conducts the health checks on all the given conditions.

type HealthChecker

type HealthChecker struct {
	// contains filtered or unexported fields
}

HealthChecker contains the condition thresholds.

func NewHealthChecker

func NewHealthChecker(conditionThresholds map[gardencorev1beta1.ConditionType]time.Duration, healthCheckOutdatedThreshold *metav1.Duration, lastOperation *gardencorev1beta1.LastOperation, kubernetesVersion *semver.Version) *HealthChecker

NewHealthChecker creates a new health checker.

func (*HealthChecker) CheckClusterNodes

func (b *HealthChecker) CheckClusterNodes(
	ctx context.Context,
	shootClient client.Client,
	workers []gardencorev1beta1.Worker,
	condition gardencorev1beta1.Condition,
) (
	*gardencorev1beta1.Condition,
	error,
)

CheckClusterNodes checks whether cluster nodes in the given listers are healthy and within the desired range. Additional checks are executed in the provider extension

func (*HealthChecker) CheckControlPlane

func (b *HealthChecker) CheckControlPlane(
	shoot *gardencorev1beta1.Shoot,
	namespace string,
	condition gardencorev1beta1.Condition,
	deploymentLister kutil.DeploymentLister,
	etcdLister kutil.EtcdLister,
	workerLister kutil.WorkerLister,
) (*gardencorev1beta1.Condition, error)

CheckControlPlane checks whether the control plane components in the given listers are complete and healthy.

func (*HealthChecker) CheckExtensionCondition

func (b *HealthChecker) CheckExtensionCondition(condition gardencorev1beta1.Condition, extensionsConditions []ExtensionCondition) *gardencorev1beta1.Condition

CheckExtensionCondition checks whether the conditions provided by extensions are healthy.

func (*HealthChecker) CheckLoggingControlPlane

func (b *HealthChecker) CheckLoggingControlPlane(
	namespace string,
	isTestingShoot bool,
	condition gardencorev1beta1.Condition,
	statefulSetLister kutil.StatefulSetLister,
) (*gardencorev1beta1.Condition, error)

CheckLoggingControlPlane checks whether the logging components in the given listers are complete and healthy.

func (*HealthChecker) CheckManagedResource

CheckManagedResource checks the conditions of the given managed resource and reflects the state in the returned condition.

func (*HealthChecker) CheckMonitoringControlPlane

func (b *HealthChecker) CheckMonitoringControlPlane(
	namespace string,
	isTestingShoot bool,
	wantsAlertmanager bool,
	condition gardencorev1beta1.Condition,
	deploymentLister kutil.DeploymentLister,
	statefulSetLister kutil.StatefulSetLister,
) (*gardencorev1beta1.Condition, error)

CheckMonitoringControlPlane checks whether the monitoring in the given listers are complete and healthy.

func (*HealthChecker) FailedCondition

func (b *HealthChecker) FailedCondition(condition gardencorev1beta1.Condition, reason, message string, codes ...gardencorev1beta1.ErrorCode) gardencorev1beta1.Condition

FailedCondition returns a progressing or false condition depending on the progressing threshold.

type ShootClientInit

type ShootClientInit func() (kubernetes.Interface, bool, error)

Jump to

Keyboard shortcuts

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