operation

package
v1.63.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IstioDefaultZoneKey is the label key for the istio default ingress gateway.
	IstioDefaultZoneKey = "istio"
)

Variables

This section is empty.

Functions

func GetIstioNamespaceForZone added in v1.63.0

func GetIstioNamespaceForZone(defaultNamespace string, zone string) string

GetIstioNamespaceForZone returns the namespace to use for a given zone. In case the zone name is too long the first five characters of the hash of the zone are used as zone identifiers.

func GetIstioZoneLabels added in v1.63.0

func GetIstioZoneLabels(labels map[string]string, zone *string) map[string]string

GetIstioZoneLabels returns the labels to be used for istio with the mandatory zone label set.

func IsZonalIstioExtension added in v1.63.0

func IsZonalIstioExtension(labels map[string]string) (bool, string)

IsZonalIstioExtension indicates whether the namespace related to the given labels is a zonal istio extension. It also returns the zone.

Types

type Builder added in v1.4.0

type Builder struct {
	// contains filtered or unexported fields
}

Builder is an object that builds Operation 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,
	gardenClient client.Client,
	seedClientSet kubernetes.Interface,
	shootClientMap clientmap.ClientMap,
) (
	*Operation,
	error,
)

Build initializes a new Operation object.

func (*Builder) WithConfig added in v1.4.0

func (b *Builder) WithConfig(cfg *config.GardenletConfiguration) *Builder

WithConfig sets the configFunc attribute at the Builder.

func (*Builder) WithGarden added in v1.4.0

func (b *Builder) WithGarden(g *garden.Garden) *Builder

WithGarden sets the gardenFunc attribute at the Builder.

func (*Builder) WithGardenClusterIdentity added in v1.8.0

func (b *Builder) WithGardenClusterIdentity(gardenClusterIdentity string) *Builder

WithGardenClusterIdentity sets the identity of the Garden cluster as attribute at the Builder.

func (*Builder) WithGardenFrom added in v1.4.0

func (b *Builder) WithGardenFrom(reader client.Reader, namespace string) *Builder

WithGardenFrom sets the gardenFunc attribute at the Builder which will build a new Garden object.

func (*Builder) WithGardenerInfo added in v1.4.0

func (b *Builder) WithGardenerInfo(gardenerInfo *gardencorev1beta1.Gardener) *Builder

WithGardenerInfo sets the gardenerInfoFunc attribute at the Builder.

func (*Builder) WithImageVector added in v1.4.0

func (b *Builder) WithImageVector(imageVector imagevector.ImageVector) *Builder

WithImageVector sets the imageVectorFunc attribute at the Builder.

func (*Builder) WithLogger added in v1.4.0

func (b *Builder) WithLogger(log logr.Logger) *Builder

WithLogger sets the loggerFunc attribute at the Builder.

func (*Builder) WithSecrets added in v1.4.0

func (b *Builder) WithSecrets(secrets map[string]*corev1.Secret) *Builder

WithSecrets sets the secretsFunc attribute at the Builder.

func (*Builder) WithSeed added in v1.4.0

func (b *Builder) WithSeed(s *seed.Seed) *Builder

WithSeed sets the seedFunc attribute at the Builder.

func (*Builder) WithSeedFrom added in v1.4.0

func (b *Builder) WithSeedFrom(gardenClient client.Reader, seedName string) *Builder

WithSeedFrom sets the seedFunc attribute at the Builder which will build a new Seed object.

func (*Builder) WithShoot added in v1.4.0

func (b *Builder) WithShoot(s *shootpkg.Shoot) *Builder

WithShoot sets the shootFunc attribute at the Builder.

func (*Builder) WithShootFromCluster added in v1.16.0

func (b *Builder) WithShootFromCluster(gardenClient client.Client, seedClientSet kubernetes.Interface, s *gardencorev1beta1.Shoot) *Builder

WithShootFromCluster sets the shootFunc attribute at the Builder which will build a new Shoot object constructed from the cluster resource. The shoot status is still taken from the passed `shoot`, though.

type Operation

type Operation struct {
	SecretsManager secretsmanager.Interface

	Config                *config.GardenletConfiguration
	Logger                logr.Logger
	GardenerInfo          *gardencorev1beta1.Gardener
	GardenClusterIdentity string
	ImageVector           imagevector.ImageVector
	Garden                *garden.Garden
	Seed                  *seed.Seed
	Shoot                 *shoot.Shoot
	ManagedSeed           *seedmanagementv1alpha1.ManagedSeed
	ManagedSeedAPIServer  *v1beta1helper.ManagedSeedAPIServer
	GardenClient          client.Client
	SeedClientSet         kubernetes.Interface
	ShootClientMap        clientmap.ClientMap
	ShootClientSet        kubernetes.Interface
	APIServerAddress      string
	APIServerClusterIP    string
	SeedNamespaceObject   *corev1.Namespace

	// ControlPlaneWildcardCert is a wildcard tls certificate which is issued for the seed's ingress domain.
	ControlPlaneWildcardCert *corev1.Secret
	// contains filtered or unexported fields
}

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

func (*Operation) AllSecretKeys added in v1.28.3

func (o *Operation) AllSecretKeys() []string

AllSecretKeys returns all stored secret keys from the operation. Calling this function is thread-safe.

func (*Operation) CleanShootTaskError

func (o *Operation) CleanShootTaskError(ctx context.Context, taskID string)

CleanShootTaskError removes the error with taskID from the Shoot's status.LastErrors array. If the status.LastErrors array is empty then status.LastErrors is also removed.

func (*Operation) ComputeAlertManagerHost

func (o *Operation) ComputeAlertManagerHost() string

ComputeAlertManagerHost computes the host for alert manager.

func (*Operation) ComputeAlertManagerHosts added in v0.34.0

func (o *Operation) ComputeAlertManagerHosts() []string

ComputeAlertManagerHosts computes the host for alert manager.

func (*Operation) ComputeGrafanaHosts

func (o *Operation) ComputeGrafanaHosts() []string

ComputeGrafanaHosts computes the host for both grafanas.

func (*Operation) ComputeGrafanaOperatorsHost

func (o *Operation) ComputeGrafanaOperatorsHost() string

ComputeGrafanaOperatorsHost computes the host for users Grafana.

func (*Operation) ComputeGrafanaUsersHost

func (o *Operation) ComputeGrafanaUsersHost() string

ComputeGrafanaUsersHost computes the host for operators Grafana.

func (*Operation) ComputeIngressHost

func (o *Operation) ComputeIngressHost(prefix string) string

ComputeIngressHost computes the host for a given prefix.

func (*Operation) ComputeLokiHost added in v1.27.0

func (o *Operation) ComputeLokiHost() string

ComputeLokiHost computes the host for loki.

func (*Operation) ComputeLokiHosts added in v1.27.0

func (o *Operation) ComputeLokiHosts() []string

ComputeLokiHosts computes the host for loki.

func (*Operation) ComputePrometheusHost

func (o *Operation) ComputePrometheusHost() string

ComputePrometheusHost computes the host for prometheus.

func (*Operation) ComputePrometheusHosts added in v0.34.0

func (o *Operation) ComputePrometheusHosts() []string

ComputePrometheusHosts computes the hosts for prometheus.

func (*Operation) DeleteClusterResourceFromSeed

func (o *Operation) DeleteClusterResourceFromSeed(ctx context.Context) error

DeleteClusterResourceFromSeed deletes the `Cluster` extension resource for the shoot in the seed cluster.

func (*Operation) DeleteSecret added in v1.28.3

func (o *Operation) DeleteSecret(key string)

DeleteSecret deleted the secret under the given key from the operation. Calling this function is thread-safe.

func (*Operation) DeleteShootState added in v1.24.0

func (o *Operation) DeleteShootState(ctx context.Context) error

DeleteShootState deletes the ShootState resource for the corresponding shoot.

func (*Operation) EnsureShootStateExists added in v1.2.0

func (o *Operation) EnsureShootStateExists(ctx context.Context) error

EnsureShootStateExists creates the ShootState resource for the corresponding shoot and updates the operations object

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) GetShootState added in v1.32.0

func (o *Operation) GetShootState() *gardencorev1alpha1.ShootState

GetShootState returns the shootstate resource of this Shoot in a concurrency safe way. This method should be used only for reading the data of the returned shootstate resource. The returned shootstate resource MUST NOT BE MODIFIED (except in test code) since this might interfere with other concurrent reads and writes. To properly update the shootstate resource of this Shoot use SaveGardenerResourceDataInShootState.

func (*Operation) InitializeDesiredShootClients added in v1.31.0

func (o *Operation) InitializeDesiredShootClients(ctx context.Context) error

InitializeDesiredShootClients 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. In contrast to InitializeShootClients, InitializeDesiredShootClients returns an error if the discovered version via the client does not match the desired Kubernetes version from the shoot spec. This is especially useful, if the client is initialized after a rolling update of the Kube-Apiserver and you want to ensure that the discovered version matches the expected version.

func (*Operation) InitializeShootClients

func (o *Operation) InitializeShootClients(ctx context.Context) 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) InjectSeedSeedImages

func (o *Operation) InjectSeedSeedImages(values map[string]interface{}, names ...string) (map[string]interface{}, error)

InjectSeedSeedImages injects images that shall run on the Seed and target the Seed's Kubernetes version.

func (*Operation) InjectSeedShootImages

func (o *Operation) InjectSeedShootImages(values map[string]interface{}, names ...string) (map[string]interface{}, error)

InjectSeedShootImages injects images that shall run on the Seed but target the Shoot's Kubernetes version.

func (*Operation) InjectShootShootImages

func (o *Operation) InjectShootShootImages(values map[string]interface{}, names ...string) (map[string]interface{}, error)

InjectShootShootImages injects images that shall run on the Shoot and target the Shoot's Kubernetes version.

func (*Operation) IsAPIServerRunning added in v1.7.0

func (o *Operation) IsAPIServerRunning(ctx context.Context) (bool, error)

IsAPIServerRunning checks if the API server of the Shoot currently running (not scaled-down/deleted).

func (*Operation) IsShootMonitoringEnabled added in v1.53.0

func (o *Operation) IsShootMonitoringEnabled() bool

IsShootMonitoringEnabled returns true if shoot monitoring is enabled and shoot is not of purpose testing.

func (*Operation) IstioLabels added in v1.63.0

func (o *Operation) IstioLabels() map[string]string

IstioLabels contain the labels to be used for the istio ingress gateway entities.

func (*Operation) IstioLoadBalancerAnnotations added in v1.63.0

func (o *Operation) IstioLoadBalancerAnnotations() map[string]string

IstioLoadBalancerAnnotations contain the annotation to be used for the istio ingress service load balancer.

func (*Operation) IstioNamespace added in v1.63.0

func (o *Operation) IstioNamespace() string

IstioNamespace is the currently used namespace of the istio ingress gateway, which is responsible for the shoot cluster.

func (*Operation) IstioServiceName added in v1.63.0

func (o *Operation) IstioServiceName() string

IstioServiceName is the currently used name of the istio ingress service, which is responsible for the shoot cluster.

func (*Operation) LoadSecret added in v1.28.3

func (o *Operation) LoadSecret(key string) *corev1.Secret

LoadSecret loads the secret under the given key from the operation. Calling this function is thread-safe. Be aware that the returned pointer and the underlying secret map refer to the same secret object. If you need to modify the returned secret, copy it first and store the changes via `StoreSecret`.

func (*Operation) ReportShootProgress

func (o *Operation) ReportShootProgress(ctx context.Context, 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) SaveGardenerResourceDataInShootState added in v1.32.0

func (o *Operation) SaveGardenerResourceDataInShootState(ctx context.Context, f func(*[]gardencorev1alpha1.GardenerResourceData) error) error

SaveGardenerResourceDataInShootState updates the shootstate resource of this Shoot in a concurrency safe way, using the given context and mutate function. The mutate function should modify the passed GardenerResourceData so that changes are persisted. This method is protected by a mutex, so only a single SaveGardenerResourceDataInShootState operation can be executed at any point in time.

func (*Operation) SeedVersion

func (o *Operation) SeedVersion() string

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

func (*Operation) SetShootState added in v1.32.0

func (o *Operation) SetShootState(shootState *gardencorev1alpha1.ShootState)

SetShootState sets the shootstate resource of this Shoot in a concurrency safe way. This method is not protected by a mutex and does not update the shootstate resource in the cluster and so should be used only in exceptional situations, or as a convenience in test code. The shootstate passed as a parameter MUST NOT BE MODIFIED after the call to SetShootState (except in test code) since this might interfere with other concurrent reads and writes. To properly update the shootstate resource of this Shoot use SaveGardenerResourceDataInShootState.

func (*Operation) ShootVersion

func (o *Operation) ShootVersion() string

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

func (*Operation) StoreSecret added in v1.28.3

func (o *Operation) StoreSecret(key string, secret *corev1.Secret)

StoreSecret stores the passed secret under the given key from the operation. Calling this function is thread-safe.

func (*Operation) ToAdvertisedAddresses added in v1.21.0

func (o *Operation) ToAdvertisedAddresses() []gardencorev1beta1.ShootAdvertisedAddress

ToAdvertisedAddresses returns list of advertised addresses on a Shoot cluster.

func (*Operation) UpdateAdvertisedAddresses added in v1.36.0

func (o *Operation) UpdateAdvertisedAddresses(ctx context.Context) error

UpdateAdvertisedAddresses updates the shoot.status.advertisedAddresses with the list of addresses on which the API server of the shoot is accessible.

func (*Operation) WantsGrafana added in v1.53.0

func (o *Operation) WantsGrafana() bool

WantsGrafana returns true if shoot is not of purpose testing and either shoot monitoring or loki is enabled.

Directories

Path Synopsis
component/backupentry/mock
Package backupentry is a generated GoMock package.
Package backupentry is a generated GoMock package.
component/clusterautoscaler/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/clusteridentity/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/coredns/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/etcd/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/etcdcopybackupstask/mock
Package etcdcopybackupstask is a generated GoMock package.
Package etcdcopybackupstask is a generated GoMock package.
component/extensions/backupentry/mock
Package backupentry is a generated GoMock package.
Package backupentry is a generated GoMock package.
component/extensions/containerruntime/mock
Package containerruntime is a generated GoMock package.
Package containerruntime is a generated GoMock package.
component/extensions/controlplane/mock
Package controlplane is a generated GoMock package.
Package controlplane is a generated GoMock package.
component/extensions/crds/assets
Package seed_crds contains generated manifests for all CRDs that are present on a Seed cluster.
Package seed_crds contains generated manifests for all CRDs that are present on a Seed cluster.
component/extensions/dnsrecord/mock
Package dnsrecord is a generated GoMock package.
Package dnsrecord is a generated GoMock package.
component/extensions/extension/mock
Package extension is a generated GoMock package.
Package extension is a generated GoMock package.
component/extensions/infrastructure/mock
Package infrastructure is a generated GoMock package.
Package infrastructure is a generated GoMock package.
component/extensions/operatingsystemconfig/mock
Package operatingsystemconfig is a generated GoMock package.
Package operatingsystemconfig is a generated GoMock package.
Package kubelet is a generated GoMock package.
component/extensions/operatingsystemconfig/original/components/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/extensions/operatingsystemconfig/utils/mock
Package utils is a generated GoMock package.
Package utils is a generated GoMock package.
component/extensions/worker/mock
Package worker is a generated GoMock package.
Package worker is a generated GoMock package.
component/hvpa/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/kubeapiserver/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/kubecontrollermanager/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/kubeproxy/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/kubernetesdashboard/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/kubescheduler/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/kubestatemetrics/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/nodelocaldns/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/resourcemanager/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/vpa/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/vpnseedserver/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
component/vpnshoot/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
matchers
this file is copy of https://github.com/kubernetes/kubernetes/blob/f247e75980061d7cf83c63c0fb1f12c7060c599f/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go with some modifications for the webhook matching use-case.
this file is copy of https://github.com/kubernetes/kubernetes/blob/f247e75980061d7cf83c63c0fb1f12c7060c599f/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go with some modifications for the webhook matching use-case.

Jump to

Keyboard shortcuts

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