shoot

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const ExtensionDefaultTimeout = 3 * time.Minute

ExtensionDefaultTimeout is the default timeout and defines how long Gardener should wait for a successful reconciliation of this extension resource.

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.ControllerRegistration, 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, client client.Client, 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 MergeExtensions

func MergeExtensions(registrations []gardencorev1beta1.ControllerRegistration, extensions []gardencorev1beta1.Extension, namespace string) (map[string]Extension, error)

MergeExtensions merges the given controller registrations with the given extensions, expecting that each type in extensions is also represented in the registration. It ignores all extensions that were explicitly disabled in the shoot spec.

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.Client) (*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) WithCloudProfileObjectFromLister added in v1.4.0

func (b *Builder) WithCloudProfileObjectFromLister(cloudProfileLister gardencorelisters.CloudProfileLister) *Builder

WithCloudProfileObjectFromLister sets the cloudProfileFunc attribute at the Builder after fetching it from the given lister.

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) 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) WithShootObjectFromLister added in v1.4.0

func (b *Builder) WithShootObjectFromLister(shootLister gardencorelisters.ShootLister, namespace, name string) *Builder

WithShootObjectFromLister sets the shootObjectFunc attribute at the Builder after fetching it from the given lister.

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) WithShootSecretFromSecretBindingLister added in v1.4.0

func (b *Builder) WithShootSecretFromSecretBindingLister(secretBindingLister gardencorelisters.SecretBindingLister) *Builder

WithShootSecretFromLister sets the shootSecretFunc attribute at the Builder after fetching it from the given lister.

type Components added in v1.5.0

type Components struct {
	Extensions      *Extensions
	ControlPlane    *ControlPlane
	ClusterIdentity component.Deployer
}

Components contains different components deployed in the Shoot cluster.

type ControlPlane added in v1.7.0

type ControlPlane struct {
	KubeAPIServerService component.DeployWaiter
	KubeAPIServerSNI     component.DeployWaiter
}

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 Extension

type Extension struct {
	extensionsv1alpha1.Extension
	Timeout time.Duration
}

Extension contains information about the extension api resouce as well as configuration information.

type Extensions added in v1.8.0

type Extensions struct {
	DNS            *DNS
	Infrastructure Infrastructure
	Network        component.DeployMigrateWaiter
}

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 Infrastructure added in v1.8.0

type Infrastructure interface {
	component.DeployWaiter
	SetSSHPublicKey([]byte)
	ProviderStatus() *runtime.RawExtension
	NodesCIDR() *string
}

Infrastructure contains references to an Infrastructure extension deployer and its generated provider status.

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 OperatingSystemConfig

type OperatingSystemConfig struct {
	Name string
	Data OperatingSystemConfigData
}

OperatingSystemConfig contains the operating system config's name and data.

type OperatingSystemConfigData

type OperatingSystemConfigData struct {
	Content string
	Command *string
	Units   []string
}

OperatingSystemConfigData contains the actual content, a command to load it and all units that shall be considered for restart on change.

type OperatingSystemConfigs

type OperatingSystemConfigs struct {
	Downloader OperatingSystemConfig
	Original   OperatingSystemConfig
}

OperatingSystemConfigs contains operating system configs for the downloader script as well as for the original cloud config.

type Shoot

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

	SeedNamespace               string
	KubernetesMajorMinorVersion string

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

	WantsClusterAutoscaler     bool
	WantsVerticalPodAutoscaler bool
	WantsAlertmanager          bool
	IgnoreAlerts               bool
	HibernationEnabled         bool
	KonnectivityTunnelEnabled  bool
	NodeLocalDNSEnabled        bool
	Networks                   *Networks

	Components *Components

	OperatingSystemConfigsMap map[string]OperatingSystemConfigs
	Extensions                map[string]Extension
	InfrastructureStatus      []byte
	ControlPlaneStatus        []byte
	MachineDeployments        []extensionsv1alpha1.MachineDeployment

	ETCDEncryption *etcdencryption.EncryptionConfig

	ResourceRefs map[string]autoscalingv1.CrossVersionObjectReference
}

Shoot is an object containing information about a Shoot cluster.

func (*Shoot) ComputeCloudConfigSecretName

func (s *Shoot) ComputeCloudConfigSecretName(workerName string) string

ComputeCloudConfigSecretName computes the name for a secret which contains the original cloud config for the worker group with the given <workerName>. It is build by the cloud config secret prefix, the worker name itself and a hash of the minor Kubernetes version of the 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) 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) GetNodeNetwork added in v0.34.0

func (s *Shoot) GetNodeNetwork() *string

GetNodeNetwork returns the nodes network CIDR for the Shoot cluster. If the infrastructure extension controller has generated a nodes network then this CIDR will take priority. Otherwise, the nodes network CIDR specified in the shoot will be returned (if possible). If no CIDR was specified then nil is returned.

func (*Shoot) GetPurpose added in v0.35.0

func (s *Shoot) GetPurpose() gardencorev1beta1.ShootPurpose

GetPurpose returns the purpose of the shoot or 'evaluation' if it's nil.

func (*Shoot) GetReplicas

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

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) KubernetesDashboardEnabled

func (s *Shoot) KubernetesDashboardEnabled() bool

KubernetesDashboardEnabled returns true if the kubernetes-dashboard addon is enabled in the Shoot manifest.

func (*Shoot) NginxIngressEnabled

func (s *Shoot) NginxIngressEnabled() bool

NginxIngressEnabled returns true if the nginx-ingress addon is enabled in the Shoot manifest.

Jump to

Keyboard shortcuts

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