shoot

package
v1.46.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const TechnicalIDPrefix = "shoot--"

TechnicalIDPrefix is a prefix used for a shoot's technical id.

Variables

This section is empty.

Functions

func ComputeRequiredExtensions added in v1.2.0

func ComputeRequiredExtensions(shoot *gardencorev1beta1.Shoot, seed *gardencorev1beta1.Seed, controllerRegistrationList *gardencorev1beta1.ControllerRegistrationList, internalDomain, externalDomain *garden.Domain) sets.String

ComputeRequiredExtensions compute the extension kind/type combinations that are required for the reconciliation flow.

func ComputeTechnicalID

func ComputeTechnicalID(projectName string, shoot *gardencorev1beta1.Shoot) string

ComputeTechnicalID determines the technical id of that Shoot which is later used for the name of the namespace and for tagging all the resources created in the infrastructure.

func ConstructExternalClusterDomain

func ConstructExternalClusterDomain(shoot *gardencorev1beta1.Shoot) *string

ConstructExternalClusterDomain constructs the external Shoot cluster domain, i.e. the domain which will be put into the Kubeconfig handed out to the user.

func ConstructExternalDomain

func ConstructExternalDomain(ctx context.Context, c client.Reader, shoot *gardencorev1beta1.Shoot, shootSecret *corev1.Secret, defaultDomains []*garden.Domain) (*garden.Domain, error)

ConstructExternalDomain constructs an object containing all relevant information of the external domain that shall be used for a shoot cluster - based on the configuration of the Garden cluster and the shoot itself.

func ConstructInternalClusterDomain

func ConstructInternalClusterDomain(shootName, shootProject string, internalDomain *garden.Domain) string

ConstructInternalClusterDomain constructs the internal base domain pof this shoot cluster. It is only used for internal purposes (all kubeconfigs except the one which is received by the user will only talk with the kube-apiserver via a DNS record of domain). In case the given <internalDomain> already contains "internal", the result is constructed as "<shootName>.<shootProject>.<internalDomain>." In case it does not, the word "internal" will be appended, resulting in "<shootName>.<shootProject>.internal.<internalDomain>".

func IsIncompleteDNSConfigError

func IsIncompleteDNSConfigError(err error) bool

IsIncompleteDNSConfigError returns true if the error indicates that not the DNS config is incomplete.

func StatusValue added in v1.21.0

func StatusValue(s Status) int

StatusValue returns the value of the given Status.

Types

type Builder added in v1.4.0

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

Builder is an object that builds Shoot objects.

func NewBuilder added in v1.4.0

func NewBuilder() *Builder

NewBuilder returns a new Builder.

func (*Builder) Build added in v1.4.0

func (b *Builder) Build(ctx context.Context, c client.Reader) (*Shoot, error)

Build initializes a new Shoot object.

func (*Builder) WithCloudProfileObject added in v1.4.0

func (b *Builder) WithCloudProfileObject(cloudProfileObject *gardencorev1beta1.CloudProfile) *Builder

WithCloudProfileObject sets the cloudProfileFunc attribute at the Builder.

func (*Builder) WithCloudProfileObjectFrom added in v1.30.0

func (b *Builder) WithCloudProfileObjectFrom(reader client.Reader) *Builder

WithCloudProfileObjectFrom sets the cloudProfileFunc attribute at the Builder after fetching it from the given reader.

func (*Builder) WithCloudProfileObjectFromCluster added in v1.19.0

func (b *Builder) WithCloudProfileObjectFromCluster(seedClient kubernetes.Interface, shootNamespace string) *Builder

WithCloudProfileObjectFromCluster sets the cloudProfileFunc attribute at the Builder.

func (*Builder) WithDefaultDomains added in v1.4.0

func (b *Builder) WithDefaultDomains(defaultDomains []*garden.Domain) *Builder

WithDefaultDomains sets the defaultDomains attribute at the Builder.

func (*Builder) WithDisableDNS added in v1.4.0

func (b *Builder) WithDisableDNS(disableDNS bool) *Builder

WithDisableDNS sets the disableDNS attribute at the Builder.

func (*Builder) WithExposureClassFrom added in v1.30.0

func (b *Builder) WithExposureClassFrom(c client.Reader) *Builder

WithExposureClassFrom sets the exposureClassFunc attribute at the Builder after fetching the exposure class with the given reader.

func (*Builder) WithInternalDomain added in v1.4.0

func (b *Builder) WithInternalDomain(internalDomain *garden.Domain) *Builder

WithInternalDomain sets the internalDomain attribute at the Builder.

func (*Builder) WithProjectName added in v1.4.0

func (b *Builder) WithProjectName(projectName string) *Builder

WithProjectName sets the projectName attribute at the Builder.

func (*Builder) WithShootObject added in v1.4.0

func (b *Builder) WithShootObject(shootObject *gardencorev1beta1.Shoot) *Builder

WithShootObject sets the shootObjectFunc attribute at the Builder.

func (*Builder) WithShootObjectFromCluster added in v1.16.0

func (b *Builder) WithShootObjectFromCluster(seedClient kubernetes.Interface, shootNamespace string) *Builder

WithShootObjectFromCluster sets the shootObjectFunc attribute at the Builder.

func (*Builder) WithShootSecret added in v1.4.0

func (b *Builder) WithShootSecret(secret *corev1.Secret) *Builder

WithShootSecret sets the shootSecretFunc attribute at the Builder.

func (*Builder) WithShootSecretFrom added in v1.30.0

func (b *Builder) WithShootSecretFrom(c client.Reader) *Builder

WithShootSecretFrom sets the shootSecretFunc attribute at the Builder after fetching it from the given reader.

type Components added in v1.5.0

type Components struct {
	BackupEntry              backupentry.Interface
	SourceBackupEntry        backupentry.Interface
	ControlPlane             *ControlPlane
	Extensions               *Extensions
	NetworkPolicies          component.Deployer
	SystemComponents         *SystemComponents
	Logging                  *Logging
	GardenerAccess           component.Deployer
	DependencyWatchdogAccess component.Deployer
}

Components contains different components deployed in the Shoot cluster.

type ControlPlane added in v1.7.0

type ControlPlane struct {
	ClusterAutoscaler     clusterautoscaler.Interface
	EtcdMain              etcd.Interface
	EtcdEvents            etcd.Interface
	EtcdCopyBackupsTask   etcdcopybackupstask.Interface
	KubeAPIServerService  component.DeployWaiter
	KubeAPIServerSNI      component.DeployWaiter
	KubeAPIServerSNIPhase component.Phase
	KubeAPIServer         kubeapiserver.Interface
	KubeScheduler         kubescheduler.Interface
	KubeControllerManager kubecontrollermanager.Interface
	ResourceManager       resourcemanager.Interface
	VerticalPodAutoscaler component.DeployWaiter
	VPNSeedServer         vpnseedserver.Interface
}

ControlPlane contains references to K8S control plane components.

type DNS added in v1.5.0

type DNS struct {
	ExternalOwner       component.DeployWaiter
	ExternalProvider    component.DeployWaiter
	ExternalEntry       component.DeployWaiter
	InternalOwner       component.DeployWaiter
	InternalProvider    component.DeployWaiter
	InternalEntry       component.DeployWaiter
	AdditionalProviders map[string]component.DeployWaiter
	NginxOwner          component.DeployWaiter
	NginxEntry          component.DeployWaiter
}

DNS contains references to internal and external DNSProvider and DNSEntry deployers.

type Extensions added in v1.8.0

type Extensions struct {
	ContainerRuntime      containerruntime.Interface
	ControlPlane          controlplane.Interface
	ControlPlaneExposure  controlplane.Interface
	DNS                   *DNS
	ExternalDNSRecord     dnsrecord.Interface
	InternalDNSRecord     dnsrecord.Interface
	IngressDNSRecord      dnsrecord.Interface
	OwnerDNSRecord        dnsrecord.Interface
	Extension             extension.Interface
	Infrastructure        infrastructure.Interface
	Network               component.DeployMigrateWaiter
	OperatingSystemConfig operatingsystemconfig.Interface
	Worker                worker.Interface
}

Extensions contains references to extension resources.

type IncompleteDNSConfigError

type IncompleteDNSConfigError struct{}

IncompleteDNSConfigError is a custom error type.

func (*IncompleteDNSConfigError) Error

func (e *IncompleteDNSConfigError) Error() string

Error prints the error message of the IncompleteDNSConfigError error.

type Logging added in v1.27.0

type Logging struct {
	ShootRBACProxy component.Deployer
}

Logging contains references to logging deployers

type Networks added in v1.1.0

type Networks struct {
	// Pods subnet
	Pods *net.IPNet
	// Services subnet
	Services *net.IPNet
	// APIServer is the ClusterIP of default/kubernetes Service
	APIServer net.IP
	// CoreDNS is the ClusterIP of kube-system/coredns Service
	CoreDNS net.IP
}

Networks contains pre-calculated subnets and IP address for various components.

func ToNetworks added in v1.1.0

func ToNetworks(s *gardencorev1beta1.Shoot) (*Networks, error)

ToNetworks return a network with computed cidrs and ClusterIPs for a Shoot

type Shoot

type Shoot struct {
	Secret       *corev1.Secret
	CloudProfile *gardencorev1beta1.CloudProfile

	SeedNamespace     string
	KubernetesVersion *semver.Version
	GardenerVersion   *semver.Version

	DisableDNS            bool
	InternalClusterDomain string
	ExternalClusterDomain *string
	ExternalDomain        *garden.Domain

	Purpose                    gardencorev1beta1.ShootPurpose
	WantsClusterAutoscaler     bool
	WantsVerticalPodAutoscaler bool
	WantsAlertmanager          bool
	IgnoreAlerts               bool
	HibernationEnabled         bool
	ReversedVPNEnabled         bool
	NodeLocalDNSEnabled        bool
	Networks                   *Networks
	ExposureClass              *gardencorev1alpha1.ExposureClass
	BackupEntryName            string

	Components *Components
	// contains filtered or unexported fields
}

Shoot is an object containing information about a Shoot cluster.

func (*Shoot) ComputeInClusterAPIServerAddress added in v1.1.0

func (s *Shoot) ComputeInClusterAPIServerAddress(runsInShootNamespace bool) string

ComputeInClusterAPIServerAddress returns the internal address for the shoot API server depending on whether the caller runs in the shoot namespace or not.

func (*Shoot) ComputeOutOfClusterAPIServerAddress added in v1.1.0

func (s *Shoot) ComputeOutOfClusterAPIServerAddress(apiServerAddress string, useInternalClusterDomain bool) string

ComputeOutOfClusterAPIServerAddress returns the external address for the shoot API server depending on whether the caller wants to use the internal cluster domain and whether DNS is disabled on this seed.

func (*Shoot) GetDNSRecordComponentsForMigration added in v1.29.0

func (s *Shoot) GetDNSRecordComponentsForMigration() []component.DeployMigrateWaiter

GetDNSRecordComponentsForMigration returns a list of component.DeployMigrateWaiters of DNSRecord components that should be migrated by the shoot controller.

func (*Shoot) GetExtensionComponentsForParallelMigration added in v1.40.0

func (s *Shoot) GetExtensionComponentsForParallelMigration() []component.DeployMigrateWaiter

GetExtensionComponentsForParallelMigration returns a list of component.DeployMigrateWaiters of extension components that should be migrated by the shoot controller in parallel. Note that this method does not return ControlPlane and Infrastructure components as they require specific handling during migration.

func (*Shoot) GetInfo added in v1.29.0

func (s *Shoot) GetInfo() *gardencorev1beta1.Shoot

GetInfo returns the shoot resource of this Shoot in a concurrency safe way. This method should be used only for reading the data of the returned shoot resource. The returned shoot resource MUST NOT BE MODIFIED (except in test code) since this might interfere with other concurrent reads and writes. To properly update the shoot resource of this Shoot use UpdateInfo or UpdateInfoStatus.

func (*Shoot) GetIngressFQDN

func (s *Shoot) GetIngressFQDN(subDomain string) string

GetIngressFQDN returns the fully qualified domain name of ingress sub-resource for the Shoot cluster. The end result is '<subDomain>.<ingressPrefix>.<clusterDomain>'.

func (*Shoot) GetMaxNodeCount added in v1.1.0

func (s *Shoot) GetMaxNodeCount() int32

GetMaxNodeCount returns the sum of all 'maximum' fields of all worker groups of the Shoot.

func (*Shoot) GetMinNodeCount added in v1.1.0

func (s *Shoot) GetMinNodeCount() int32

GetMinNodeCount returns the sum of all 'minimum' fields of all worker groups of the Shoot.

func (*Shoot) GetReplicas

func (s *Shoot) GetReplicas(wokenUp int32) int32

GetReplicas returns the given <wokenUp> number if the shoot is not hibernated, or zero otherwise.

func (*Shoot) GetWorkerNames

func (s *Shoot) GetWorkerNames() []string

GetWorkerNames returns a list of names of the worker groups in the Shoot manifest.

func (*Shoot) IPVSEnabled

func (s *Shoot) IPVSEnabled() bool

IPVSEnabled returns true if IPVS is enabled for the shoot.

func (*Shoot) IsShootControlPlaneLoggingEnabled added in v1.41.0

func (s *Shoot) IsShootControlPlaneLoggingEnabled(c *config.GardenletConfiguration) bool

IsShootControlPlaneLoggingEnabled return true if the Shoot controlplane logging is enabled

func (*Shoot) SetInfo added in v1.29.0

func (s *Shoot) SetInfo(shoot *gardencorev1beta1.Shoot)

SetInfo sets the shoot resource of this Shoot in a concurrency safe way. This method is not protected by a mutex and does not update the shoot resource in the cluster and so should be used only in exceptional situations, or as a convenience in test code. The shoot passed as a parameter MUST NOT BE MODIFIED after the call to SetInfo (except in test code) since this might interfere with other concurrent reads and writes. To properly update the shoot resource of this Shoot use UpdateInfo or UpdateInfoStatus.

func (*Shoot) UpdateInfo added in v1.29.0

func (s *Shoot) UpdateInfo(ctx context.Context, c client.Client, useStrategicMerge bool, f func(*gardencorev1beta1.Shoot) error) error

UpdateInfo updates the shoot resource of this Shoot in a concurrency safe way, using the given context, client, and mutate function. It copies the current shoot resource and then uses the copy to patch the resource in the cluster using either client.MergeFrom or client.StrategicMergeFrom depending on useStrategicMerge. This method is protected by a mutex, so only a single UpdateInfo or UpdateInfoStatus operation can be executed at any point in time.

func (*Shoot) UpdateInfoStatus added in v1.29.0

func (s *Shoot) UpdateInfoStatus(ctx context.Context, c client.Client, useStrategicMerge bool, f func(*gardencorev1beta1.Shoot) error) error

UpdateInfoStatus updates the status of the shoot resource of this Shoot in a concurrency safe way, using the given context, client, and mutate function. It copies the current shoot resource and then uses the copy to patch the resource in the cluster using either client.MergeFrom or client.StrategicMergeFrom depending on useStrategicMerge. This method is protected by a mutex, so only a single UpdateInfo or UpdateInfoStatus operation can be executed at any point in time.

type Status added in v1.12.0

type Status string

Status is the status of a shoot used in the common.ShootStatus label.

const (
	// StatusHealthy indicates that a shoot is considered healthy.
	StatusHealthy Status = "healthy"
	// StatusProgressing indicates that a shoot was once healthy, currently experienced an issue
	// but is still within a predefined grace period.
	StatusProgressing Status = "progressing"
	// StatusUnhealthy indicates that a shoot is considered unhealthy.
	StatusUnhealthy Status = "unhealthy"
	// StatusUnknown indicates that the shoot health status is not known.
	StatusUnknown Status = "unknown"
)

func BoolToStatus added in v1.12.0

func BoolToStatus(cond bool) Status

BoolToStatus converts the given boolean to a Status. For true values, it returns StatusHealthy. Otherwise, it returns StatusUnhealthy.

func ComputeConditionStatus added in v1.12.0

func ComputeConditionStatus(conditions ...gardencorev1beta1.Condition) Status

ComputeConditionStatus computes a shoot Label Status from the given Conditions. By default, the Status is StatusHealthy. The condition status is converted to a Status by using ConditionStatusToStatus. Always the worst status of the combined states wins.

func ComputeStatus added in v1.12.0

func ComputeStatus(lastOperation *gardencorev1beta1.LastOperation, lastErrors []gardencorev1beta1.LastError, conditions ...gardencorev1beta1.Condition) Status

ComputeStatus computes the label Status of a shoot depending on the given lastOperation, lastError and conditions.

func ConditionStatusToStatus added in v1.12.0

func ConditionStatusToStatus(status gardencorev1beta1.ConditionStatus) Status

ConditionStatusToStatus converts the given ConditionStatus to a shoot label Status.

func (Status) OrWorse added in v1.12.0

func (s Status) OrWorse(other Status) Status

OrWorse returns the worse Status of the given two states.

type SystemComponents added in v1.13.0

type SystemComponents struct {
	ClusterIdentity     clusteridentity.Interface
	CoreDNS             coredns.Interface
	KubeProxy           kubeproxy.Interface
	MetricsServer       component.DeployWaiter
	Namespaces          component.DeployWaiter
	NodeLocalDNS        nodelocaldns.Interface
	NodeProblemDetector component.DeployWaiter
	Resources           component.DeployWaiter
	VPNShoot            vpnshoot.Interface
}

SystemComponents contains references to system components.

Jump to

Keyboard shortcuts

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