From dc5f8075f6b7291867b155a8d8c6692387db1610 Mon Sep 17 00:00:00 2001 From: Miles Garnsey <11435896+Miles-Garnsey@users.noreply.github.com> Date: Fri, 20 Oct 2023 01:25:53 +0900 Subject: [PATCH] Add settings to configure reaper HTTP management interface (#1082) * Add settings to configure reaper HTTP management interface. --------- Co-authored-by: Alexander Dejanovski --- .github/workflows/kind_e2e_tests.yaml | 4 -- .../kind_multicluster_e2e_tests.yaml | 4 -- ...ster_isolated_control_plane_e2e_tests.yaml | 4 -- apis/reaper/v1alpha1/reaper_types.go | 22 ++++-- apis/reaper/v1alpha1/zz_generated.deepcopy.go | 16 +++++ .../bases/k8ssandra.io_k8ssandraclusters.yaml | 28 ++++++-- .../bases/reaper.k8ssandra.io_reapers.yaml | 28 ++++++-- controllers/reaper/reaper_controller.go | 4 +- pkg/reaper/deployment.go | 8 ++- pkg/reaper/deployment_test.go | 21 ++++-- test/e2e/suite_test.go | 12 +++- .../test-servicemonitors/02-prometheus.yaml | 4 +- .../reaper-http-management/cassdc.yaml | 67 +++++++++++++++++++ .../reaper-http-management/kustomization.yaml | 7 ++ .../reaper-cql-secret.yaml | 9 +++ .../reaper-ui-secret.yaml | 9 +++ .../reaper-http-management/reaper.yaml | 25 +++++++ .../fixtures/single-dc-reaper/k8ssandra.yaml | 2 + 18 files changed, 234 insertions(+), 40 deletions(-) create mode 100644 test/testdata/fixtures/reaper-http-management/cassdc.yaml create mode 100644 test/testdata/fixtures/reaper-http-management/kustomization.yaml create mode 100644 test/testdata/fixtures/reaper-http-management/reaper-cql-secret.yaml create mode 100644 test/testdata/fixtures/reaper-http-management/reaper-ui-secret.yaml create mode 100644 test/testdata/fixtures/reaper-http-management/reaper.yaml diff --git a/.github/workflows/kind_e2e_tests.yaml b/.github/workflows/kind_e2e_tests.yaml index 70e970b8f..6ef1f0396 100644 --- a/.github/workflows/kind_e2e_tests.yaml +++ b/.github/workflows/kind_e2e_tests.yaml @@ -130,10 +130,6 @@ jobs: with: go-version-file: 'go.mod' cache: true - - name: Install kubectl - run: | - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - name: Install kustomize uses: imranismail/setup-kustomize@v2 with: diff --git a/.github/workflows/kind_multicluster_e2e_tests.yaml b/.github/workflows/kind_multicluster_e2e_tests.yaml index 0cc5319e5..3f0d10741 100644 --- a/.github/workflows/kind_multicluster_e2e_tests.yaml +++ b/.github/workflows/kind_multicluster_e2e_tests.yaml @@ -102,10 +102,6 @@ jobs: with: go-version-file: 'go.mod' cache: true - - name: Install kubectl - run: | - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - name: Install kustomize uses: imranismail/setup-kustomize@v2 with: diff --git a/.github/workflows/kind_multicluster_isolated_control_plane_e2e_tests.yaml b/.github/workflows/kind_multicluster_isolated_control_plane_e2e_tests.yaml index f71d51174..22ee7e005 100644 --- a/.github/workflows/kind_multicluster_isolated_control_plane_e2e_tests.yaml +++ b/.github/workflows/kind_multicluster_isolated_control_plane_e2e_tests.yaml @@ -80,10 +80,6 @@ jobs: with: go-version-file: 'go.mod' cache: true - - name: Install kubectl - run: | - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - name: Install kustomize uses: imranismail/setup-kustomize@v2 with: diff --git a/apis/reaper/v1alpha1/reaper_types.go b/apis/reaper/v1alpha1/reaper_types.go index fe6973dad..256a4ace7 100644 --- a/apis/reaper/v1alpha1/reaper_types.go +++ b/apis/reaper/v1alpha1/reaper_types.go @@ -67,15 +67,17 @@ type ReaperTemplate struct { SecretsProvider string `json:"secretsProvider,omitempty"` // The image to use for the Reaper pod main container. - // The default is "thelastpickle/cassandra-reaper:3.3.4". + // The default is "thelastpickle/cassandra-reaper:7162ea3". // +optional - // +kubebuilder:default={repository:"thelastpickle",name:"cassandra-reaper",tag:"3.3.4"} + // TODO: update with real release version. + // +kubebuilder:default={repository:"thelastpickle",name:"cassandra-reaper",tag:"7162ea3"} ContainerImage *images.Image `json:"containerImage,omitempty"` // The image to use for the Reaper pod init container (that performs schema migrations). - // The default is "thelastpickle/cassandra-reaper:3.3.4". + // The default is "thelastpickle/cassandra-reaper:7162ea3". // +optional - // +kubebuilder:default={repository:"thelastpickle",name:"cassandra-reaper",tag:"3.3.4"} + // TODO: update with real release version. + // +kubebuilder:default={repository:"thelastpickle",name:"cassandra-reaper",tag:"7162ea3"} InitContainerImage *images.Image `json:"initContainerImage,omitempty"` // +kubebuilder:default="default" @@ -139,6 +141,10 @@ type ReaperTemplate struct { // labels and annotations for Reaper resources // +optional ResourceMeta *meta.ResourceMeta `json:"metadata,omitempty"` + + // +kubebuilder:default={enabled: false} + // +optional + HttpManagement HttpManagement `json:"httpManagement"` } // UseExternalSecrets defines whether the user has specified if credentials and @@ -367,6 +373,14 @@ type Reaper struct { Status ReaperStatus `json:"status,omitempty"` } +type HttpManagement struct { + // Enable/disable the HTTP management connection between Reaper and Cassandra. + // When enabled, HTTP will be used instead of JMX for management connectivity between Cassandra + // and Reaper. In future, this will be true by default + // +kubebuilder:default=false + Enabled bool `json:"enabled"` +} + // +kubebuilder:object:root=true // ReaperList contains a list of Reaper diff --git a/apis/reaper/v1alpha1/zz_generated.deepcopy.go b/apis/reaper/v1alpha1/zz_generated.deepcopy.go index 5cf08c8da..aefcba36e 100644 --- a/apis/reaper/v1alpha1/zz_generated.deepcopy.go +++ b/apis/reaper/v1alpha1/zz_generated.deepcopy.go @@ -70,6 +70,21 @@ func (in *CassandraDatacenterRef) DeepCopy() *CassandraDatacenterRef { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HttpManagement) DeepCopyInto(out *HttpManagement) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HttpManagement. +func (in *HttpManagement) DeepCopy() *HttpManagement { + if in == nil { + return nil + } + out := new(HttpManagement) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Reaper) DeepCopyInto(out *Reaper) { *out = *in @@ -287,6 +302,7 @@ func (in *ReaperTemplate) DeepCopyInto(out *ReaperTemplate) { *out = new(meta.ResourceMeta) (*in).DeepCopyInto(*out) } + out.HttpManagement = in.HttpManagement } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReaperTemplate. diff --git a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml index e73575ad6..c08c840d1 100644 --- a/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml +++ b/config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml @@ -28402,9 +28402,10 @@ spec: default: name: cassandra-reaper repository: thelastpickle - tag: 3.3.4 - description: The image to use for the Reaper pod main container. - The default is "thelastpickle/cassandra-reaper:3.3.4". + tag: 7162ea3 + description: 'The image to use for the Reaper pod main container. + The default is "thelastpickle/cassandra-reaper:7162ea3". TODO: + update with real release version.' properties: name: description: The image name to use. @@ -28457,13 +28458,28 @@ spec: description: HeapSize sets the JVM heap size to use for Reaper. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true + httpManagement: + default: + enabled: false + properties: + enabled: + default: false + description: Enable/disable the HTTP management connection + between Reaper and Cassandra. When enabled, HTTP will be + used instead of JMX for management connectivity between + Cassandra and Reaper. In future, this will be true by default + type: boolean + required: + - enabled + type: object initContainerImage: default: name: cassandra-reaper repository: thelastpickle - tag: 3.3.4 - description: The image to use for the Reaper pod init container - (that performs schema migrations). The default is "thelastpickle/cassandra-reaper:3.3.4". + tag: 7162ea3 + description: 'The image to use for the Reaper pod init container + (that performs schema migrations). The default is "thelastpickle/cassandra-reaper:7162ea3". + TODO: update with real release version.' properties: name: description: The image name to use. diff --git a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml index 03461285d..903457d11 100644 --- a/config/crd/bases/reaper.k8ssandra.io_reapers.yaml +++ b/config/crd/bases/reaper.k8ssandra.io_reapers.yaml @@ -1046,9 +1046,10 @@ spec: default: name: cassandra-reaper repository: thelastpickle - tag: 3.3.4 - description: The image to use for the Reaper pod main container. The - default is "thelastpickle/cassandra-reaper:3.3.4". + tag: 7162ea3 + description: 'The image to use for the Reaper pod main container. + The default is "thelastpickle/cassandra-reaper:7162ea3". TODO: update + with real release version.' properties: name: description: The image name to use. @@ -1127,13 +1128,28 @@ spec: description: HeapSize sets the JVM heap size to use for Reaper. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true + httpManagement: + default: + enabled: false + properties: + enabled: + default: false + description: Enable/disable the HTTP management connection between + Reaper and Cassandra. When enabled, HTTP will be used instead + of JMX for management connectivity between Cassandra and Reaper. + In future, this will be true by default + type: boolean + required: + - enabled + type: object initContainerImage: default: name: cassandra-reaper repository: thelastpickle - tag: 3.3.4 - description: The image to use for the Reaper pod init container (that - performs schema migrations). The default is "thelastpickle/cassandra-reaper:3.3.4". + tag: 7162ea3 + description: 'The image to use for the Reaper pod init container (that + performs schema migrations). The default is "thelastpickle/cassandra-reaper:7162ea3". + TODO: update with real release version.' properties: name: description: The image name to use. diff --git a/controllers/reaper/reaper_controller.go b/controllers/reaper/reaper_controller.go index 5c3d4bf55..f419355fe 100644 --- a/controllers/reaper/reaper_controller.go +++ b/controllers/reaper/reaper_controller.go @@ -18,6 +18,7 @@ package reaper import ( "context" + "fmt" "github.com/go-logr/logr" cassdcapi "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" @@ -157,7 +158,7 @@ func (r *ReaperReconciler) reconcileDeployment( deploymentKey := types.NamespacedName{Namespace: actualReaper.Namespace, Name: actualReaper.Name} logger = logger.WithValues("Deployment", deploymentKey) - logger.Info("Reconciling Reaper Deployment") + logger.Info(fmt.Sprintf("Reconciling reaper deployment, req was %#v", actualReaper)) authVars, err := r.collectAuthVars(ctx, actualReaper, logger) if err != nil { @@ -190,6 +191,7 @@ func (r *ReaperReconciler) reconcileDeployment( return vectorReconcileResult, nil } + logger.Info("Reconciling reaper deployment", "actualReaper", actualReaper) desiredDeployment := reaper.NewDeployment(actualReaper, actualDc, keystorePassword, truststorePassword, logger, authVars...) actualDeployment := &appsv1.Deployment{} diff --git a/pkg/reaper/deployment.go b/pkg/reaper/deployment.go index d4148cde0..266813bb2 100644 --- a/pkg/reaper/deployment.go +++ b/pkg/reaper/deployment.go @@ -24,7 +24,7 @@ import ( const ( DefaultImageRepository = "thelastpickle" DefaultImageName = "cassandra-reaper" - DefaultVersion = "3.3.4" + DefaultVersion = "7162ea3" // When changing the default version above, please also change the kubebuilder markers in // apis/reaper/v1alpha1/reaper_types.go accordingly. @@ -152,6 +152,12 @@ func NewDeployment(reaper *api.Reaper, dc *cassdcapi.CassandraDatacenter, keysto Value: fmt.Sprintf("%d", reaper.Spec.HeapSize.Value()), }) } + if reaper.Spec.HttpManagement.Enabled { + envVars = append(envVars, corev1.EnvVar{ + Name: "REAPER_HTTP_MANAGEMENT_ENABLE", + Value: "true", + }) + } volumeMounts := []corev1.VolumeMount{} volumes := []corev1.Volume{} diff --git a/pkg/reaper/deployment_test.go b/pkg/reaper/deployment_test.go index 4150875ae..4cb5b3a13 100644 --- a/pkg/reaper/deployment_test.go +++ b/pkg/reaper/deployment_test.go @@ -28,6 +28,7 @@ func TestNewDeployment(t *testing.T) { reaper.Spec.AutoScheduling = reaperapi.AutoScheduling{Enabled: false} reaper.Spec.ServiceAccountName = "reaper" reaper.Spec.DatacenterAvailability = DatacenterAvailabilityAll + reaper.Spec.HttpManagement.Enabled = true reaper.Spec.ClientEncryptionStores = &encryption.Stores{ KeystoreSecretRef: &encryption.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{ Name: "keystore-secret", @@ -116,6 +117,10 @@ func TestNewDeployment(t *testing.T) { Name: "REAPER_CASS_NATIVE_PROTOCOL_SSL_ENCRYPTION_ENABLED", Value: "true", }, + { + Name: "REAPER_HTTP_MANAGEMENT_ENABLE", + Value: "true", + }, }) assert.Len(t, podSpec.InitContainers, 1) @@ -156,6 +161,10 @@ func TestNewDeployment(t *testing.T) { Name: "REAPER_CASS_NATIVE_PROTOCOL_SSL_ENCRYPTION_ENABLED", Value: "true", }, + { + Name: "REAPER_HTTP_MANAGEMENT_ENABLE", + Value: "true", + }, }) assert.ElementsMatch(t, initContainer.Args, []string{"schema-migration"}) @@ -177,7 +186,7 @@ func TestNewDeployment(t *testing.T) { deployment = NewDeployment(reaper, newTestDatacenter(), nil, nil, logger) podSpec = deployment.Spec.Template.Spec container = podSpec.Containers[0] - assert.Len(t, container.Env, 6) + assert.Len(t, container.Env, 7) assert.Contains(t, container.Env, corev1.EnvVar{ Name: "REAPER_CASS_KEYSPACE", @@ -188,7 +197,7 @@ func TestNewDeployment(t *testing.T) { deployment = NewDeployment(reaper, newTestDatacenter(), nil, nil, logger) podSpec = deployment.Spec.Template.Spec container = podSpec.Containers[0] - assert.Len(t, container.Env, 16) + assert.Len(t, container.Env, 17) assert.Contains(t, container.Env, corev1.EnvVar{ Name: "REAPER_AUTO_SCHEDULING_ADAPTIVE", @@ -302,8 +311,8 @@ func TestImages(t *testing.T) { reaper.Spec.ContainerImage = nil logger := testlogr.NewTestLogger(t) deployment := NewDeployment(reaper, newTestDatacenter(), nil, nil, logger) - assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.3.4", deployment.Spec.Template.Spec.InitContainers[0].Image) - assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.3.4", deployment.Spec.Template.Spec.Containers[0].Image) + assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:7162ea3", deployment.Spec.Template.Spec.InitContainers[0].Image) + assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:7162ea3", deployment.Spec.Template.Spec.Containers[0].Image) assert.Equal(t, corev1.PullIfNotPresent, deployment.Spec.Template.Spec.InitContainers[0].ImagePullPolicy) assert.Equal(t, corev1.PullIfNotPresent, deployment.Spec.Template.Spec.Containers[0].ImagePullPolicy) assert.Empty(t, deployment.Spec.Template.Spec.ImagePullSecrets) @@ -318,8 +327,8 @@ func TestImages(t *testing.T) { reaper.Spec.ContainerImage = nil logger := testlogr.NewTestLogger(t) deployment := NewDeployment(reaper, newTestDatacenter(), nil, nil, logger) - assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.3.4", deployment.Spec.Template.Spec.InitContainers[0].Image) - assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:3.3.4", deployment.Spec.Template.Spec.Containers[0].Image) + assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:7162ea3", deployment.Spec.Template.Spec.InitContainers[0].Image) + assert.Equal(t, "docker.io/thelastpickle/cassandra-reaper:7162ea3", deployment.Spec.Template.Spec.Containers[0].Image) assert.Equal(t, corev1.PullIfNotPresent, deployment.Spec.Template.Spec.InitContainers[0].ImagePullPolicy) assert.Equal(t, corev1.PullIfNotPresent, deployment.Spec.Template.Spec.Containers[0].ImagePullPolicy) assert.Empty(t, deployment.Spec.Template.Spec.ImagePullSecrets) diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index fd2f3a483..86d3a5904 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -247,8 +247,10 @@ func TestOperator(t *testing.T) { fixture: framework.NewTestFixture("multi-dc-stargate", controlPlane), })) t.Run("CreateSingleReaper", e2eTest(ctx, &e2eTestOpts{ - testFunc: createSingleReaper, - fixture: framework.NewTestFixture("single-dc-reaper", controlPlane), + testFunc: createSingleReaper, + fixture: framework.NewTestFixture("single-dc-reaper", controlPlane), + skipK8ssandraClusterCleanup: false, + doCassandraDatacenterCleanup: true, })) t.Run("CreateMultiReaper", e2eTest(ctx, &e2eTestOpts{ testFunc: createMultiReaper, @@ -260,6 +262,12 @@ func TestOperator(t *testing.T) { skipK8ssandraClusterCleanup: true, doCassandraDatacenterCleanup: true, })) + t.Run("CreateReaperHttpManagement", e2eTest(ctx, &e2eTestOpts{ + testFunc: createReaperAndDatacenter, // same as above, ensure we can trigger repair. Only difference is that we use a fixture which enabled the HTTP management interface. + fixture: framework.NewTestFixture("reaper-http-management", dataPlanes[0]), + skipK8ssandraClusterCleanup: true, + doCassandraDatacenterCleanup: true, + })) t.Run("ClusterScoped", func(t *testing.T) { t.Run("MultiDcMultiCluster", e2eTest(ctx, &e2eTestOpts{ testFunc: multiDcMultiCluster, diff --git a/test/kuttl/test-servicemonitors/02-prometheus.yaml b/test/kuttl/test-servicemonitors/02-prometheus.yaml index a381a91d9..2b0ae0300 100644 --- a/test/kuttl/test-servicemonitors/02-prometheus.yaml +++ b/test/kuttl/test-servicemonitors/02-prometheus.yaml @@ -2,7 +2,7 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - script: | - kustomize build ./config/prometheus | kubectl apply --server-side -f - + kustomize build ./config/prometheus | kubectl apply --server-side --force-conflicts -f - ignoreFailure: true - script: | until kubectl get crd servicemonitors.monitoring.coreos.com; do sleep 5; done @@ -11,5 +11,5 @@ commands: until kubectl get crd prometheuses.monitoring.coreos.com; do sleep 5; done ignoreFailure: true - script: | - kustomize build ./config/prometheus | kubectl apply --server-side -f - + kustomize build ./config/prometheus | kubectl apply --server-side --force-conflicts -f - ignoreFailure: false \ No newline at end of file diff --git a/test/testdata/fixtures/reaper-http-management/cassdc.yaml b/test/testdata/fixtures/reaper-http-management/cassdc.yaml new file mode 100644 index 000000000..995d41b82 --- /dev/null +++ b/test/testdata/fixtures/reaper-http-management/cassdc.yaml @@ -0,0 +1,67 @@ +apiVersion: cassandra.datastax.com/v1beta1 +kind: CassandraDatacenter +metadata: + name: dc1 +spec: + clusterName: test + config: + cassandra-yaml: + auto_snapshot: false + commitlog_segment_size_in_mb: 2 + compaction_throughput_mb_per_sec: 0 + concurrent_compactors: 1 + concurrent_counter_writes: 2 + concurrent_reads: 2 + concurrent_writes: 2 + counter_cache_size_in_mb: 0 + key_cache_size_in_mb: 0 + memtable_flush_writers: 1 + prepared_statements_cache_size_mb: 1 + slow_query_log_timeout_in_ms: 0 + sstable_preemptive_open_interval_in_mb: 0 + thrift_prepared_statements_cache_size_mb: 1 + authenticator: PasswordAuthenticator + authorizer: CassandraAuthorizer + role_manager: CassandraRoleManager + jvm-options: + additional-jvm-opts: + - -Dcassandra.system_distributed_replication_dc_names=dc1 + - -Dcassandra.system_distributed_replication_per_dc=1 + - -Dcassandra.jmx.remote.login.config=CassandraLogin + - -Djava.security.auth.login.config=/etc/cassandra/cassandra-jaas.config + - -Dcassandra.jmx.authorizer=org.apache.cassandra.auth.jmx.AuthorizationProxy + initial_heap_size: 512m + max_heap_size: 512m + users: + - secretName: reaper-cql-secret + superuser: true + serverType: cassandra + serverVersion: 3.11.14 + networking: + hostNetwork: false + size: 3 + racks: + - name: rack1 + nodeAffinityLabels: + "topology.kubernetes.io/zone": region1-zone1 + - name: rack2 + nodeAffinityLabels: + "topology.kubernetes.io/zone": region1-zone2 + - name: rack3 + nodeAffinityLabels: + "topology.kubernetes.io/zone": region1-zone3 + storageConfig: + cassandraDataVolumeClaimSpec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + storageClassName: standard + podTemplateSpec: + spec: + containers: + - name: cassandra + env: + - name: "LOCAL_JMX" + value: "no" diff --git a/test/testdata/fixtures/reaper-http-management/kustomization.yaml b/test/testdata/fixtures/reaper-http-management/kustomization.yaml new file mode 100644 index 000000000..d9a67628b --- /dev/null +++ b/test/testdata/fixtures/reaper-http-management/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - cassdc.yaml + - reaper.yaml + - reaper-cql-secret.yaml + - reaper-ui-secret.yaml diff --git a/test/testdata/fixtures/reaper-http-management/reaper-cql-secret.yaml b/test/testdata/fixtures/reaper-http-management/reaper-cql-secret.yaml new file mode 100644 index 000000000..8a7f3cd48 --- /dev/null +++ b/test/testdata/fixtures/reaper-http-management/reaper-cql-secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: reaper-cql-secret +data: + # username: reaper-cql + username: cmVhcGVyLWNxbA== + # password: R3ap3r + password: UjNhcDNy diff --git a/test/testdata/fixtures/reaper-http-management/reaper-ui-secret.yaml b/test/testdata/fixtures/reaper-http-management/reaper-ui-secret.yaml new file mode 100644 index 000000000..ce834f56e --- /dev/null +++ b/test/testdata/fixtures/reaper-http-management/reaper-ui-secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: reaper-ui-secret +data: + # username: reaper-ui + username: cmVhcGVyLWpteA== + # password: R3ap3r + password: UjNhcDNy diff --git a/test/testdata/fixtures/reaper-http-management/reaper.yaml b/test/testdata/fixtures/reaper-http-management/reaper.yaml new file mode 100644 index 000000000..d12e21c2a --- /dev/null +++ b/test/testdata/fixtures/reaper-http-management/reaper.yaml @@ -0,0 +1,25 @@ +apiVersion: reaper.k8ssandra.io/v1alpha1 +kind: Reaper +metadata: + name: reaper1 +spec: + httpManagement: + enabled: true + datacenterRef: + # TODO check multi-namespace when cluster-scope is ready + name: dc1 + cassandraUserSecretRef: + name: reaper-cql-secret + uiUserSecretRef: + name: reaper-ui-secret + containerImage: + repository: thelastpickle + name: cassandra-reaper + tag: "3.0.0" + pullPolicy: Always + initContainerImage: + repository: thelastpickle + name: cassandra-reaper + tag: "3.0.0" + pullPolicy: IfNotPresent + heapSize: 256Mi diff --git a/test/testdata/fixtures/single-dc-reaper/k8ssandra.yaml b/test/testdata/fixtures/single-dc-reaper/k8ssandra.yaml index d771263c9..92d392629 100644 --- a/test/testdata/fixtures/single-dc-reaper/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc-reaper/k8ssandra.yaml @@ -4,6 +4,8 @@ metadata: name: test spec: reaper: + httpManagement: + enabled: true heapSize: 256Mi autoScheduling: enabled: false