Documentation ¶
Index ¶
- Constants
- Variables
- func CentralLoggingConfiguration() (component.CentralLoggingConfig, error)
- func CheckEtcdObject(obj client.Object) error
- func DependencyWatchdogEndpointConfiguration(role string) (map[string]restarterapi.Service, error)
- func GetLabels() map[string]string
- func NewBootstrapper(c client.Client, namespace string, config *config.GardenletConfiguration, ...) component.DeployWaiter
- func ServiceName(role string) string
- type BackupConfig
- type Class
- type HVPAConfig
- type Interface
- type OwnerCheckConfig
Constants ¶
const ( // ClassNormal is a constant for a normal etcd (without extensive metrics or higher resource settings, etc.) ClassNormal Class = "normal" // ClassImportant is a constant for an important etcd (with extensive metrics or higher resource settings, etc.). // Such etcds are also unsafe to evict (from the PoV of the cluster-autoscaler when trying to scale down). ClassImportant Class = "important" // SecretNameClient is the name of the secret containing the client certificate and key for the etcd. SecretNameClient = "etcd-client" // LabelAppValue is the value of a label whose key is 'app'. LabelAppValue = "etcd-statefulset" // NetworkPolicyNameClient is the name of a network policy that allows ingress traffic to etcd from certain sources. NetworkPolicyNameClient = "allow-etcd" // NetworkPolicyNamePeer is the name of a network policy that allows ingress traffic to etcd from member pods. NetworkPolicyNamePeer = "allow-etcd-peer" )
const ( // DefaultInterval is the default interval for retry operations. DefaultInterval = 5 * time.Second // DefaultSevereThreshold is the default threshold until an error reported by another component is treated as 'severe'. DefaultSevereThreshold = 3 * time.Minute // DefaultTimeout is the default timeout and defines how long Gardener should wait // for a successful reconciliation of an Etcd resource. DefaultTimeout = 5 * time.Minute )
const (
// Druid is a constant for the name of the etcd-druid.
Druid = "etcd-druid"
)
Variables ¶
var ( // TimeNow is a function returning the current time exposed for testing. TimeNow = time.Now // PortEtcdPeer is the port exposed by etcd for server-to-server communication. PortEtcdPeer = int32(2380) // PortEtcdClient is the port exposed by etcd for client communication. PortEtcdClient = int32(2379) // PortBackupRestore is the client port exposed by the backup-restore sidecar container. PortBackupRestore = int32(8080) )
var ( //go:embed crds/templates/crd-druid.gardener.cloud_etcds.yaml // CRD holds the etcd custom resource definition template CRD string )
var TimeoutWaitForManagedResource = 2 * time.Minute
TimeoutWaitForManagedResource is the timeout used while waiting for the ManagedResources to become healthy or deleted.
Functions ¶
func CentralLoggingConfiguration ¶
func CentralLoggingConfiguration() (component.CentralLoggingConfig, error)
CentralLoggingConfiguration returns a fluent-bit parser and filter for the etcd and backup-restore sidecar logs.
func CheckEtcdObject ¶ added in v1.25.0
CheckEtcdObject checks if the given Etcd object was reconciled successfully.
func DependencyWatchdogEndpointConfiguration ¶ added in v1.27.0
func DependencyWatchdogEndpointConfiguration(role string) (map[string]restarterapi.Service, error)
DependencyWatchdogEndpointConfiguration returns the configuration for the dependency watchdog ensuring that its dependant pods are restarted as soon as it recovers from a crash loop.
func GetLabels ¶ added in v1.49.0
GetLabels returns a set of labels that is common for all etcd resources.
func NewBootstrapper ¶
func NewBootstrapper(c client.Client, namespace string, config *config.GardenletConfiguration, image string, imageVectorOverwrite *string) component.DeployWaiter
NewBootstrapper creates a new instance of DeployWaiter for the etcd bootstrapper.
func ServiceName ¶
ServiceName returns the service name for an etcd for the given role.
Types ¶
type BackupConfig ¶
type BackupConfig struct { // Provider is the name of the infrastructure provider for the blob storage bucket. Provider string // Container is the name of the blob storage bucket. Container string // SecretRefName is the name of a Secret object containing the credentials of the selected infrastructure provider. SecretRefName string // Prefix is a prefix that shall be used for the filename of the backups of this etcd. Prefix string // FullSnapshotSchedule is a cron schedule that declares how frequent full snapshots shall be taken. FullSnapshotSchedule string // LeaderElection contains configuration for the leader election for the etcd backup-restore sidecar. LeaderElection *gardenletconfig.ETCDBackupLeaderElection }
BackupConfig contains information for configuring the backup-restore sidecar so that it takes regularly backups of the etcd's data directory.
type HVPAConfig ¶
type HVPAConfig struct { // Enabled states whether an HVPA object shall be deployed. Enabled bool // MaintenanceTimeWindow contains begin and end of a time window that allows down-scaling the etcd in case its // resource requests/limits are unnecessarily high. MaintenanceTimeWindow gardencorev1beta1.MaintenanceTimeWindow // The update mode to use for scale down. ScaleDownUpdateMode *string }
HVPAConfig contains information for configuring the HVPA object for the etcd.
type Interface ¶ added in v1.24.0
type Interface interface { component.DeployWaiter component.MonitoringComponent // Snapshot triggers the backup-restore sidecar to perform a full snapshot in case backup configuration is provided. Snapshot(context.Context, kubernetes.PodExecutor) error // SetBackupConfig sets the backup configuration. SetBackupConfig(config *BackupConfig) // SetHVPAConfig sets the HVPA configuration. SetHVPAConfig(config *HVPAConfig) // Get retrieves the Etcd resource Get(context.Context) (*druidv1alpha1.Etcd, error) // SetOwnerCheckConfig sets the owner check configuration. SetOwnerCheckConfig(config *OwnerCheckConfig) // Scale scales the etcd resource to the given replica count. Scale(context.Context, int32) error // RolloutPeerCA gets the peer CA and patches the // related `etcd` resource to use this new CA for peer communication. RolloutPeerCA(context.Context) error }
Interface contains functions for a etcd deployer.
func New ¶
func New( c client.Client, log logr.Logger, namespace string, secretsManager secretsmanager.Interface, role string, class Class, annotations map[string]string, failureToleranceType *gardencorev1beta1.FailureToleranceType, replicas *int32, storageCapacity string, defragmentationSchedule *string, caRotationPhase gardencorev1beta1.ShootCredentialsRotationPhase, k8sVersion string, ) Interface
New creates a new instance of DeployWaiter for the Etcd.
type OwnerCheckConfig ¶ added in v1.37.0
type OwnerCheckConfig struct { // Name is the domain name of the owner DNS record. Name string // ID is the seed ID value that is expected to be found in the owner DNS record. ID string }
OwnerCheckConfig contains parameters related to checking if the seed is an owner of the shoot. The ownership can change during control plane migration.