shoot

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: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ExtensionDefaultTimeout = 10 * time.Minute

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

Variables

This section is empty.

Functions

func ComputeTechnicalID

func ComputeTechnicalID(projectName string, shoot *gardenv1beta1.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 *gardenv1beta1.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 ConstructInternalClusterDomain

func ConstructInternalClusterDomain(shootName, shootProject, internalDomain string) string

ConstructInternalClusterDomain constructs the domain pointing to the kube-apiserver of a Shoot cluster which 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 this domain). In case the given <internalDomain> already contains "internal", the result is constructed as "api.<shootName>.<shootProject>.<internalDomain>." In case it does not, the word "internal" will be appended, resulting in "api.<shootName>.<shootProject>.internal.<internalDomain>".

func MergeExtensions

func MergeExtensions(registrations []corev1alpha1.ControllerRegistration, extensions []gardenv1beta1.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.

Types

type CloudConfig

type CloudConfig struct {
	Downloader CloudConfigData
	Original   CloudConfigData
}

CloudConfig contains a downloader script as well as the original cloud config.

type CloudConfigData

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

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

type Extension

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

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

type ExternalDomain

type ExternalDomain struct {
	Domain     string
	Provider   string
	SecretData map[string][]byte
}

ExternalDomain contains information for the used external shoot domain.

func ConstructExternalDomain

func ConstructExternalDomain(ctx context.Context, client client.Client, shoot *gardenv1beta1.Shoot, shootSecret *corev1.Secret, defaultDomains []*garden.DefaultDomain) (*ExternalDomain, 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.

type Shoot

type Shoot struct {
	Info          *gardenv1beta1.Shoot
	Secret        *corev1.Secret
	CloudProfile  *gardenv1beta1.CloudProfile
	CloudProvider gardenv1beta1.CloudProvider

	SeedNamespace               string
	KubernetesMajorMinorVersion string

	InternalClusterDomain string
	ExternalClusterDomain *string
	ExternalDomain        *ExternalDomain

	WantsClusterAutoscaler bool
	WantsAlertmanager      bool
	IgnoreAlerts           bool
	IsHibernated           bool

	CloudConfigMap       map[string]CloudConfig
	Extensions           map[string]Extension
	InfrastructureStatus []byte
	MachineDeployments   []extensionsv1alpha1.MachineDeployment
}

Shoot is an object containing information about a Shoot cluster.

func New

func New(k8sGardenClient kubernetes.Interface, k8sGardenInformers gardeninformers.Interface, shoot *gardenv1beta1.Shoot, projectName, internalDomain string, defaultDomains []*garden.DefaultDomain) (*Shoot, error)

New takes a <k8sGardenClient>, the <k8sGardenInformers> and a <shoot> manifest, and creates a new Shoot representation. It will add the CloudProfile, the cloud provider secret, compute the internal cluster domain and identify the cloud provider.

func (*Shoot) ClusterAutoscalerEnabled

func (s *Shoot) ClusterAutoscalerEnabled() bool

ClusterAutoscalerEnabled returns true if the cluster-autoscaler addon is enabled in the Shoot manifest.

func (*Shoot) ComputeAPIServerURL

func (s *Shoot) ComputeAPIServerURL(runsInSeed, useInternalClusterDomain bool) string

ComputeAPIServerURL takes a boolean value identifying whether the component connecting to the API server runs in the Seed cluster <runsInSeed>, and a boolean value <useInternalClusterDomain> which determines whether the internal or the external cluster domain should be used.

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

func (s *Shoot) GetK8SNetworks() (*gardencorev1alpha1.K8SNetworks, error)

GetK8SNetworks returns the Kubernetes network CIDRs for the Shoot cluster.

func (*Shoot) GetMachineImage

func (s *Shoot) GetMachineImage() *gardenv1beta1.MachineImage

GetMachineImage returns the name of the used machine image.

func (*Shoot) GetMachineTypesFromCloudProfile

func (s *Shoot) GetMachineTypesFromCloudProfile() []gardenv1beta1.MachineType

GetMachineTypesFromCloudProfile returns a list of machine types in the cloud profile.

func (*Shoot) GetNodeCount

func (s *Shoot) GetNodeCount() int

GetNodeCount returns the sum of all 'autoScalerMax' fields of all worker groups of the Shoot.

func (*Shoot) GetNodeNetwork

func (s *Shoot) GetNodeNetwork() gardencorev1alpha1.CIDR

GetNodeNetwork returns the node network CIDR for the Shoot cluster.

func (*Shoot) GetPodNetwork

func (s *Shoot) GetPodNetwork() gardencorev1alpha1.CIDR

GetPodNetwork returns the pod network CIDR for the Shoot cluster.

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

func (s *Shoot) GetServiceNetwork() gardencorev1alpha1.CIDR

GetServiceNetwork returns the service network CIDR for the Shoot cluster.

func (*Shoot) GetWorkerNames

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

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

func (*Shoot) GetWorkerVolumesByName

func (s *Shoot) GetWorkerVolumesByName(workerName string) (ok bool, volumeType, volumeSize string, err error)

GetWorkerVolumesByName returns the volume information for the specific worker pool (if there is any volume information).

func (*Shoot) GetWorkers

func (s *Shoot) GetWorkers() []gardenv1beta1.Worker

GetWorkers returns a list of worker objects of the worker groups in the Shoot manifest.

func (*Shoot) GetZones

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

GetZones returns the zones of the shoot cluster.

func (*Shoot) IPVSEnabled

func (s *Shoot) IPVSEnabled() bool

IPVSEnabled returns true if IPVS is enabled for the shoot.

func (*Shoot) Kube2IAMEnabled

func (s *Shoot) Kube2IAMEnabled() bool

Kube2IAMEnabled returns true if the kube2iam addon is enabled in the Shoot manifest.

func (*Shoot) KubeLegoEnabled

func (s *Shoot) KubeLegoEnabled() bool

KubeLegoEnabled returns true if the kube-lego addon is enabled in the Shoot manifest.

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.

func (*Shoot) UsesCSI

func (s *Shoot) UsesCSI() bool

UsesCSI returns whether the given shoot uses CSI volume plugins.

Jump to

Keyboard shortcuts

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