Documentation
¶
Index ¶
- Constants
- func Add(mgr manager.Manager, args AddArgs) (*extensionswebhook.Webhook, error)
- func DetermineBackupSchedule(c *corev1.Container, cluster *extensionscontroller.Cluster) (string, error)
- func EnsureConfigMapChecksumAnnotation(ctx context.Context, template *corev1.PodTemplateSpec, c client.Client, ...) error
- func EnsureSecretChecksumAnnotation(ctx context.Context, template *corev1.PodTemplateSpec, c client.Client, ...) error
- func GetBackupRestoreContainer(name, volumeClaimTemplateName, schedule, provider, prefix, image string, ...) *corev1.Container
- func GetETCDVolumeClaimTemplate(name string, storageClassName *string, storageCapacity *resource.Quantity) *corev1.PersistentVolumeClaim
- func ParseExistingBackupSchedule(c *corev1.Container) string
- type AddArgs
- type FileContentInlineCodec
- type KubeletConfigCodec
- type UnitSerializer
Constants ¶
const ( // WebhookName is the webhook name. WebhookName = "controlplane" // ExposureWebhookName is the exposure webhook name. ExposureWebhookName = "controlplaneexposure" // BackupWebhookName is the backup webhook name. BackupWebhookName = "controlplanebackup" // KindSeed - A controlplane seed webhook is applied only to those shoot namespaces that have the correct Seed provider label. KindSeed = "seed" // KindShoot - A controlplane shoot webhook is applied only to those shoot namespaces that have the correct Shoot provider label. KindShoot = "shoot" // KindBackup - A controlplane backup webhook is applied only to those shoot namespaces that have the correct Backup provider label. KindBackup = "backup" )
const ( // EtcdMainVolumeClaimTemplateName is the name of the volume claim template in the etcd-main StatefulSet. It uses a // different naming scheme because Gardener was using HDD-based volumes for etcd in the past and did migrate to fast // SSD volumes recently. Due to the migration of the data of the old volume to the new one the PVC name is now different. EtcdMainVolumeClaimTemplateName = "main-etcd" // BackupRestoreContainerName is the name of the backup-restore sidecar injected in etcd StatefulSet. BackupRestoreContainerName = "backup-restore" )
Variables ¶
This section is empty.
Functions ¶
func DetermineBackupSchedule ¶
func DetermineBackupSchedule(c *corev1.Container, cluster *extensionscontroller.Cluster) (string, error)
DetermineBackupSchedule determines the backup schedule based on the shoot creation and maintenance time window.
func EnsureConfigMapChecksumAnnotation ¶
func EnsureConfigMapChecksumAnnotation(ctx context.Context, template *corev1.PodTemplateSpec, c client.Client, namespace, name string) error
EnsureConfigMapChecksumAnnotation ensures that the given pod template has an annotation containing the checksum of the configmap with the given name and namespace.
func EnsureSecretChecksumAnnotation ¶
func EnsureSecretChecksumAnnotation(ctx context.Context, template *corev1.PodTemplateSpec, c client.Client, namespace, name string) error
EnsureSecretChecksumAnnotation ensures that the given pod template has an annotation containing the checksum of the secret with the given name and namespace.
func GetBackupRestoreContainer ¶
func GetBackupRestoreContainer( name, volumeClaimTemplateName, schedule, provider, prefix, image string, args map[string]string, env []corev1.EnvVar, volumeMounts []corev1.VolumeMount, ) *corev1.Container
GetBackupRestoreContainer returns an etcd backup-restore container with the given name, schedule, provider, image, and additional provider-specific command line args and env variables.
func GetETCDVolumeClaimTemplate ¶
func GetETCDVolumeClaimTemplate(name string, storageClassName *string, storageCapacity *resource.Quantity) *corev1.PersistentVolumeClaim
GetETCDVolumeClaimTemplate returns an etcd backup-restore container with the given name, storageClass and storageCapacity.
func ParseExistingBackupSchedule ¶
ParseExistingBackupSchedule parse the backup container to get already configured schedule.
Types ¶
type AddArgs ¶
type AddArgs struct {
// Kind is the kind of this webhook
Kind string
// Provider is the provider of this webhook.
Provider string
// Types is a list of resource types.
Types []runtime.Object
// Mutator is a mutator to be used by the admission handler.
Mutator extensionswebhook.Mutator
}
AddArgs are arguments for adding a controlplane webhook to a manager.
type FileContentInlineCodec ¶
type FileContentInlineCodec interface {
// Encode encodes the given byte slice into a *extensionsv1alpha1.FileContentInline.
Encode([]byte, string) (*extensionsv1alpha1.FileContentInline, error)
// Decode decodes a byte slice from the given *extensionsv1alpha1.FileContentInline.
Decode(*extensionsv1alpha1.FileContentInline) ([]byte, error)
}
FileContentInlineCodec contains methods for encoding and decoding byte slices to and from *extensionsv1alpha1.FileContentInline.
func NewFileContentInlineCodec ¶
func NewFileContentInlineCodec() FileContentInlineCodec
NewFileContentInlineCodec creates an returns a new FileContentInlineCodec.
type KubeletConfigCodec ¶
type KubeletConfigCodec interface {
// Encode encodes the given *kubeletconfigv1beta1.KubeletConfiguration into a *extensionsv1alpha1.FileContentInline.
Encode(*kubeletconfigv1beta1.KubeletConfiguration, string) (*extensionsv1alpha1.FileContentInline, error)
// Decode decodes a *kubeletconfigv1beta1.KubeletConfiguration from the given *extensionsv1alpha1.FileContentInline.
Decode(*extensionsv1alpha1.FileContentInline) (*kubeletconfigv1beta1.KubeletConfiguration, error)
}
KubeletConfigCodec contains methods for encoding and decoding *kubeletconfigv1beta1.KubeletConfiguration objects to and from *extensionsv1alpha1.FileContentInline.
func NewKubeletConfigCodec ¶
func NewKubeletConfigCodec(fciCodec FileContentInlineCodec) KubeletConfigCodec
NewKubeletConfigCodec creates an returns a new KubeletConfigCodec.
type UnitSerializer ¶
type UnitSerializer interface {
// Serialize serializes the given slice of systemd unit options to a string.
Serialize([]*unit.UnitOption) (string, error)
// Deserialize deserializes a slice of systemd unit options from the given string.
Deserialize(string) ([]*unit.UnitOption, error)
}
UnitSerializer contains methods for serializing and deserializing a slice of systemd unit options to and from a string.
func NewUnitSerializer ¶
func NewUnitSerializer() UnitSerializer
NewUnitSerializer creates and returns a new UnitSerializer.