helper

package
v0.0.0-...-44ba42e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = metav1.Now

Now determines the current metav1.Time.

Functions

func DetermineCloudProviderInProfile

func DetermineCloudProviderInProfile(spec gardenv1beta1.CloudProfileSpec) (gardenv1beta1.CloudProvider, error)

DetermineCloudProviderInProfile takes a CloudProfile specification and returns the cloud provider this profile is used for. If it is not able to determine it, an error will be returned.

func DetermineCloudProviderInShoot

func DetermineCloudProviderInShoot(cloudObj gardenv1beta1.Cloud) (gardenv1beta1.CloudProvider, error)

DetermineCloudProviderInShoot takes a Shoot cloud object and returns the cloud provider this profile is used for. If it is not able to determine it, an error will be returned.

func DetermineLatestKubernetesVersion

func DetermineLatestKubernetesVersion(cloudProfile gardenv1beta1.CloudProfile, currentVersion string) (bool, string, error)

DetermineLatestKubernetesVersion finds the latest Kubernetes patch version in the <cloudProfile> compared to the given <currentVersion>. In case it does not find a newer patch version, it returns false. Otherwise, true and the found version will be returned.

func DetermineMachineImage

func DetermineMachineImage(cloudProfile gardenv1beta1.CloudProfile, name string) (bool, *gardenv1beta1.MachineImage, error)

DetermineMachineImage finds the cloud specific machine image in the <cloudProfile> for the given <name> and region. In case it does not find a machine image with the <name>, it returns false. Otherwise, true and the cloud-specific machine image object will be returned.

func GetK8SNetworks

func GetK8SNetworks(shoot *gardenv1beta1.Shoot) (*gardencorev1alpha1.K8SNetworks, error)

GetK8SNetworks returns the Kubernetes network CIDRs for the Shoot cluster.

func GetMachineImageFromShoot

func GetMachineImageFromShoot(cloudProvider gardenv1beta1.CloudProvider, shoot *gardenv1beta1.Shoot) *gardenv1beta1.MachineImage

GetMachineImageFromShoot returns the machine image used in a shoot manifest, however, it requires the cloudprovider as input.

func GetMachineTypesFromCloudProfile

func GetMachineTypesFromCloudProfile(cloudProvider gardenv1beta1.CloudProvider, profile *gardenv1beta1.CloudProfile) []gardenv1beta1.MachineType

GetMachineTypesFromCloudProfile retrieves list of machine types from cloud profile

func GetShootCloudProvider

func GetShootCloudProvider(shoot *gardenv1beta1.Shoot) (gardenv1beta1.CloudProvider, error)

GetShootCloudProvider retrieves the cloud provider used for the given Shoot.

func GetShootCloudProviderWorkers

func GetShootCloudProviderWorkers(cloudProvider gardenv1beta1.CloudProvider, shoot *gardenv1beta1.Shoot) []gardenv1beta1.Worker

GetShootCloudProviderWorkers retrieves the cloud-specific workers of the given Shoot.

func GetShootMachineImage

func GetShootMachineImage(shoot *gardenv1beta1.Shoot) (*gardenv1beta1.MachineImage, error)

GetShootMachineImage returns the machine image used in a shoot manifest.

func GetZones

GetZones returns the CloudProvide, the Zones for the CloudProfile and an error Returns an empty Zone slice for Azure

func IsShootHibernated

func IsShootHibernated(shoot *gardenv1beta1.Shoot) bool

IsShootHibernated checks if the given shoot is hibernated.

func SetZoneForShoot

func SetZoneForShoot(shoot *gardenv1beta1.Shoot, cloudProvider gardenv1beta1.CloudProvider, zones []string)

SetZoneForShoot sets the Zone for the shoot for the specific Cloud provider. Azure does not have Zones, so it is being ignored.

func ShootIgnoreAlerts

func ShootIgnoreAlerts(shoot *gardenv1beta1.Shoot) bool

ShootIgnoreAlerts checks if the alerts for the annotated shoot cluster should be ignored.

func ShootWantsAlertmanager

func ShootWantsAlertmanager(shoot *gardenv1beta1.Shoot, secrets map[string]*corev1.Secret) bool

ShootWantsAlertmanager checks if the given Shoot needs an Alertmanger.

func ShootWantsClusterAutoscaler

func ShootWantsClusterAutoscaler(shoot *gardenv1beta1.Shoot) (bool, error)

ShootWantsClusterAutoscaler checks if the given Shoot needs a cluster autoscaler. This is determined by checking whether one of the Shoot workers has a different AutoScalerMax than AutoScalerMin.

func UpdateMachineImage

func UpdateMachineImage(cloudProvider gardenv1beta1.CloudProvider, machineImage *gardenv1beta1.MachineImage) func(*gardenv1beta1.Cloud)

UpdateMachineImage updates the machine image for the given cloud provider.

Types

type ShootedSeed

type ShootedSeed struct {
	Protected         *bool
	Visible           *bool
	MinimumVolumeSize *string
	APIServer         *ShootedSeedAPIServer
	BlockCIDRs        []gardencorev1alpha1.CIDR
}

func ReadShootedSeed

func ReadShootedSeed(shoot *gardenv1beta1.Shoot) (*ShootedSeed, error)

ReadShootedSeed determines whether the Shoot has been marked to be registered automatically as a Seed cluster.

type ShootedSeedAPIServer

type ShootedSeedAPIServer struct {
	Replicas   *int32
	Autoscaler *ShootedSeedAPIServerAutoscaler
}

type ShootedSeedAPIServerAutoscaler

type ShootedSeedAPIServerAutoscaler struct {
	MinReplicas *int32
	MaxReplicas int32
}

Jump to

Keyboard shortcuts

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