From 8ac8b1c8d15f11ea96c4d7183531cd4ce7156ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Mr=C3=B3z?= Date: Fri, 15 Nov 2024 14:59:21 +0100 Subject: [PATCH] Move reaper's skipSchemaMigration to ReaperTemplate This way it should be available in both Reaper.spec and K8ssandraCluster.spec.reaper --- CHANGELOG/CHANGELOG-1.21.md | 1 + apis/reaper/v1alpha1/reaper_types.go | 16 ++++++++-------- .../crds/k8ssandra-operator-crds.yaml | 8 ++++++++ .../bases/k8ssandra.io_k8ssandraclusters.yaml | 8 ++++++++ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/CHANGELOG/CHANGELOG-1.21.md b/CHANGELOG/CHANGELOG-1.21.md index 4ddc03a96..9997365d9 100644 --- a/CHANGELOG/CHANGELOG-1.21.md +++ b/CHANGELOG/CHANGELOG-1.21.md @@ -16,3 +16,4 @@ When cutting a new release, update the `unreleased` heading to the tag being gen ## unreleased * [BUGFIX] [#1383](https://github.com/k8ssandra/k8ssandra-operator/issues/1383) Do not create MedusaBackup if MadusaBakupJob did not fully succeed +* [ENHANCEMENT] [#1667](https://github.com/k8ssahttps://github.com/k8ssandra/k8ssandra/issues/1667) Add `skipSchemaMigration` option to `K8ssandraCluster.spec.reaper` diff --git a/apis/reaper/v1alpha1/reaper_types.go b/apis/reaper/v1alpha1/reaper_types.go index 5b33dc060..fda1feef5 100644 --- a/apis/reaper/v1alpha1/reaper_types.go +++ b/apis/reaper/v1alpha1/reaper_types.go @@ -160,6 +160,14 @@ type ReaperTemplate struct { // +kubebuilder:default={enabled: false} // +optional HttpManagement HttpManagement `json:"httpManagement"` + + // Whether to skip schema migration. Schema migration is done in an init container on every Reaper deployment and + // can slow down Reaper's startup time. Besides, schema migration requires reading data at QUORUM. It can be skipped + // if you know that the schema is already up-to-date, or if you know upfront that QUORUM cannot be achieved (for + // example, because a DC is down). + // +optional + // +kubebuilder:default=false + SkipSchemaMigration bool `json:"skipSchemaMigration,omitempty"` } // UseExternalSecrets defines whether the user has specified if credentials and @@ -290,14 +298,6 @@ type ReaperSpec struct { // Client encryption stores which are used by Cassandra and Reaper. // +optional ClientEncryptionStores *encryption.Stores `json:"clientEncryptionStores,omitempty"` - - // Whether to skip schema migration. Schema migration is done in an init container on every Reaper deployment and - // can slow down Reaper's startup time. Besides, schema migration requires reading data at QUORUM. It can be skipped - // if you know that the schema is already up-to-date, or if you know upfront that QUORUM cannot be achieved (for - // example, because a DC is down). - // +optional - // +kubebuilder:default=false - SkipSchemaMigration bool `json:"skipSchemaMigration,omitempty"` } // ReaperProgress is a word summarizing the state of a Reaper resource. diff --git a/charts/k8ssandra-operator/crds/k8ssandra-operator-crds.yaml b/charts/k8ssandra-operator/crds/k8ssandra-operator-crds.yaml index 244e42f65..db9f5e04b 100644 --- a/charts/k8ssandra-operator/crds/k8ssandra-operator-crds.yaml +++ b/charts/k8ssandra-operator/crds/k8ssandra-operator-crds.yaml @@ -28730,6 +28730,14 @@ spec: type: string type: object type: object + skipSchemaMigration: + default: false + description: |- + Whether to skip schema migration. Schema migration is done in an init container on every Reaper deployment and + can slow down Reaper's startup time. Besides, schema migration requires reading data at QUORUM. It can be skipped + if you know that the schema is already up-to-date, or if you know upfront that QUORUM cannot be achieved (for + example, because a DC is down). + type: boolean storageConfig: description: |- If StorageType is "local", Reaper will need a Persistent Volume to persist its data. This field allows diff --git a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml index 49a466754..4bccdf4bd 100644 --- a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml +++ b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml @@ -28668,6 +28668,14 @@ spec: type: string type: object type: object + skipSchemaMigration: + default: false + description: |- + Whether to skip schema migration. Schema migration is done in an init container on every Reaper deployment and + can slow down Reaper's startup time. Besides, schema migration requires reading data at QUORUM. It can be skipped + if you know that the schema is already up-to-date, or if you know upfront that QUORUM cannot be achieved (for + example, because a DC is down). + type: boolean storageConfig: description: |- If StorageType is "local", Reaper will need a Persistent Volume to persist its data. This field allows