botanist

package
v0.0.0-...-1764fb8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 63 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultInterval is the default interval for retry operations.
	DefaultInterval = 5 * time.Second

	// Provider is the kubernetes provider label.
	Provider = "provider"
	// KubernetesProvider is the 'kubernetes' value of the Provider label.
	KubernetesProvider = "kubernetes"

	// KubeAggregatorAutoManaged is the label whether an APIService is automanaged by kube-aggregator.
	KubeAggregatorAutoManaged = autoregister.AutoRegisterManagedLabel

	// MetadataNameField ist the `metadata.name` field for a field selector.
	MetadataNameField = "metadata.name"
)
View Source
const (
	// DNSPurposeInternal is a constant for a DNS record used for the internal domain name.
	DNSPurposeInternal = "internal"
	// DNSPurposeExternal is a constant for a DNS record used for the external domain name.
	DNSPurposeExternal = "external"
)
View Source
const DNSPurposeIngress = "ingress"

DNSPurposeIngress is a constant for a DNS record used for the ingress domain name.

View Source
const InfrastructureDefaultTimeout = 10 * time.Minute

InfrastructureDefaultTimeout is the default timeout and defines how long Gardener should wait for a successful reconciliation of an infrastructure resource.

View Source
const WorkerDefaultTimeout = 30 * time.Minute

WorkerDefaultTimeout is the default timeout and defines how long Gardener should wait for a successful reconciliation of a worker resource.

Variables

View Source
var (
	// NotSystemComponent is a requirement that something doesn't have the GardenRole GardenRoleSystemComponent.
	NotSystemComponent = MustNewRequirement(common.GardenRole, selection.NotEquals, common.GardenRoleSystemComponent)
	// NotKubernetesProvider is a requirement that the Provider label of something is not KubernetesProvider.
	NotKubernetesProvider = MustNewRequirement(Provider, selection.NotEquals, KubernetesProvider)
	// NotKubeAggregatorAutoManaged is a requirement that something is not auto-managed by Kube-Aggregator.
	NotKubeAggregatorAutoManaged = MustNewRequirement(KubeAggregatorAutoManaged, selection.DoesNotExist)

	// NotSystemComponentSelector is a selector that excludes system components.
	NotSystemComponentSelector = labels.NewSelector().Add(NotSystemComponent)

	// NotSystemComponentListOptions are ListOptions that exclude system components.
	NotSystemComponentListOptions = client.ListOptions{
		LabelSelector: NotSystemComponentSelector,
	}

	// MutatingWebhookConfigurationDeleteSelector is the delete selector for MutatingWebhookConfigurations.
	MutatingWebhookConfigurationDeleteSelector = &NotSystemComponentListOptions
	// MutatingWebhookConfigurationCheckSelector is the check selector for MutatingWebhookConfigurations.
	MutatingWebhookConfigurationCheckSelector = MutatingWebhookConfigurationDeleteSelector

	// ValidatingWebhookConfigurationDeleteSelector is the delete selector for ValidatingWebhookConfigurations.
	ValidatingWebhookConfigurationDeleteSelector = &NotSystemComponentListOptions
	// ValidatingWebhookConfigurationCheckSelector is the check selector for ValidatingWebhookConfigurations.
	ValidatingWebhookConfigurationCheckSelector = ValidatingWebhookConfigurationDeleteSelector

	// CustomResourceDefinitionDeleteSelector is the delete selector for CustomResources.
	CustomResourceDefinitionDeleteSelector = &NotSystemComponentListOptions
	// CustomResourceDefinitionCheckSelector is the check selector for CustomResources.
	CustomResourceDefinitionCheckSelector = CustomResourceDefinitionDeleteSelector

	// DaemonSetDeleteSelector is the delete selector for DaemonSets.
	DaemonSetDeleteSelector = &NotSystemComponentListOptions
	// DaemonSetCheckSelector is the check selector for DaemonSets.
	DaemonSetCheckSelector = DaemonSetDeleteSelector

	// DeploymentDeleteSelector is the delete selector for Deployments.
	DeploymentDeleteSelector = &NotSystemComponentListOptions
	// DeploymentCheckSelector is the check selector for Deployments.
	DeploymentCheckSelector = DeploymentDeleteSelector

	// StatefulSetDeleteSelector is the delete selector for StatefulSets.
	StatefulSetDeleteSelector = &NotSystemComponentListOptions
	// StatefulSetCheckSelector is the check selector for StatefulSets.
	StatefulSetCheckSelector = StatefulSetDeleteSelector

	// ServiceDeleteSelector is the delete selector for Services.
	ServiceDeleteSelector = &client.ListOptions{
		LabelSelector: labels.NewSelector().Add(NotKubernetesProvider, NotSystemComponent),
	}
	// ServiceCheckSelector is the check selector for Services.
	ServiceCheckSelector = ServiceDeleteSelector

	// NamespaceDeleteSelector is the delete selector for Namespaces.
	NamespaceDeleteSelector = &client.ListOptions{
		LabelSelector: NotSystemComponentSelector,
		FieldSelector: fields.AndSelectors(
			fields.OneTermNotEqualSelector(MetadataNameField, metav1.NamespacePublic),
			fields.OneTermNotEqualSelector(MetadataNameField, metav1.NamespaceSystem),
			fields.OneTermNotEqualSelector(MetadataNameField, metav1.NamespaceDefault),
			fields.OneTermNotEqualSelector(MetadataNameField, corev1.NamespaceNodeLease),
		),
	}
	// NamespaceCheckSelector is the check selector for Namespaces.
	NamespaceCheckSelector = NamespaceDeleteSelector

	// APIServiceDeleteSelector is the delete selector for APIServices.
	APIServiceDeleteSelector = &client.ListOptions{
		LabelSelector: labels.NewSelector().Add(NotSystemComponent, NotKubeAggregatorAutoManaged),
	}
	// APIServiceCheckSelector is the check selector for APIServices.
	APIServiceCheckSelector = APIServiceDeleteSelector

	// CronJobDeleteSelector is the delete selector for CronJobs.
	CronJobDeleteSelector = &NotSystemComponentListOptions
	// CronJobCheckSelector is the check selector for CronJobs.
	CronJobCheckSelector = CronJobDeleteSelector

	// IngressDeleteSelector is the delete selector for Ingresses.
	IngressDeleteSelector = &NotSystemComponentListOptions
	// IngressCheckSelector is the check selector for Ingresses.
	IngressCheckSelector = IngressDeleteSelector

	// JobDeleteSelector is the delete selector for Jobs.
	JobDeleteSelector = &NotSystemComponentListOptions
	// JobCheckSelector is the check selector for Jobs.
	JobCheckSelector = JobDeleteSelector

	// PodDeleteSelector is the delete selector for Pods.
	PodDeleteSelector = &NotSystemComponentListOptions
	// PodCheckSelector is the check selector for Pods.
	PodCheckSelector = PodDeleteSelector

	// ReplicaSetDeleteSelector is the delete selector for ReplicaSets.
	ReplicaSetDeleteSelector = &NotSystemComponentListOptions
	// ReplicaSetCheckSelector is the check selector for ReplicaSets.
	ReplicaSetCheckSelector = ReplicaSetDeleteSelector

	// ReplicationControllerDeleteSelector is the delete selector for ReplicationControllers.
	ReplicationControllerDeleteSelector = &NotSystemComponentListOptions
	// ReplicationControllerCheckSelector is the check selector for ReplicationControllers.
	ReplicationControllerCheckSelector = ReplicationControllerDeleteSelector

	// PersistentVolumeClaimDeleteSelector is the delete selector for PersistentVolumeClaims.
	PersistentVolumeClaimDeleteSelector = &NotSystemComponentListOptions
	// PersistentVolumeClaimCheckSelector is the check selector for PersistentVolumeClaims.
	PersistentVolumeClaimCheckSelector = PersistentVolumeClaimDeleteSelector
)
View Source
var Now = time.Now

Now determines the current time.

Functions

func AreObjectsRemaining

func AreObjectsRemaining(err error) bool

AreObjectsRemaining checks whether the given error is an 'objects remaining error'.

func CheckObjectsRemaining

func CheckObjectsRemaining(list runtime.Object) error

CheckObjectsRemaining checks if the given list is empty.

Iff it is not, returns a `NewObjectsRemaining` error with the remaining objects.

func CheckObjectsRemainingMatching

func CheckObjectsRemainingMatching(
	ctx context.Context,
	c client.Client,
	opts *client.ListOptions,
	list runtime.Object,
) error

CheckObjectsRemainingMatching calls the client and checks if there are objects remaining matching the given opts.

func CleanMatching

func CleanMatching(
	ctx context.Context,
	c client.Client,
	deleteOpts,
	checkOpts *client.ListOptions,
	list runtime.Object,
	finalize bool,
	opts ...client.DeleteOptionFunc,
) error

CleanMatching deletes all objects matching `deleteOpts`, then it checks if there are no objects left matching `checkOpts`.

func DeleteAll

func DeleteAll(ctx context.Context, c client.Client, list runtime.Object, opts ...client.DeleteOptionFunc) error

DeleteAll calls delete for all objects in the given list.

Not found errors are being ignored.

func DeleteMatching

func DeleteMatching(
	ctx context.Context,
	c client.Client,
	selector *client.ListOptions,
	list runtime.Object,
	finalize bool,
	opts ...client.DeleteOptionFunc,
) error

DeleteMatching issues DELETE calls to all remote objects that match the given selector.

If `finalize` is set, this also removes all finalizers from the matching objects before deleting them.

func FinalizeAll

func FinalizeAll(ctx context.Context, c client.Client, list runtime.Object) error

FinalizeAll iterates over the given list and removes the finalizers the individual objects, if any.

func MustNewRequirement

func MustNewRequirement(key string, op selection.Operator, vals ...string) labels.Requirement

MustNewRequirement creates a labels.Requirement with the given values and panics if there is an error.

func NewObjectsRemaining

func NewObjectsRemaining(remaining []runtime.Object) error

NewObjectsRemaining returns a new error with the remaining objects.

func RemainingObjects

func RemainingObjects(err error) []runtime.Object

RemainingObjects retrieves the remaining objects of an `AreObjectsRemaining` error.

If the error does not match `AreObjectsRemaining`, this returns nil.

func RetryCleanMatchingUntil

func RetryCleanMatchingUntil(
	ctx context.Context,
	interval time.Duration,
	c client.Client,
	deleteOpts,
	checkOpts *client.ListOptions,
	list runtime.Object,
	finalize bool,
	opts ...client.DeleteOptionFunc,
) error

RetryCleanMatchingUntil repeatedly tries to `CleanMatching` objects.

Types

type Botanist

type Botanist struct {
	*operation.Operation
	DefaultDomainSecret *corev1.Secret
	// contains filtered or unexported fields
}

Botanist is a struct which has methods that perform cloud-independent operations for a Shoot cluster.

func New

func New(o *operation.Operation) (*Botanist, error)

New takes an operation object <o> and creates a new Botanist object. It checks whether the given Shoot DNS domain is covered by a default domain, and if so, it sets the <DefaultDomainSecret> attribute on the Botanist object.

func (*Botanist) CleanExtendedAPIs

func (b *Botanist) CleanExtendedAPIs(ctx context.Context) error

CleanExtendedAPIs removes API extensions like CRDs and API services from the Shoot cluster.

func (*Botanist) CleanKubernetesResources

func (b *Botanist) CleanKubernetesResources(ctx context.Context) error

CleanKubernetesResources deletes all the Kubernetes resources in the Shoot cluster other than those stored in the exceptions map. It will check whether all the Kubernetes resources in the Shoot cluster other than those stored in the exceptions map have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.

func (*Botanist) CleanWebhooks

func (b *Botanist) CleanWebhooks(ctx context.Context) error

CleanWebhooks deletes all Webhooks in the Shoot cluster that are not being managed by the addon manager.

func (*Botanist) DeleteBackupInfrastructure

func (b *Botanist) DeleteBackupInfrastructure() error

DeleteBackupInfrastructure deletes the sets deletionTimestamp on the backupInfrastructure resource in the Garden namespace which is responsible for actual deletion of cloud resource for Shoot's backup infrastructure.

func (*Botanist) DeleteBackupNamespace

func (b *Botanist) DeleteBackupNamespace() error

DeleteBackupNamespace deletes the namespace in the Seed cluster which holds the backup infrastructure state. The built-in garbage collection in Kubernetes will automatically delete all resources which belong to this namespace.

func (*Botanist) DeleteClusterAutoscaler

func (b *Botanist) DeleteClusterAutoscaler() error

DeleteClusterAutoscaler deletes the cluster-autoscaler deployment in the Seed cluster which holds the Shoot's control plane.

func (*Botanist) DeleteDeprecatedCloudMetadataServiceNetworkPolicy

func (b *Botanist) DeleteDeprecatedCloudMetadataServiceNetworkPolicy(ctx context.Context) error

DeleteDeprecatedCloudMetadataServiceNetworkPolicy deletes old DEPRECATED Shoot network policy that allows access to the meta-data service only from the cloud-controller-manager and the kube-controller-manager DEPRECATED. TODO: Remove this after several releases.

func (*Botanist) DeleteExtensionResources

func (b *Botanist) DeleteExtensionResources(ctx context.Context) error

DeleteExtensionResources deletes all extension resources from the Shoot namespace in the Seed.

func (*Botanist) DeleteGardenSecrets

func (b *Botanist) DeleteGardenSecrets() error

DeleteGardenSecrets deletes the Shoot-specific secrets from the project namespace in the Garden cluster. TODO: https://github.com/gardener/gardener/pull/353: This can be removed in a future version as we are now using owner references for the Garden secrets (also remove the actual invocation of the function in the deletion flow of a Shoot).

func (*Botanist) DeleteKubeAPIServer

func (b *Botanist) DeleteKubeAPIServer() error

DeleteKubeAPIServer deletes the kube-apiserver deployment in the Seed cluster which holds the Shoot's control plane.

func (*Botanist) DeleteKubeAddonManager

func (b *Botanist) DeleteKubeAddonManager() error

DeleteKubeAddonManager deletes the kube-addon-manager deployment in the Seed cluster which holds the Shoot's control plane. It needs to be deleted before trying to remove any resources in the Shoot cluster, otherwise it will automatically recreate them and block the infrastructure deletion.

func (*Botanist) DeleteNamespace

func (b *Botanist) DeleteNamespace() error

DeleteNamespace deletes the namespace in the Seed cluster which holds the control plane components. The built-in garbage collection in Kubernetes will automatically delete all resources which belong to this namespace. This comprises volumes and load balancers as well.

func (*Botanist) DeleteOrphanEtcdMainPVC

func (b *Botanist) DeleteOrphanEtcdMainPVC(ctx context.Context) error

DeleteOrphanEtcdMainPVC delete the orphan PVC associated with old etcd-main statefulsets as a result of migration in Release 0.22.0 (https://github.com/gardener/gardener/releases/tag/0.22.0).

func (*Botanist) DeleteSeedMonitoring

func (b *Botanist) DeleteSeedMonitoring() error

DeleteSeedMonitoring will delete the monitoring stack from the Seed cluster to avoid phantom alerts during the deletion process. More precisely, the Alertmanager and Prometheus StatefulSets will be deleted.

func (*Botanist) DeployBackupInfrastructure

func (b *Botanist) DeployBackupInfrastructure(ctx context.Context) error

DeployBackupInfrastructure creates a BackupInfrastructure resource into the project namespace of shoot on garden cluster. BackupInfrastructure controller acting on resource will actually create required cloud resources and updates the status.

func (*Botanist) DeployBackupNamespace

func (b *Botanist) DeployBackupNamespace() error

DeployBackupNamespace creates a namespace in the Seed cluster from info in shoot object, which is used to deploy all the backup infrastructure realted resources for shoot cluster. Moreover, the terraform configuration and all the secrets will be stored as ConfigMaps/Secrets.

func (*Botanist) DeployCloudProviderSecret

func (b *Botanist) DeployCloudProviderSecret() error

DeployCloudProviderSecret creates or updates the cloud provider secret in the Shoot namespace in the Seed cluster.

func (*Botanist) DeployClusterAutoscaler

func (b *Botanist) DeployClusterAutoscaler() error

DeployClusterAutoscaler deploys the cluster-autoscaler into the Shoot namespace in the Seed cluster. It is responsible for automatically scaling the worker pools of the Shoot.

func (*Botanist) DeployDependencyWatchdog

func (b *Botanist) DeployDependencyWatchdog(ctx context.Context) error

DeployDependencyWatchdog deploys the dependency watchdog to the Shoot namespace in the Seed.

func (*Botanist) DeployExtensionResources

func (b *Botanist) DeployExtensionResources(ctx context.Context) error

DeployExtensionResources creates the `Extension` extension resource in the shoot namespace in the seed cluster. Gardener waits until an external controller did reconcile the cluster successfully.

func (*Botanist) DeployExternalDomainDNSRecord

func (b *Botanist) DeployExternalDomainDNSRecord(ctx context.Context) error

DeployExternalDomainDNSRecord deploys the DNS record for the external cluster domain.

func (*Botanist) DeployInfrastructure

func (b *Botanist) DeployInfrastructure(ctx context.Context) error

DeployInfrastructure creates the `Infrastructure` extension resource in the shoot namespace in the seed cluster. Gardener waits until an external controller did reconcile the cluster successfully.

func (*Botanist) DeployInternalDomainDNSRecord

func (b *Botanist) DeployInternalDomainDNSRecord(ctx context.Context) error

DeployInternalDomainDNSRecord deploys the DNS record for the internal cluster domain.

func (*Botanist) DeployNamespace

func (b *Botanist) DeployNamespace() error

DeployNamespace creates a namespace in the Seed cluster which is used to deploy all the control plane components for the Shoot cluster. Moreover, the cloud provider configuration and all the secrets will be stored as ConfigMaps/Secrets.

func (*Botanist) DeploySecrets

func (b *Botanist) DeploySecrets() error

DeploySecrets creates a CA certificate for the Shoot cluster and uses it to sign the server certificate used by the kube-apiserver, and all client certificates used for communcation. It also creates RSA key pairs for SSH connections to the nodes/VMs and for the VPN tunnel. Moreover, basic authentication credentials are computed which will be used to secure the Ingress resources and the kube-apiserver itself. Server certificates for the exposed monitoring endpoints (via Ingress) are generated as well.

func (*Botanist) DeploySeedLogging

func (b *Botanist) DeploySeedLogging() error

DeploySeedLogging will install the Helm release "seed-bootstrap/charts/elastic-kibana-curator" in the Seed clusters.

func (*Botanist) DeploySeedMonitoring

func (b *Botanist) DeploySeedMonitoring() error

DeploySeedMonitoring will install the Helm release "seed-monitoring" in the Seed clusters. It comprises components to monitor the Shoot cluster whose control plane runs in the Seed cluster.

func (*Botanist) DeployWorker

func (b *Botanist) DeployWorker(ctx context.Context) error

DeployWorker creates the `Worker` extension resource in the shoot namespace in the seed cluster. Gardener waits until an external controller did reconcile the resource successfully.

func (*Botanist) DestroyExternalDomainDNSRecord

func (b *Botanist) DestroyExternalDomainDNSRecord(ctx context.Context) error

DestroyExternalDomainDNSRecord destroys the DNS record for the external cluster domain.

func (*Botanist) DestroyInfrastructure

func (b *Botanist) DestroyInfrastructure(ctx context.Context) error

DestroyInfrastructure deletes the `Infrastructure` extension resource in the shoot namespace in the seed cluster, and it waits for a maximum of 10m until it is deleted.

func (*Botanist) DestroyIngressDNSRecord

func (b *Botanist) DestroyIngressDNSRecord(ctx context.Context) error

DestroyIngressDNSRecord destroys the nginx-ingress resources created by Terraform.

func (*Botanist) DestroyInternalDomainDNSRecord

func (b *Botanist) DestroyInternalDomainDNSRecord(ctx context.Context) error

DestroyInternalDomainDNSRecord destroys the DNS record for the internal cluster domain.

func (*Botanist) DestroyWorker

func (b *Botanist) DestroyWorker(ctx context.Context) error

DestroyWorker deletes the `Worker` extension resource in the shoot namespace in the seed cluster, and it waits for a maximum of 30m until it is deleted.

func (*Botanist) EnsureIngressDNSRecord

func (b *Botanist) EnsureIngressDNSRecord(ctx context.Context) error

EnsureIngressDNSRecord creates the respective wildcard DNS record for the nginx-ingress-controller.

func (*Botanist) GenerateKubeLegoConfig

func (b *Botanist) GenerateKubeLegoConfig() (map[string]interface{}, error)

GenerateKubeLegoConfig generates the values which are required to render the chart of kube-lego properly.

func (*Botanist) GenerateKubernetesDashboardConfig

func (b *Botanist) GenerateKubernetesDashboardConfig() (map[string]interface{}, error)

GenerateKubernetesDashboardConfig generates the values which are required to render the chart of the kubernetes-dashboard properly.

func (*Botanist) HealthChecks

func (b *Botanist) HealthChecks(initializeShootClients func() error, thresholdMappings map[gardencorev1alpha1.ConditionType]time.Duration, apiserverAvailability, controlPlane, nodes, systemComponents gardencorev1alpha1.Condition) (gardencorev1alpha1.Condition, gardencorev1alpha1.Condition, gardencorev1alpha1.Condition, gardencorev1alpha1.Condition)

HealthChecks conducts the health checks on all the given conditions.

func (*Botanist) HibernateControlPlane

func (b *Botanist) HibernateControlPlane(ctx context.Context) error

HibernateControlPlane hibernates the entire control plane if the shoot shall be hibernated.

func (*Botanist) MonitoringHealthChecks

func (b *Botanist) MonitoringHealthChecks(checker *HealthChecker, inactiveAlerts gardencorev1alpha1.Condition) gardencorev1alpha1.Condition

MonitoringHealthChecks performs the monitoring related health checks.

func (*Botanist) PerformGarbageCollectionSeed

func (b *Botanist) PerformGarbageCollectionSeed() error

PerformGarbageCollectionSeed performs garbage collection in the Shoot namespace in the Seed cluster, i.e., it deletes old machine sets which have a desired=actual=0 replica count.

func (*Botanist) PerformGarbageCollectionShoot

func (b *Botanist) PerformGarbageCollectionShoot() error

PerformGarbageCollectionShoot performs garbage collection in the kube-system namespace in the Shoot cluster, i.e., it deletes evicted pods (mitigation for https://github.com/kubernetes/kubernetes/issues/55051).

func (*Botanist) RefreshCloudControllerManagerChecksums

func (b *Botanist) RefreshCloudControllerManagerChecksums() error

RefreshCloudControllerManagerChecksums updates the cloud provider checksum in the cloud-controller-manager pod spec template.

func (*Botanist) RefreshKubeControllerManagerChecksums

func (b *Botanist) RefreshKubeControllerManagerChecksums() error

RefreshKubeControllerManagerChecksums updates the cloud provider checksum in the kube-controller-manager pod spec template.

func (*Botanist) RegisterAsSeed

func (b *Botanist) RegisterAsSeed(protected, visible *bool, minimumVolumeSize *string, blockCIDRs []gardencorev1alpha1.CIDR) error

RegisterAsSeed registers a Shoot cluster as a Seed in the Garden cluster.

func (*Botanist) RequiredExtensionsExist

func (b *Botanist) RequiredExtensionsExist() error

RequiredExtensionsExist checks whether all required extensions needed for an shoot operation exist.

func (*Botanist) SyncShootCredentialsToGarden

func (b *Botanist) SyncShootCredentialsToGarden() error

SyncShootCredentialsToGarden copies the kubeconfig generated for the user, the SSH keypair to the project namespace in the Garden cluster and the monitoring credentials for the user-facing monitoring stack are also copied.

func (*Botanist) UnregisterAsSeed

func (b *Botanist) UnregisterAsSeed() error

UnregisterAsSeed unregisters a Shoot cluster as a Seed in the Garden cluster.

func (*Botanist) WaitForControllersToBeActive

func (b *Botanist) WaitForControllersToBeActive() error

WaitForControllersToBeActive checks whether the kube-controller-manager and the cloud-controller-manager have recently written to the Endpoint object holding the leader information. If yes, they are active.

func (*Botanist) WaitUntilBackupInfrastructureReconciled

func (b *Botanist) WaitUntilBackupInfrastructureReconciled(ctx context.Context) error

WaitUntilBackupInfrastructureReconciled waits until the backup infrastructure within the garden cluster has been reconciled.

func (*Botanist) WaitUntilBackupNamespaceDeleted

func (b *Botanist) WaitUntilBackupNamespaceDeleted(ctx context.Context) error

WaitUntilBackupNamespaceDeleted waits until the namespace for the backup of Shoot cluster within the Seed cluster is deleted.

func (*Botanist) WaitUntilClusterAutoscalerDeleted

func (b *Botanist) WaitUntilClusterAutoscalerDeleted(ctx context.Context) error

WaitUntilClusterAutoscalerDeleted waits until the cluster-autoscaler deployment within the Seed cluster has been deleted.

func (*Botanist) WaitUntilEtcdReady

func (b *Botanist) WaitUntilEtcdReady(ctx context.Context) error

WaitUntilEtcdReady waits until the etcd statefulsets indicate readiness in their statuses.

func (*Botanist) WaitUntilEtcdStatefulsetDeleted

func (b *Botanist) WaitUntilEtcdStatefulsetDeleted(ctx context.Context, role string) error

WaitUntilEtcdStatefulsetDeleted waits until the etcd statefulsets get deleted.

func (*Botanist) WaitUntilExtensionResourcesDeleted

func (b *Botanist) WaitUntilExtensionResourcesDeleted(ctx context.Context) error

WaitUntilExtensionResourcesDeleted waits until all extension resources are gone or the context is cancelled.

func (*Botanist) WaitUntilExtensionResourcesReady

func (b *Botanist) WaitUntilExtensionResourcesReady(ctx context.Context) error

WaitUntilExtensionResourcesReady waits until all extension resources report `Succeeded` in their last operation state. The state must be reported before the passed context is cancelled or an extension's timeout has been reached. As soon as one timeout has been overstepped the function returns an error, further waits on extensions will be aborted.

func (*Botanist) WaitUntilInfrastructureDeleted

func (b *Botanist) WaitUntilInfrastructureDeleted(ctx context.Context) error

WaitUntilInfrastructureDeleted waits until the infrastructure resource has been deleted.

func (*Botanist) WaitUntilInfrastructureReady

func (b *Botanist) WaitUntilInfrastructureReady(ctx context.Context) error

WaitUntilInfrastructureReady waits until the infrastructure resource has been reconciled successfully.

func (*Botanist) WaitUntilKubeAPIServerReady

func (b *Botanist) WaitUntilKubeAPIServerReady(ctx context.Context) error

WaitUntilKubeAPIServerReady waits until the kube-apiserver pod(s) indicate readiness in their statuses.

func (*Botanist) WaitUntilKubeAPIServerServiceIsReady

func (b *Botanist) WaitUntilKubeAPIServerServiceIsReady(ctx context.Context) error

WaitUntilKubeAPIServerServiceIsReady waits until the external load balancer of the kube-apiserver has been created (i.e., its ingress information has been updated in the service status).

func (*Botanist) WaitUntilKubeAddonManagerDeleted

func (b *Botanist) WaitUntilKubeAddonManagerDeleted(ctx context.Context) error

WaitUntilKubeAddonManagerDeleted waits until the kube-addon-manager deployment within the Seed cluster has been deleted.

func (*Botanist) WaitUntilNodesDeleted

func (b *Botanist) WaitUntilNodesDeleted(ctx context.Context) error

WaitUntilNodesDeleted waits until no nodes exist in the shoot cluster anymore.

func (*Botanist) WaitUntilSeedNamespaceDeleted

func (b *Botanist) WaitUntilSeedNamespaceDeleted(ctx context.Context) error

WaitUntilSeedNamespaceDeleted waits until the namespace of the Shoot cluster within the Seed cluster is deleted.

func (*Botanist) WaitUntilVPNConnectionExists

func (b *Botanist) WaitUntilVPNConnectionExists(ctx context.Context) error

WaitUntilVPNConnectionExists waits until a port forward connection to the vpn-shoot pod in the kube-system namespace of the Shoot cluster can be established.

func (*Botanist) WaitUntilWorkerDeleted

func (b *Botanist) WaitUntilWorkerDeleted(ctx context.Context) error

WaitUntilWorkerDeleted waits until the worker extension resource has been deleted.

func (*Botanist) WaitUntilWorkerReady

func (b *Botanist) WaitUntilWorkerReady(ctx context.Context) error

WaitUntilWorkerReady waits until the worker extension resource has been successfully reconciled.

func (*Botanist) WakeUpControlPlane

func (b *Botanist) WakeUpControlPlane(ctx context.Context) error

WakeUpControlPlane scales the replicas to 1 for the following deployments which are needed in case of shoot deletion: * etcd-events * etcd-main * kube-apiserver * cloud-controller-manager * kube-controller-manager * csi-controllers

type HealthChecker

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

HealthChecker contains the condition thresholds.

func NewHealthChecker

func NewHealthChecker(conditionThresholds map[gardencorev1alpha1.ConditionType]time.Duration) *HealthChecker

NewHealthChecker creates a new health checker.

func (*HealthChecker) CheckClusterNodes

func (b *HealthChecker) CheckClusterNodes(
	namespace string,
	condition gardencorev1alpha1.Condition,
	nodeLister kutil.NodeLister,
	machineDeploymentLister kutil.MachineDeploymentLister,
) (*gardencorev1alpha1.Condition, error)

CheckClusterNodes checks whether cluster nodes in the given listers are complete and healthy.

func (*HealthChecker) CheckControlPlane

func (b *HealthChecker) CheckControlPlane(
	shoot *gardenv1beta1.Shoot,
	namespace string,
	seedCloudProvider gardenv1beta1.CloudProvider,
	condition gardencorev1alpha1.Condition,
	deploymentLister kutil.DeploymentLister,
	statefulSetLister kutil.StatefulSetLister,
	machineDeploymentLister kutil.MachineDeploymentLister,
) (*gardencorev1alpha1.Condition, error)

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

func (*HealthChecker) CheckLoggingControlPlane

func (b *HealthChecker) CheckLoggingControlPlane(
	namespace string,
	condition gardencorev1alpha1.Condition,
	deploymentLister kutil.DeploymentLister,
	statefulSetLister kutil.StatefulSetLister,
) (*gardencorev1alpha1.Condition, error)

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

func (*HealthChecker) CheckMonitoringControlPlane

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

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

func (*HealthChecker) CheckMonitoringSystemComponents

func (b *HealthChecker) CheckMonitoringSystemComponents(
	namespace string,
	condition gardencorev1alpha1.Condition,
	daemonSetLister kutil.DaemonSetLister,
) (*gardencorev1alpha1.Condition, error)

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

func (*HealthChecker) CheckOptionalAddonsSystemComponents

func (b *HealthChecker) CheckOptionalAddonsSystemComponents(
	namespace string,
	condition gardencorev1alpha1.Condition,
	deploymentLister kutil.DeploymentLister,
	daemonSetLister kutil.DaemonSetLister,
) (*gardencorev1alpha1.Condition, error)

CheckOptionalAddonsSystemComponents checks whether the addons in the given listers are healthy.

func (*HealthChecker) CheckSystemComponents

func (b *HealthChecker) CheckSystemComponents(
	namespace string,
	condition gardencorev1alpha1.Condition,
	deploymentLister kutil.DeploymentLister,
	daemonSetLister kutil.DaemonSetLister,
) (*gardencorev1alpha1.Condition, error)

CheckSystemComponents checks whether the system components in the given listers are complete and healthy.

func (*HealthChecker) FailedCondition

func (b *HealthChecker) FailedCondition(condition gardencorev1alpha1.Condition, reason, message string) gardencorev1alpha1.Condition

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

Jump to

Keyboard shortcuts

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