gardener: Index | Files

package shoot

import ""


Package Files

configmap_control.go shoot.go shoot_hibernation_control.go shoot_hibernation_types.go shoot_maintenance_control.go shoot_quota_control.go


var (
    // NewCronWithLocation creates a new cron with the given location. Exposed for testing.
    NewCronWithLocation = newCronWithLocation

    // TimeNow returns the current time. Exposed for testing.
    TimeNow = time.Now

func ExpirationDateExpired Uses

func ExpirationDateExpired(timestamp *metav1.Time) bool

ExpirationDateExpired returns if now is equal or after the given expirationDate

func ForceMachineImageUpdateRequired Uses

func ForceMachineImageUpdateRequired(shootCurrentImage *gardencorev1beta1.ShootMachineImage, imageCloudProvider gardencorev1beta1.MachineImage) bool

ForceMachineImageUpdateRequired checks if the shoots current machine image has to be forcefully updated

func GroupHibernationSchedulesByLocation Uses

func GroupHibernationSchedulesByLocation(schedules []gardencorev1beta1.HibernationSchedule) map[string][]gardencorev1beta1.HibernationSchedule

GroupHibernationSchedulesByLocation groups the given HibernationSchedules by their Location. If the Location of a HibernationSchedule is `nil`, it is defaulted to UTC.

func LocationLogger Uses

func LocationLogger(logger logrus.FieldLogger, location *time.Location) logrus.FieldLogger

LocationLogger returns a logger for the given location.

func MaintainKubernetesVersion Uses

func MaintainKubernetesVersion(shoot *gardencorev1beta1.Shoot, profile *gardencorev1beta1.CloudProfile) (*string, error)

MaintainKubernetesVersion determines if a shoots kubernetes version has to be maintained and in case returns the target version

func MaintainMachineImages Uses

func MaintainMachineImages(shoot *gardencorev1beta1.Shoot, cloudProfile *gardencorev1beta1.CloudProfile, shootCurrentImages []*gardencorev1beta1.ShootMachineImage) ([]*gardencorev1beta1.ShootMachineImage, error)

MaintainMachineImages determines if a shoots machine images have to be maintained and in case returns the target images

func NewHibernationJob Uses

func NewHibernationJob(client gardencore.Interface, logger logrus.FieldLogger, target *gardencorev1beta1.Shoot, enabled bool) cron.Job

NewHibernationJob creates a new cron.Job that sets the hibernation of the given shoot to enabled when it triggers.

type Controller Uses

type Controller struct {
    // contains filtered or unexported fields

Controller controls Shoots.

func NewShootController Uses

func NewShootController(k8sGardenClient kubernetes.Interface, k8sGardenCoreInformers gardencoreinformers.SharedInformerFactory, kubeInformerFactory kubeinformers.SharedInformerFactory, config *config.ControllerManagerConfiguration, recorder record.EventRecorder) *Controller

NewShootController takes a Kubernetes client for the Garden clusters <k8sGardenClient>, a struct holding information about the acting Gardener, a <shootInformer>, and a <recorder> for event recording. It creates a new Gardener controller.

func (*Controller) CollectMetrics Uses

func (c *Controller) CollectMetrics(ch chan<- prometheus.Metric)

CollectMetrics implements gardenmetrics.ControllerMetricsCollector interface

func (*Controller) Run Uses

func (c *Controller) Run(ctx context.Context, shootMaintenanceWorkers, shootQuotaWorkers, shootHibernationWorkers int)

Run runs the Controller until the given stop channel can be read from.

func (*Controller) RunningWorkers Uses

func (c *Controller) RunningWorkers() int

RunningWorkers returns the number of running workers.

type Cron Uses

type Cron interface {
    Schedule(schedule cron.Schedule, job cron.Job)

Cron is an interface that allows mocking cron.Cron.

type HibernationSchedule Uses

type HibernationSchedule map[string]Cron

HibernationSchedule is a mapping from location to a Cron. It controls the hibernation process of a certain shoot.

func ComputeHibernationSchedule Uses

func ComputeHibernationSchedule(client gardencore.Interface, logger logrus.FieldLogger, shoot *gardencorev1beta1.Shoot) (HibernationSchedule, error)

ComputeHibernationSchedule computes the HibernationSchedule for the given Shoot.

func (*HibernationSchedule) Start Uses

func (h *HibernationSchedule) Start()

Start implements Cron.

func (*HibernationSchedule) Stop Uses

func (h *HibernationSchedule) Stop()

Stop implements Cron.

type HibernationScheduleRegistry Uses

type HibernationScheduleRegistry interface {
    Load(key string) (schedule HibernationSchedule, ok bool)
    Store(key string, schedule HibernationSchedule)
    Delete(key string)

HibernationScheduleRegistry is a goroutine-safe mapping of Shoot key to HibernationSchedule.

func NewHibernationScheduleRegistry Uses

func NewHibernationScheduleRegistry() HibernationScheduleRegistry

NewHibernationScheduleRegistry instantiates a new HibernationScheduleRegistry.

type MaintenanceControlInterface Uses

type MaintenanceControlInterface interface {
    Maintain(shoot *gardencorev1beta1.Shoot, key string) error

MaintenanceControlInterface implements the control logic for maintaining Shoots. It is implemented as an interface to allow for extensions that provide different semantics. Currently, there is only one implementation.

func NewDefaultMaintenanceControl Uses

func NewDefaultMaintenanceControl(k8sGardenClient kubernetes.Interface, k8sGardenCoreInformers gardencoreinformers.Interface, recorder record.EventRecorder) MaintenanceControlInterface

NewDefaultMaintenanceControl returns a new instance of the default implementation MaintenanceControlInterface that implements the documented semantics for maintaining Shoots. You should use an instance returned from NewDefaultMaintenanceControl() for any scenario other than testing.

type QuotaControlInterface Uses

type QuotaControlInterface interface {
    CheckQuota(shoot *gardencorev1beta1.Shoot, key string) error

QuotaControlInterface implements the control logic for quota management of Shoots. It is implemented as an interface to allow for extensions that provide different semantics. Currently, there is only one implementation.

func NewDefaultQuotaControl Uses

func NewDefaultQuotaControl(k8sGardenClient kubernetes.Interface, k8sGardenCoreInformers gardencoreinformers.Interface) QuotaControlInterface

NewDefaultQuotaControl returns a new instance of the default implementation of QuotaControlInterface which implements the semantics for controlling the quota handling of Shoot resources.

Package shoot imports 33 packages (graph) and is imported by 2 packages. Updated 2020-02-23. Refresh now. Tools for package owners.