Documentation
¶
Index ¶
- Constants
- Variables
- func CentralLoggingConfiguration() (component.CentralLoggingConfig, error)
- func CheckEtcdObject(obj client.Object) error
- func GenerateClientServerCertificates(ctx context.Context, secretsManager secretsmanager.Interface, role string, ...) (*corev1.Secret, *corev1.Secret, *corev1.Secret, error)
- func GeneratePeerCertificates(ctx context.Context, secretsManager secretsmanager.Interface, role string, ...) (string, string, error)
- func Name(role string) string
- func NewBootstrapper(c client.Client, namespace string, ...) component.DeployWaiter
- func NewCRD(client client.Client, k8sVersion *semver.Version) (component.DeployWaiter, error)
- func NewDependencyWatchdogWeederConfiguration(role string) (map[string]weederapi.DependantSelectors, error)
- type AutoscalingConfig
- type BackupConfig
- type CRDGetter
- type Class
- type Interface
- type Values
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" )
const (
// Druid is a constant for the name of the etcd-druid.
Druid = "etcd-druid"
)
Variables ¶
var ( // 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 )
var ( // TimeNow is a function returning the current time exposed for testing. TimeNow = time.Now )
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 ¶
CheckEtcdObject checks if the given Etcd object was reconciled successfully.
func GenerateClientServerCertificates ¶ added in v1.115.0
func GenerateClientServerCertificates( ctx context.Context, secretsManager secretsmanager.Interface, role string, dnsNames []string, ipAddresses []net.IP, ) (*corev1.Secret, *corev1.Secret, *corev1.Secret, error)
GenerateClientServerCertificates generates client and server certificates for the etcd cluster.
func GeneratePeerCertificates ¶ added in v1.115.0
func GeneratePeerCertificates( ctx context.Context, secretsManager secretsmanager.Interface, role string, dnsNames []string, ipAddresses []net.IP, ) (string, string, error)
GeneratePeerCertificates generates the peer certificates for the etcd cluster.
func NewBootstrapper ¶
func NewBootstrapper( c client.Client, namespace string, etcdConfig *gardenletconfigv1alpha1.ETCDConfig, image string, imageVectorOverwrite *string, secretsManager secretsmanager.Interface, secretNameServerCA string, priorityClassName string, managedbyGardenerOperator bool, ) component.DeployWaiter
NewBootstrapper creates a new instance of DeployWaiter for the etcd bootstrapper.
func NewDependencyWatchdogWeederConfiguration ¶
func NewDependencyWatchdogWeederConfiguration(role string) (map[string]weederapi.DependantSelectors, error)
NewDependencyWatchdogWeederConfiguration returns the configuration for the dependency watchdog ensuring that its dependant pods are restarted as soon as it recovers from a crash loop.
Types ¶
type AutoscalingConfig ¶ added in v1.114.0
type AutoscalingConfig struct {
// MinAllowed are the minimum allowed resources for vertical autoscaling.
MinAllowed corev1.ResourceList
}
AutoscalingConfig contains information for configuring autoscaling settings for etcd.
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 *gardenletconfigv1alpha1.ETCDBackupLeaderElection
// DeltaSnapshotRetentionPeriod defines the duration for which delta snapshots will be retained, excluding the latest snapshot set.
DeltaSnapshotRetentionPeriod *metav1.Duration
}
BackupConfig contains information for configuring the backup-restore sidecar so that it takes regularly backups of the etcd's data directory.
type CRDGetter ¶ added in v1.116.1
type CRDGetter interface {
// GetAllCRDs returns a map of CRD names to CRD objects.
GetAllCRDs() map[string]*apiextensionsv1.CustomResourceDefinition
// GetCRD returns the CRD with the given name.
// An error is returned if no CRD is found with the given name.
GetCRD(name string) (*apiextensionsv1.CustomResourceDefinition, error)
// GetAllCRDsAsStringSlice returns all CRDs as Strings.
GetAllCRDsAsStringSlice() ([]string, error)
}
CRDGetter provides methods to get CRDs defined in etcd-druid.
type Interface ¶
type Interface interface {
component.DeployWaiter
// Snapshot triggers the backup-restore sidecar to perform a full snapshot in case backup configuration is provided.
Snapshot(context.Context, rest.HTTPClient) error
// SetBackupConfig sets the backup configuration.
SetBackupConfig(config *BackupConfig)
// Get retrieves the Etcd resource
Get(context.Context) (*druidcorev1alpha1.Etcd, error)
// 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
// GetValues returns the current configuration values of the deployer.
GetValues() Values
// GetReplicas gets the Replicas field in the Values.
GetReplicas() *int32
// SetReplicas sets the Replicas field in the Values.
SetReplicas(*int32)
}
Interface contains functions for a etcd deployer.
type Values ¶
type Values struct {
NamePrefix string
Role string
Class Class
Replicas *int32
StorageCapacity string
StorageClassName *string
DefragmentationSchedule *string
CARotationPhase gardencorev1beta1.CredentialsRotationPhase
Autoscaling AutoscalingConfig
RuntimeKubernetesVersion *semver.Version
BackupConfig *BackupConfig
MaintenanceTimeWindow gardencorev1beta1.MaintenanceTimeWindow
EvictionRequirement *string
PriorityClassName string
HighAvailabilityEnabled bool
TopologyAwareRoutingEnabled bool
RunsAsStaticPod bool
}
Values are the configuration values for the ETCD.