operation

package
v0.0.0-...-32fc51b Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MachineDeployment

type MachineDeployment struct {
	Name           string
	ClassName      string
	Minimum        int
	Maximum        int
	MaxSurge       intstr.IntOrString
	MaxUnavailable intstr.IntOrString
}

MachineDeployment holds insformation about the name, class, replicas of a MachineDeployment managed by the machine-controller-manager.

type MachineDeployments

type MachineDeployments []MachineDeployment

MachineDeployments is a list of machine deployments.

func (MachineDeployments) ContainsClass

func (m MachineDeployments) ContainsClass(className string) bool

ContainsClass checks whether the <className> is part of the <machineDeployments> list, i.e. whether there is an entry whose 'ClassName' attribute matches <name>. It returns true or false.

func (MachineDeployments) ContainsName

func (m MachineDeployments) ContainsName(name string) bool

ContainsName checks whether the <name> is part of the <machineDeployments> list, i.e. whether there is an entry whose 'Name' attribute matches <name>. It returns true or false.

type Operation

type Operation struct {
	Logger               *logrus.Entry
	GardenerInfo         *gardenv1beta1.Gardener
	Secrets              map[string]*corev1.Secret
	CheckSums            map[string]string
	ImageVector          imagevector.ImageVector
	Garden               *garden.Garden
	Seed                 *seed.Seed
	Shoot                *shoot.Shoot
	ShootedSeed          *helper.ShootedSeed
	K8sGardenClient      kubernetes.Client
	K8sGardenInformers   gardeninformers.Interface
	K8sSeedClient        kubernetes.Client
	K8sShootClient       kubernetes.Client
	ChartGardenRenderer  chartrenderer.ChartRenderer
	ChartSeedRenderer    chartrenderer.ChartRenderer
	ChartShootRenderer   chartrenderer.ChartRenderer
	APIServerIngresses   []corev1.LoadBalancerIngress
	APIServerAddress     string
	APIServerAddressIP   string
	SeedNamespaceObject  *corev1.Namespace
	BackupInfrastructure *gardenv1beta1.BackupInfrastructure
	MachineDeployments   MachineDeployments
}

Operation contains all data required to perform an operation on a Shoot cluster.

func New

func New(shoot *gardenv1beta1.Shoot, logger *logrus.Entry, k8sGardenClient kubernetes.Client, k8sGardenInformers gardeninformers.Interface, gardenerInfo *gardenv1beta1.Gardener, secretsMap map[string]*corev1.Secret, imageVector imagevector.ImageVector) (*Operation, error)

New creates a new operation object with a Shoot resource object.

func NewWithBackupInfrastructure

func NewWithBackupInfrastructure(backupInfrastructure *gardenv1beta1.BackupInfrastructure, logger *logrus.Entry, k8sGardenClient kubernetes.Client, k8sGardenInformers gardeninformers.Interface, gardenerInfo *gardenv1beta1.Gardener, secretsMap map[string]*corev1.Secret, imageVector imagevector.ImageVector) (*Operation, error)

NewWithBackupInfrastructure creates a new operation object without a Shoot resource object but the BackupInfrastructure resource.

func (*Operation) ApplyChartGarden

func (o *Operation) ApplyChartGarden(chartPath, name, namespace string, defaultValues, additionalValues map[string]interface{}) error

ApplyChartGarden takes a path to a chart <chartPath>, name of the release <name>, release's namespace <namespace> and two maps <defaultValues>, <additionalValues>, and renders the template based on the merged result of both value maps. The resulting manifest will be applied to the Garden cluster.

func (*Operation) ApplyChartSeed

func (o *Operation) ApplyChartSeed(chartPath, name, namespace string, defaultValues, additionalValues map[string]interface{}) error

ApplyChartSeed takes a path to a chart <chartPath>, name of the release <name>, release's namespace <namespace> and two maps <defaultValues>, <additionalValues>, and renders the template based on the merged result of both value maps. The resulting manifest will be applied to the Seed cluster.

func (*Operation) ApplyChartShoot

func (o *Operation) ApplyChartShoot(chartPath, name, namespace string, defaultValues, additionalValues map[string]interface{}) error

ApplyChartShoot takes a path to a chart <chartPath>, name of the release <name>, release's namespace <namespace> and two maps <defaultValues>, <additionalValues>, and renders the template based on the merged result of both value maps. The resulting manifest will be applied to the Shoot cluster.

func (*Operation) ComputeDownloaderCloudConfig

func (o *Operation) ComputeDownloaderCloudConfig(workerName string) (*chartrenderer.RenderedChart, error)

ComputeDownloaderCloudConfig computes the downloader cloud config which is injected as user data while creating machines/VMs. It needs the name of the worker group it is used for (<workerName>) and returns the rendered chart.

func (*Operation) ComputeOriginalCloudConfig

func (o *Operation) ComputeOriginalCloudConfig(config map[string]interface{}) (*chartrenderer.RenderedChart, error)

ComputeOriginalCloudConfig computes the original cloud config which is downloaded by the cloud config downloader process running on machines/VMs. It will regularly check for new versions and restart all units once it finds a newer state.

func (*Operation) GetSecretKeysOfRole

func (o *Operation) GetSecretKeysOfRole(kind string) []string

GetSecretKeysOfRole returns a list of keys which are present in the Garden Secrets map and which are prefixed with <kind>.

func (*Operation) InitializeSeedClients

func (o *Operation) InitializeSeedClients() error

InitializeSeedClients will use the Garden Kubernetes client to read the Seed Secret in the Garden cluster which contains a Kubeconfig that can be used to authenticate against the Seed cluster. With it, a Kubernetes client as well as a Chart renderer for the Seed cluster will be initialized and attached to the already existing Operation object.

func (*Operation) InitializeShootClients

func (o *Operation) InitializeShootClients() error

InitializeShootClients will use the Seed Kubernetes client to read the gardener Secret in the Seed cluster which contains a Kubeconfig that can be used to authenticate against the Shoot cluster. With it, a Kubernetes client as well as a Chart renderer for the Shoot cluster will be initialized and attached to the already existing Operation object.

func (*Operation) InjectImages

func (o *Operation) InjectImages(values map[string]interface{}, k8sVersionRuntime, k8sVersionTarget string, images ...string) (map[string]interface{}, error)

InjectImages injects images from the image vector into the provided <values> map.

func (*Operation) ReportBackupInfrastructureProgress

func (o *Operation) ReportBackupInfrastructureProgress(stats *flow.Stats)

ReportBackupInfrastructureProgress will update the phase and error in the BackupInfrastructure manifest `status` section by the current progress of the Flow execution.

func (*Operation) ReportShootProgress

func (o *Operation) ReportShootProgress(stats *flow.Stats)

ReportShootProgress will update the last operation object in the Shoot manifest `status` section by the current progress of the Flow execution.

func (*Operation) SeedVersion

func (o *Operation) SeedVersion() string

SeedVersion is a shorthand for the kubernetes version of the K8sSeedClient.

func (*Operation) ShootVersion

func (o *Operation) ShootVersion() string

ShootVersion is a shorthand for the desired kubernetes version of the operation's shoot.

Jump to

Keyboard shortcuts

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