diff --git a/api/v1alpha1/etcd.go b/api/v1alpha1/etcd.go index 5b3a2cfed..4b3079e1f 100644 --- a/api/v1alpha1/etcd.go +++ b/api/v1alpha1/etcd.go @@ -159,6 +159,9 @@ type BackupSpec struct { // All full snapshots beyond this limit will be garbage collected. // +optional MaxBackupsLimitBasedGC *int32 `json:"maxBackupsLimitBasedGC,omitempty"` + // FullSnapshotLeaseUpdateInterval defines the interval for retrying to update the full snapshot lease. + // +optional + FullSnapshotLeaseUpdateInterval *metav1.Duration `json:"fullSnapshotLeaseUpdateInterval,omitempty"` // GarbageCollectionPeriod defines the period for garbage collecting old backups // +optional GarbageCollectionPeriod *metav1.Duration `json:"garbageCollectionPeriod,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index a94f34e03..965e363b1 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -62,6 +62,11 @@ func (in *BackupSpec) DeepCopyInto(out *BackupSpec) { *out = new(int32) **out = **in } + if in.FullSnapshotLeaseUpdateInterval != nil { + in, out := &in.FullSnapshotLeaseUpdateInterval, &out.FullSnapshotLeaseUpdateInterval + *out = new(v1.Duration) + **out = **in + } if in.GarbageCollectionPeriod != nil { in, out := &in.GarbageCollectionPeriod, &out.GarbageCollectionPeriod *out = new(v1.Duration) diff --git a/charts/druid/charts/crds/templates/crd-druid.gardener.cloud_etcds.yaml b/charts/druid/charts/crds/templates/crd-druid.gardener.cloud_etcds.yaml index eec9d9c9f..c73ffc8e5 100644 --- a/charts/druid/charts/crds/templates/crd-druid.gardener.cloud_etcds.yaml +++ b/charts/druid/charts/crds/templates/crd-druid.gardener.cloud_etcds.yaml @@ -162,6 +162,10 @@ spec: description: EtcdSnapshotTimeout defines the timeout duration for etcd FullSnapshot operation type: string + fullSnapshotLeaseUpdateInterval: + description: FullSnapshotLeaseUpdateInterval defines the interval + for retrying to update the full snapshot lease. + type: string fullSnapshotSchedule: description: FullSnapshotSchedule defines the cron standard schedule for full snapshots. diff --git a/config/crd/bases/crd-druid.gardener.cloud_etcds.yaml b/config/crd/bases/crd-druid.gardener.cloud_etcds.yaml index eec9d9c9f..c73ffc8e5 100644 --- a/config/crd/bases/crd-druid.gardener.cloud_etcds.yaml +++ b/config/crd/bases/crd-druid.gardener.cloud_etcds.yaml @@ -162,6 +162,10 @@ spec: description: EtcdSnapshotTimeout defines the timeout duration for etcd FullSnapshot operation type: string + fullSnapshotLeaseUpdateInterval: + description: FullSnapshotLeaseUpdateInterval defines the interval + for retrying to update the full snapshot lease. + type: string fullSnapshotSchedule: description: FullSnapshotSchedule defines the cron standard schedule for full snapshots. diff --git a/internal/component/statefulset/builder.go b/internal/component/statefulset/builder.go index d1eca00a8..463302f12 100644 --- a/internal/component/statefulset/builder.go +++ b/internal/component/statefulset/builder.go @@ -501,6 +501,9 @@ func (b *stsBuilder) getBackupStoreCommandArgs() []string { if b.etcd.Spec.Backup.FullSnapshotSchedule != nil { commandArgs = append(commandArgs, fmt.Sprintf("--schedule=%s", *b.etcd.Spec.Backup.FullSnapshotSchedule)) } + if b.etcd.Spec.Backup.FullSnapshotLeaseUpdateInterval != nil { + commandArgs = append(commandArgs, fmt.Sprintf("--full-snapshot-lease-update-interval=%s", b.etcd.Spec.Backup.FullSnapshotLeaseUpdateInterval.Duration.String())) + } // Delta snapshot command line args // -----------------------------------------------------------------------------------------------------------------