From d28e342cb95ce1214e841e6353d5e79c64ac9930 Mon Sep 17 00:00:00 2001 From: Alexander Dejanovski Date: Thu, 6 Jun 2024 10:15:28 +0200 Subject: [PATCH] Fix HCD support and add e2e test (#1341) --- .github/workflows/kind_e2e_tests.yaml | 1 + CHANGELOG/CHANGELOG-1.17.md | 3 +- .../v1alpha1/cassandraconfig_types.go | 102 +++++++++--------- pkg/cassandra/config.go | 2 +- pkg/cassandra/config_premarshal_test.go | 35 ++++++ pkg/cassandra/config_test.go | 10 -- test/e2e/dse_test.go | 27 +++++ test/e2e/suite_test.go | 29 +++-- test/framework/e2e_framework.go | 9 +- .../fixtures/add-dc-cass-only/k8ssandra.yaml | 1 + test/testdata/fixtures/add-dc/k8ssandra.yaml | 1 + .../fixtures/add-external-dc/cassdc1.yaml | 1 + .../fixtures/add-external-dc/k8ssandra2.yaml | 1 + .../fixtures/gc/3.11-jdk8-CMS/k8ssandra.yaml | 1 + .../fixtures/gc/3.11-jdk8-G1/k8ssandra.yaml | 1 + .../fixtures/gc/4.0-jdk11-CMS/k8ssandra.yaml | 1 + .../fixtures/gc/4.0-jdk11-G1/k8ssandra.yaml | 1 + .../fixtures/gc/4.0-jdk11-ZGC/k8ssandra.yaml | 1 + .../fixtures/multi-dc-auth/k8ssandra.yaml | 1 + .../multi-dc-cluster-scope/k8ssandra.yaml | 1 + .../multi-dc-encryption-medusa/k8ssandra.yaml | 1 + .../multi-dc-encryption-reaper/k8ssandra.yaml | 1 + .../k8ssandra.yaml | 1 + .../multi-dc-initial-tokens/k8ssandra.yaml | 1 + .../fixtures/multi-dc-mixed/k8ssandra.yaml | 1 + .../fixtures/multi-dc-reaper/k8ssandra.yaml | 1 + .../fixtures/multi-dc-stargate/k8ssandra.yaml | 1 + .../testdata/fixtures/multi-dc/k8ssandra.yaml | 1 + .../fixtures/multi-stargate/cassdc.yaml | 1 + test/testdata/fixtures/reaper/cassdc.yaml | 1 + .../fixtures/remove-dc/k8ssandra.yaml | 1 + .../fixtures/remove-local-dc/k8ssandra.yaml | 1 + .../k8ssandra.yaml | 1 + .../k8ssandra.yaml | 1 + .../k8ssandra.yaml | 1 + .../fixtures/single-dc-hcd/k8ssandra.yaml | 35 ++++++ .../fixtures/single-dc-hcd/kustomization.yaml | 4 + .../k8ssandra.yaml | 1 + .../single-dc-per-node-config/k8ssandra.yaml | 1 + .../fixtures/single-dc-reaper/k8ssandra.yaml | 1 + .../fixtures/single-dc-upgrade/k8ssandra.yaml | 1 + .../fixtures/single-dc/k8ssandra.yaml | 1 + .../fixtures/stargate-jwt/k8ssandra.yaml | 1 + .../stargate-reaper-http/k8ssandra.yaml | 1 + test/testdata/fixtures/stargate/cassdc.yaml | 1 + test/testdata/fixtures/stop-dc/k8ssandra.yaml | 1 + 46 files changed, 214 insertions(+), 78 deletions(-) create mode 100644 test/testdata/fixtures/single-dc-hcd/k8ssandra.yaml create mode 100644 test/testdata/fixtures/single-dc-hcd/kustomization.yaml diff --git a/.github/workflows/kind_e2e_tests.yaml b/.github/workflows/kind_e2e_tests.yaml index f52115d85..27d5d4c99 100644 --- a/.github/workflows/kind_e2e_tests.yaml +++ b/.github/workflows/kind_e2e_tests.yaml @@ -99,6 +99,7 @@ jobs: - CreateSingleDseDatacenterCluster - CreateSingleDseSearchDatacenterCluster - CreateSingleDseGraphDatacenterCluster + - CreateSingleHcdDatacenterCluster - ChangeDseWorkload - PerNodeConfig/UserDefined - RemoveLocalDcFromCluster diff --git a/CHANGELOG/CHANGELOG-1.17.md b/CHANGELOG/CHANGELOG-1.17.md index 470adb8a9..7fb62ce6e 100644 --- a/CHANGELOG/CHANGELOG-1.17.md +++ b/CHANGELOG/CHANGELOG-1.17.md @@ -21,4 +21,5 @@ When cutting a new release, update the `unreleased` heading to the tag being gen * [BUGFIX] [#1316](https://github.com/k8ssandra/k8ssandra-operator/issues/1316) Fix interchanged intervals and timeouts in tests. * [BUGFIX] [#1322](https://github.com/k8ssandra/k8ssandra-operator/issues/1322) Fix bug where server-system-logger customisations from the Containers field would be overwritten when vector was enabled. * [FEATURE] Add support for HCD 1.0 -* [ENHANCEMENT] [#1329](https://github.com/k8ssandra/k8ssandra-operator/issues/1329) Add config emptyDir volume mount on Reaper deployment to allow read only root FS \ No newline at end of file +* [ENHANCEMENT] [#1329](https://github.com/k8ssandra/k8ssandra-operator/issues/1329) Add config emptyDir volume mount on Reaper deployment to allow read only root FS +* [BUGFIX] Fix HCD jvm options generation \ No newline at end of file diff --git a/apis/k8ssandra/v1alpha1/cassandraconfig_types.go b/apis/k8ssandra/v1alpha1/cassandraconfig_types.go index 031eef5ef..0a6db9821 100644 --- a/apis/k8ssandra/v1alpha1/cassandraconfig_types.go +++ b/apis/k8ssandra/v1alpha1/cassandraconfig_types.go @@ -51,14 +51,14 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Xms. // +optional - InitialHeapSize *resource.Quantity `json:"heap_initial_size,omitempty" cass-config:"^3.11.x:jvm-options/initial_heap_size;>=4.x,dse@>=6.8.x:jvm-server-options/initial_heap_size"` + InitialHeapSize *resource.Quantity `json:"heap_initial_size,omitempty" cass-config:"^3.11.x:jvm-options/initial_heap_size;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/initial_heap_size"` // Disabled by default. // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Xmx. // +optional - MaxHeapSize *resource.Quantity `json:"heap_max_size,omitempty" cass-config:"^3.11.x:jvm-options/max_heap_size;>=4.x,dse@>=6.8.x:jvm-server-options/max_heap_size"` + MaxHeapSize *resource.Quantity `json:"heap_max_size,omitempty" cass-config:"^3.11.x:jvm-options/max_heap_size;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/max_heap_size"` // GENERAL VM OPTIONS @@ -68,7 +68,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -ea. // +optional - EnableAssertions *bool `json:"vm_enable_assertions,omitempty" cass-config:"^3.11.x:jvm-options/enable_assertions;>=4.x,dse@>=6.8.x:jvm-server-options/enable_assertions"` + EnableAssertions *bool `json:"vm_enable_assertions,omitempty" cass-config:"^3.11.x:jvm-options/enable_assertions;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/enable_assertions"` // Enable thread priorities. // Enabled by default. @@ -76,7 +76,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+UseThreadPriorities. // +optional - EnableThreadPriorities *bool `json:"vm_enable_thread_priorities,omitempty" cass-config:"^3.11.x:jvm-options/use_thread_priorities;>=4.x,dse@>=6.8.x:jvm-server-options/use_thread_priorities"` + EnableThreadPriorities *bool `json:"vm_enable_thread_priorities,omitempty" cass-config:"^3.11.x:jvm-options/use_thread_priorities;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/use_thread_priorities"` // Enable lowering thread priority without being root on linux. // See CASSANDRA-1181 for details. @@ -91,7 +91,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+HeapDumpOnOutOfMemoryError. // +optional - HeapDumpOnOutOfMemoryError *bool `json:"vm_heap_dump_on_out_of_memory_error,omitempty" cass-config:"^3.11.x:jvm-options/heap_dump_on_out_of_memory_error;>=4.x,dse@>=6.8.x:jvm-server-options/heap_dump_on_out_of_memory_error"` + HeapDumpOnOutOfMemoryError *bool `json:"vm_heap_dump_on_out_of_memory_error,omitempty" cass-config:"^3.11.x:jvm-options/heap_dump_on_out_of_memory_error;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/heap_dump_on_out_of_memory_error"` // Per-thread stack size. // Defaults to 256Ki. @@ -99,7 +99,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Xss. // +optional - PerThreadStackSize *resource.Quantity `json:"vm_per_thread_stack_size,omitempty" cass-config:"^3.11.x:jvm-options/per_thread_stack_size;>=4.x,dse@>=6.8.x:jvm-server-options/per_thread_stack_size"` + PerThreadStackSize *resource.Quantity `json:"vm_per_thread_stack_size,omitempty" cass-config:"^3.11.x:jvm-options/per_thread_stack_size;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/per_thread_stack_size"` // The size of interned string table. Larger sizes are beneficial to gossip. // Defaults to 1000003. @@ -107,7 +107,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:StringTableSize. // +optional - StringTableSize *resource.Quantity `json:"vm_string_table_size,omitempty" cass-config:"^3.11.x:jvm-options/string_table_size;>=4.x,dse@>=6.8.x:jvm-server-options/string_table_size"` + StringTableSize *resource.Quantity `json:"vm_string_table_size,omitempty" cass-config:"^3.11.x:jvm-options/string_table_size;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/string_table_size"` // Ensure all memory is faulted and zeroed on startup. // Enabled by default. @@ -115,7 +115,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+AlwaysPreTouch. // +optional - AlwaysPreTouch *bool `json:"vm_always_pre_touch,omitempty" cass-config:"^3.11.x:jvm-options/always_pre_touch;>=4.x,dse@>=6.8.x:jvm-server-options/always_pre_touch"` + AlwaysPreTouch *bool `json:"vm_always_pre_touch,omitempty" cass-config:"^3.11.x:jvm-options/always_pre_touch;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/always_pre_touch"` // Disable biased locking to avoid biased lock revocation pauses. // Disabled by default. @@ -125,7 +125,7 @@ type JvmOptions struct { // Note: the Cass Config Builder option is named use_biased_locking, but setting it to true // disables biased locking. // +optional - DisableBiasedLocking *bool `json:"vm_disable_biased_locking,omitempty" cass-config:"^3.11.x:jvm-options/use_biased_locking;>=4.x,dse@>=6.8.x:jvm-server-options/use-biased-locking"` + DisableBiasedLocking *bool `json:"vm_disable_biased_locking,omitempty" cass-config:"^3.11.x:jvm-options/use_biased_locking;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/use-biased-locking"` // Enable thread-local allocation blocks. // Enabled by default. @@ -133,7 +133,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+UseTLAB. // +optional - UseTlab *bool `json:"vm_use_tlab,omitempty" cass-config:"^3.11.x:jvm-options/use_tlb;>=4.x,dse@>=6.8.x:jvm-server-options/use_tlb"` + UseTlab *bool `json:"vm_use_tlab,omitempty" cass-config:"^3.11.x:jvm-options/use_tlb;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/use_tlb"` // Allow resizing of thread-local allocation blocks. // Enabled by default. @@ -141,7 +141,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+ResizeTLAB. // +optional - ResizeTlab *bool `json:"vm_resize_tlab,omitempty" cass-config:"^3.11.x:jvm-options/resize_tlb;>=4.x,dse@>=6.8.x:jvm-server-options/resize_tlb"` + ResizeTlab *bool `json:"vm_resize_tlab,omitempty" cass-config:"^3.11.x:jvm-options/resize_tlb;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/resize_tlb"` // Disable hsperfdata mmap'ed file. // Enabled by default. @@ -149,7 +149,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+PerfDisableSharedMem. // +optional - DisablePerfSharedMem *bool `json:"vm_disable_perf_shared_mem,omitempty" cass-config:"^3.11.x:jvm-options/perf_disable_shared_mem;>=4.x,dse@>=6.8.x:jvm-server-options/perf_disable_shared_mem"` + DisablePerfSharedMem *bool `json:"vm_disable_perf_shared_mem,omitempty" cass-config:"^3.11.x:jvm-options/perf_disable_shared_mem;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/perf_disable_shared_mem"` // Prefer binding to IPv4 network interfaces. // Enabled by default. @@ -157,70 +157,70 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Djava.net.preferIPv4Stack=true. // +optional - PreferIpv4 *bool `json:"vm_prefer_ipv4,omitempty" cass-config:"^3.11.x:jvm-options/java_net_prefer_ipv4_stack;>=4.x,dse@>=6.8.x:jvm-server-options/java_net_prefer_ipv4_stack"` + PreferIpv4 *bool `json:"vm_prefer_ipv4,omitempty" cass-config:"^3.11.x:jvm-options/java_net_prefer_ipv4_stack;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/java_net_prefer_ipv4_stack"` // Enabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+UseNUMA. // +optional - UseNuma *bool `json:"vm_use_numa,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/use_numa"` + UseNuma *bool `json:"vm_use_numa,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/use_numa"` // Disabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dcassandra.printHeapHistogramOnOutOfMemoryError. // +optional - PrintHeapHistogramOnOutOfMemoryError *bool `json:"vm_print_heap_histogram_on_out_of_memory_error,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/print_heap_histogram_on_out_of_memory_error"` + PrintHeapHistogramOnOutOfMemoryError *bool `json:"vm_print_heap_histogram_on_out_of_memory_error,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/print_heap_histogram_on_out_of_memory_error"` // Disabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+ExitOnOutOfMemoryError. // +optional - ExitOnOutOfMemoryError *bool `json:"vm_exit_on_out_of_memory_error,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/exit_on_out_of_memory_error"` + ExitOnOutOfMemoryError *bool `json:"vm_exit_on_out_of_memory_error,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/exit_on_out_of_memory_error"` // Disabled by default. Requires `exit_on_out_of_memory_error` to be disabled.. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+CrashOnOutOfMemoryError. // +optional - CrashOnOutOfMemoryError *bool `json:"vm_crash_on_out_of_memory_error,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/crash_on_out_of_memory_error"` + CrashOnOutOfMemoryError *bool `json:"vm_crash_on_out_of_memory_error,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/crash_on_out_of_memory_error"` // Defaults to 300000 milliseconds. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:GuaranteedSafepointInterval. // +optional - GuaranteedSafepointIntervalMs *int `json:"vm_guaranteed_safepoint_interval_ms,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/guaranteed-safepoint-interval"` + GuaranteedSafepointIntervalMs *int `json:"vm_guaranteed_safepoint_interval_ms,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/guaranteed-safepoint-interval"` // Defaults to 65536. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dio.netty.eventLoop.maxPendingTasks. // +optional - NettyEventloopMaxPendingTasks *int `json:"netty_eventloop_maxpendingtasks,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/io_netty_eventloop_maxpendingtasks"` + NettyEventloopMaxPendingTasks *int `json:"netty_eventloop_maxpendingtasks,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/io_netty_eventloop_maxpendingtasks"` // Netty setting `io.netty.tryReflectionSetAccessible`. // Defaults to true. // Cass Config Builder: supported for Cassandra 4.0 in jvm11-server.options. // Corresponds to: -Dio.netty.tryReflectionSetAccessible=true. // +optional - NettyTryReflectionSetAccessible *bool `json:"netty_try_reflection_set_accessible,omitempty" cass-config:">=4.x:jvm11-server-options/io_netty_try_reflection_set_accessible;dse@>=6.8.x:jvm8-server-options/io_netty_try_reflection_set_accessible"` + NettyTryReflectionSetAccessible *bool `json:"netty_try_reflection_set_accessible,omitempty" cass-config:">=4.x,hcd@>=1.x.x:jvm11-server-options/io_netty_try_reflection_set_accessible;dse@>=6.8.x:jvm8-server-options/io_netty_try_reflection_set_accessible"` // Defaults to 1048576. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Djdk.nio.maxCachedBufferSize. // +optional - NioMaxCachedBufferSize *resource.Quantity `json:"nio_maxcachedbuffersize,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/jdk_nio_maxcachedbuffersize"` + NioMaxCachedBufferSize *resource.Quantity `json:"nio_maxcachedbuffersize,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/jdk_nio_maxcachedbuffersize"` // Align direct memory allocations on page boundaries. // Enabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dsun.nio.PageAlignDirectMemory=true. // +optional - NioAlignDirectMemory *bool `json:"nio_align_direct_memory,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/page-align-direct-memory"` + NioAlignDirectMemory *bool `json:"nio_align_direct_memory,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/page-align-direct-memory"` // Allow the current VM to attach to itself. // Defaults to true. // Cass Config Builder: supported for Cassandra 4.0 in jvm11-server.options. // Corresponds to: -Djdk.attach.allowAttachSelf=true. // +optional - JdkAllowAttachSelf *bool `json:"jdk_allow_attach_self,omitempty" cass-config:">=4.x:jvm11-server-options/jdk_attach_allow_attach_self;dse@>=6.8.x:jvm8-server-options/jdk_attach_allow_attach_self"` + JdkAllowAttachSelf *bool `json:"jdk_allow_attach_self,omitempty" cass-config:">=4.x,hcd@>=1.x.x:jvm11-server-options/jdk_attach_allow_attach_self;dse@>=6.8.x:jvm8-server-options/jdk_attach_allow_attach_self"` // CASSANDRA STARTUP OPTIONS @@ -230,7 +230,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dcassandra.available_processors. // +optional - AvailableProcessors *int `json:"cassandra_available_processors,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_available_processors;>=4.x,dse@>=6.8.x:jvm-server-options/cassandra_available_processors"` + AvailableProcessors *int `json:"cassandra_available_processors,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_available_processors;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_available_processors"` // Enable pluggable metrics reporter. // Disabled by default. @@ -239,7 +239,7 @@ type JvmOptions struct { // Corresponds to: -Dcassandra.metricsReporterConfigFile. // +optional // TODO mountable directory - MetricsReporterConfigFile *string `json:"cassandra_metrics_reporter_config_file,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_metrics_reporter_config_file;>=4.x,dse@>=6.8.x:jvm-server-options/cassandra_metrics_reporter_config_file"` + MetricsReporterConfigFile *string `json:"cassandra_metrics_reporter_config_file,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_metrics_reporter_config_file;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_metrics_reporter_config_file"` // Amount of time in milliseconds that a node waits before joining the ring. // Disabled by default. @@ -247,7 +247,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dcassandra.ring_delay_ms. // +optional - RingDelayMs *int `json:"cassandra_ring_delay_ms,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_ring_delay_ms;>=4.x,dse@>=6.8.x:jvm-server-options/cassandra_ring_delay_ms"` + RingDelayMs *int `json:"cassandra_ring_delay_ms,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_ring_delay_ms;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_ring_delay_ms"` // Default location for the trigger JARs. // Disabled by default. @@ -256,7 +256,7 @@ type JvmOptions struct { // Corresponds to: -Dcassandra.triggers_dir. // +optional // TODO mountable directory - TriggersDirectory *string `json:"cassandra_triggers_directory,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_triggers_dir;>=4.x,dse@>=6.8.x:jvm-server-options/cassandra_triggers_dir"` + TriggersDirectory *string `json:"cassandra_triggers_directory,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_triggers_dir;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_triggers_dir"` // For testing new compaction and compression strategies. // Disabled by default. @@ -264,7 +264,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dcassandra.write_survey. // +optional - WriteSurvey *bool `json:"cassandra_write_survey,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_write_survey;>=4.x,dse@>=6.8.x:jvm-server-options/cassandra_write_survey"` + WriteSurvey *bool `json:"cassandra_write_survey,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_write_survey;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_write_survey"` // Disable remote configuration via JMX of auth caches. // Disabled by default. @@ -272,7 +272,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dcassandra.disable_auth_caches_remote_configuration. // +optional - DisableAuthCachesRemoteConfiguration *bool `json:"cassandra_disable_auth_caches_remote_configuration,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_disable_auth_caches_remote_configuration;>=4.x,dse@>=6.8.x:jvm-server-options/cassandra_disable_auth_caches_remote_configuration"` + DisableAuthCachesRemoteConfiguration *bool `json:"cassandra_disable_auth_caches_remote_configuration,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_disable_auth_caches_remote_configuration;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_disable_auth_caches_remote_configuration"` // Disable dynamic calculation of the page size used when indexing an entire partition (during // initial index build/rebuild). @@ -281,7 +281,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dcassandra.force_default_indexing_page_size. // +optional - ForceDefaultIndexingPageSize *bool `json:"cassandra_force_default_indexing_page_size,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_force_default_indexing_page_size;>=4.x,dse@>=6.8.x:jvm-server-options/cassandra_force_default_indexing_page_size"` + ForceDefaultIndexingPageSize *bool `json:"cassandra_force_default_indexing_page_size,omitempty" cass-config:"^3.11.x:jvm-options/cassandra_force_default_indexing_page_size;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_force_default_indexing_page_size"` // Disabled by default. // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. @@ -295,14 +295,14 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dcassandra.expiration_date_overflow_policy. // +optional - ExpirationDateOverflowPolicy *string `json:"cassandra_expiration_date_overflow_policy,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/cassandra_expiration_date_overflow_policy"` + ExpirationDateOverflowPolicy *string `json:"cassandra_expiration_date_overflow_policy,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_expiration_date_overflow_policy"` // Imposes an upper bound on hint lifetime below the normal min gc_grace_seconds. // Disabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -Dcassandra.maxHintTTL. // +optional - MaxHintTtlSeconds *int `json:"cassandra_max_hint_ttl_seconds,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/cassandra_max_hint_ttl"` + MaxHintTtlSeconds *int `json:"cassandra_max_hint_ttl_seconds,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/cassandra_max_hint_ttl"` // GC OPTIONS @@ -316,7 +316,7 @@ type JvmOptions struct { // +kubebuilder:validation:Enum=G1GC;CMS;ZGC;Shenandoah;Graal;Custom // +kubebuilder:default=G1GC // +optional - GarbageCollector *string `json:"gc,omitempty" cass-config:"^3.11.x:jvm-options/garbage_collector;>=4.x:jvm11-server-options/garbage_collector;dse@>=6.8.x:jvm8-server-options/garbage_collector"` + GarbageCollector *string `json:"gc,omitempty" cass-config:"^3.11.x:jvm-options/garbage_collector;>=4.x,hcd@>=1.x.x:jvm11-server-options/garbage_collector;dse@>=6.8.x:jvm8-server-options/garbage_collector"` // CMS @@ -366,14 +366,14 @@ type JvmOptions struct { // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 // +optional - G1RSetUpdatingPauseTimePercent *int `json:"gc_g1_rset_updating_pause_time_percent,omitempty" cass-config:"^3.11.x:jvm-options/g1r_set_updating_pause_time_percent;>=4.x:jvm11-server-options/g1r_set_updating_pause_time_percent;dse@>=6.8.x:jvm8-server-options/g1r_set_updating_pause_time_percent"` + G1RSetUpdatingPauseTimePercent *int `json:"gc_g1_rset_updating_pause_time_percent,omitempty" cass-config:"^3.11.x:jvm-options/g1r_set_updating_pause_time_percent;>=4.x,hcd@>=1.x.x:jvm11-server-options/g1r_set_updating_pause_time_percent;dse@>=6.8.x:jvm8-server-options/g1r_set_updating_pause_time_percent"` // G1GC Max GC Pause in milliseconds. Defaults to 500. Can only be used when G1 garbage collector is used. // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. // Cass Config Builder: supported for Cassandra 4.0 in jvm11-server.options. // Corresponds to: -XX:MaxGCPauseMillis. // +optional - G1MaxGcPauseMs *int `json:"gc_g1_max_gc_pause_ms,omitempty" cass-config:"^3.11.x:jvm-options/max_gc_pause_millis;>=4.x:jvm11-server-options/max_gc_pause_millis;dse@>=6.8.x:jvm8-server-options/max_gc_pause_millis"` + G1MaxGcPauseMs *int `json:"gc_g1_max_gc_pause_ms,omitempty" cass-config:"^3.11.x:jvm-options/max_gc_pause_millis;>=4.x,hcd@>=1.x.x:jvm11-server-options/max_gc_pause_millis;dse@>=6.8.x:jvm8-server-options/max_gc_pause_millis"` // Initiating Heap Occupancy Percentage. Can only be used when G1 garbage collector is used. // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. @@ -382,14 +382,14 @@ type JvmOptions struct { // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 // +optional - G1InitiatingHeapOccupancyPercent *int `json:"gc_g1_initiating_heap_occupancy_percent,omitempty" cass-config:"^3.11.x:jvm-options/initiating_heap_occupancy_percent;>=4.x:jvm11-server-options/initiating_heap_occupancy_percent;dse@>=6.8.x:jvm8-server-options/initiating_heap_occupancy_percent"` + G1InitiatingHeapOccupancyPercent *int `json:"gc_g1_initiating_heap_occupancy_percent,omitempty" cass-config:"^3.11.x:jvm-options/initiating_heap_occupancy_percent;>=4.x,hcd@>=1.x.x:jvm11-server-options/initiating_heap_occupancy_percent;dse@>=6.8.x:jvm8-server-options/initiating_heap_occupancy_percent"` // Parallel GC Threads. Can only be used when G1 garbage collector is used. // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. // Cass Config Builder: supported for Cassandra 4.0 in jvm11-server.options. // Corresponds to: -XX:ParallelGCThreads. // +optional - G1ParallelGcThreads *int `json:"gc_g1_parallel_threads,omitempty" cass-config:"^3.11.x:jvm-options/parallel_gc_threads;>=4.x:jvm11-server-options/parallel_gc_threads;dse@>=6.8.x:jvm8-server-options/parallel_gc_threads"` + G1ParallelGcThreads *int `json:"gc_g1_parallel_threads,omitempty" cass-config:"^3.11.x:jvm-options/parallel_gc_threads;>=4.x,hcd@>=1.x.x:jvm11-server-options/parallel_gc_threads;dse@>=6.8.x:jvm8-server-options/parallel_gc_threads"` // Concurrent GC Threads. Can only be used when G1 garbage collector is used. // Disabled by default. @@ -397,7 +397,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm11-server.options. // Corresponds to: -XX:ConcGCThreads. // +optional - G1ConcGcThreads *int `json:"gc_g1_conc_threads,omitempty" cass-config:"^3.11.x:jvm-options/conc_gc_threads;>=4.x:jvm11-server-options/conc_gc_threads;dse@>=6.8.x:jvm8-server-options/conc_gc_threads"` + G1ConcGcThreads *int `json:"gc_g1_conc_threads,omitempty" cass-config:"^3.11.x:jvm-options/conc_gc_threads;>=4.x,hcd@>=1.x.x:jvm11-server-options/conc_gc_threads;dse@>=6.8.x:jvm8-server-options/conc_gc_threads"` // GC LOGGING OPTIONS (currently only available for Cassandra 3.11) @@ -484,32 +484,32 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // +optional - JmxPort *int `json:"jmx_port,omitempty" cass-config:"^3.11.x:jvm-options/jmx-port;>=4.x,dse@>=6.8.x:jvm-server-options/jmx-port"` + JmxPort *int `json:"jmx_port,omitempty" cass-config:"^3.11.x:jvm-options/jmx-port;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/jmx-port"` // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Possible values for 3.11 include `local-no-auth`, `remote-no-auth`, and `remote-dse-unified-auth`. Defaults to `local-no-auth`. // Possible values for 4.0 include `local-no-auth`, `remote-no-auth`. Defaults to `local-no-auth`. // +optional - JmxConnectionType *string `json:"jmx_connection_type,omitempty" cass-config:"^3.11.x:jvm-options/jmx-connection-type;>=4.x,dse@>=6.8.x:jvm-server-options/jmx-connection-type"` + JmxConnectionType *string `json:"jmx_connection_type,omitempty" cass-config:"^3.11.x:jvm-options/jmx-connection-type;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/jmx-connection-type"` // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Defaults to false. // Valid only when JmxConnectionType is "remote-no-auth", "remote-dse-unified-auth". // +optional - JmxRemoteSsl *bool `json:"jmx_remote_ssl,omitempty" cass-config:"^3.11.x:jvm-options/jmx-remote-ssl;>=4.x,dse@>=6.8.x:jvm-server-options/jmx-remote-ssl"` + JmxRemoteSsl *bool `json:"jmx_remote_ssl,omitempty" cass-config:"^3.11.x:jvm-options/jmx-remote-ssl;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/jmx-remote-ssl"` // Remote SSL options. // Cass Config Builder: supported for Cassandra 3.11 in jvm.options. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // +optional - JmxRemoteSslOpts *string `json:"jmx_remote_ssl_opts,omitempty" cass-config:"^3.11.x:jvm-options/jmx-remote-ssl-opts;>=4.x,dse@>=6.8.x:jvm-server-options/jmx-remote-ssl-opts"` + JmxRemoteSslOpts *string `json:"jmx_remote_ssl_opts,omitempty" cass-config:"^3.11.x:jvm-options/jmx-remote-ssl-opts;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/jmx-remote-ssl-opts"` // Require Client Authentication for remote SSL? Defaults to false. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // +optional - JmxRemoteSslRequireClientAuth *bool `json:"jmx_remote_ssl_require_client_auth,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/jmx-remote-ssl-require-client-auth"` + JmxRemoteSslRequireClientAuth *bool `json:"jmx_remote_ssl_require_client_auth,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/jmx-remote-ssl-require-client-auth"` // DEBUG OPTIONS @@ -519,7 +519,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+UnlockCommercialFeatures. // +optional - UnlockCommercialFeatures *bool `json:"debug_unlock_commercial_features,omitempty" cass-config:"^3.11.x:jvm-options/unlock_commercial_features;>=4.x,dse@>=6.8.x:jvm-server-options/unlock_commercial_features"` + UnlockCommercialFeatures *bool `json:"debug_unlock_commercial_features,omitempty" cass-config:"^3.11.x:jvm-options/unlock_commercial_features;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/unlock_commercial_features"` // Enable Flight Recorder (Use in production is subject to Oracle licensing). // Disabled by default. @@ -527,7 +527,7 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+FlightRecorder. // +optional - EnableFlightRecorder *bool `json:"debug_enable_flight_recorder,omitempty" cass-config:"^3.11.x:jvm-options/flight_recorder;>=4.x,dse@>=6.8.x:jvm-server-options/flight_recorder"` + EnableFlightRecorder *bool `json:"debug_enable_flight_recorder,omitempty" cass-config:"^3.11.x:jvm-options/flight_recorder;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/flight_recorder"` // Listen for JVM remote debuggers on port 1414. // Disabled by default. @@ -535,14 +535,14 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1414". // +optional - ListenForRemoteDebuggers *bool `json:"debug_listen_remote_debuggers,omitempty" cass-config:"^3.11.x:jvm-options/agent_lib_jdwp;>=4.x,dse@>=6.8.x:jvm-server-options/agent_lib_jdwp"` + ListenForRemoteDebuggers *bool `json:"debug_listen_remote_debuggers,omitempty" cass-config:"^3.11.x:jvm-options/agent_lib_jdwp;>=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/agent_lib_jdwp"` // Disable honoring user code @Contended annotations. // Enabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:-RestrictContended. // +optional - DisableContendedAnnotations *bool `json:"debug_disable_contended_annotations,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/restrict-contended"` + DisableContendedAnnotations *bool `json:"debug_disable_contended_annotations,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/restrict-contended"` // Whether the compiler should generate the necessary metadata for the parts of the code not at // safe points as well. For use with Flight Recorder. @@ -550,27 +550,27 @@ type JvmOptions struct { // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+DebugNonSafepoints. // +optional - DebugNonSafepoints *bool `json:"debug_non_safepoints,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/debug-non-safepoints"` + DebugNonSafepoints *bool `json:"debug_non_safepoints,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/debug-non-safepoints"` // Enabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+UnlockDiagnosticVMOptions. // +optional - UnlockDiagnosticVmOptions *bool `json:"debug_unlock_diagnostic_vm_options,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/unlock-diagnostic-vm-options"` + UnlockDiagnosticVmOptions *bool `json:"debug_unlock_diagnostic_vm_options,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/unlock-diagnostic-vm-options"` // Make Cassandra JVM log internal method compilation (developers only). // Disabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+LogCompilation. // +optional - LogCompilation *bool `json:"debug_log_compilation,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/log_compilation"` + LogCompilation *bool `json:"debug_log_compilation,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/log_compilation"` // Preserve Frame Pointer. // Enabled by default. // Cass Config Builder: supported for Cassandra 4.0 in jvm-server.options. // Corresponds to: -XX:+PreserveFramePointer. // +optional - PreserveFramePointer *bool `json:"debug_preserve_frame_pointer,omitempty" cass-config:">=4.x,dse@>=6.8.x:jvm-server-options/preserve-frame-pointer"` + PreserveFramePointer *bool `json:"debug_preserve_frame_pointer,omitempty" cass-config:">=4.x,dse@>=6.8.x,hcd@>=1.x.x:jvm-server-options/preserve-frame-pointer"` // Additional, arbitrary JVM options which are written into the cassandra-env.sh file. // +optional diff --git a/pkg/cassandra/config.go b/pkg/cassandra/config.go index bbe8d6f45..43e13e341 100644 --- a/pkg/cassandra/config.go +++ b/pkg/cassandra/config.go @@ -132,7 +132,7 @@ func AllowAlterRfDuringRangeMovement(dcConfig *DatacenterConfig) { func EnableSmartTokenAllocation(template *DatacenterConfig) { // Note: we put int64 values because even if int values can be marshaled just fine, // Unstructured.DeepCopy() would reject them since int is not a supported json type. - if template.ServerType == api.ServerDistributionDse { + if template.ServerType == api.ServerDistributionDse || template.ServerType == api.ServerDistributionHcd { template.CassandraConfig.CassandraYaml.PutIfAbsent("allocate_tokens_for_local_replication_factor", int64(3)) } } diff --git a/pkg/cassandra/config_premarshal_test.go b/pkg/cassandra/config_premarshal_test.go index 400bc8043..9308a3433 100644 --- a/pkg/cassandra/config_premarshal_test.go +++ b/pkg/cassandra/config_premarshal_test.go @@ -15,6 +15,7 @@ func Test_preMarshalConfig(t *testing.T) { Simple1 *string `cass-config:"*:foo/simple1"` Simple2 bool `cass-config:"*:foo/simple2"` SimpleDSE *bool `cass-config:"dse@6.8.x:foo/simple/dse"` + SimpleHCD *bool `cass-config:"hcd@1.x.x:foo/simple/hcd"` } type komplex struct { ManyRestrictions *string `cass-config:"^3.11.x:foo/many-restrictions-3x;cassandra@>=4.x:foo/many-restrictions-4x"` @@ -31,6 +32,10 @@ func Test_preMarshalConfig(t *testing.T) { ManyRestrictionsDSE *string `cass-config:">=4.x:many-restrictions-cassandra;dse@>=6.8.x:many-restrictions-dse"` ChildRecurseDSE *simple `cass-config:"dse@*:parent/;recurse"` } + type hcd struct { + ManyRestrictionsHCD *string `cass-config:">=4.x:many-restrictions-cassandra;dse@>=6.8.x:many-restrictions-dse;hcd@>=1.x.x:many-restrictions-hcd"` + ChildRecurseHCD *simple `cass-config:"hcd@*:parent/;recurse"` + } type invalid1 struct { Field1 string `cass-config:"dse@*:path:invalid tag"` } @@ -118,6 +123,14 @@ func Test_preMarshalConfig(t *testing.T) { map[string]interface{}{"foo": map[string]interface{}{"simple": map[string]interface{}{"dse": ptr.To(true)}}}, assert.NoError, }, + { + "simple HCD", + reflect.ValueOf(&simple{SimpleHCD: ptr.To(true)}), + semver.MustParse("1.0.0"), + "hcd", + map[string]interface{}{"foo": map[string]interface{}{"simple": map[string]interface{}{"hcd": ptr.To(true)}}}, + assert.NoError, + }, { "simple server type mismatch", reflect.ValueOf(&simple{SimpleDSE: ptr.To(true)}), @@ -236,6 +249,28 @@ func Test_preMarshalConfig(t *testing.T) { }, assert.NoError, }, + { + "complex HCD 1.0", + reflect.ValueOf(&hcd{ + ManyRestrictionsHCD: ptr.To("qix"), + ChildRecurseHCD: &simple{ + SimpleHCD: ptr.To(true), + }, + }), + semver.MustParse("1.0.0"), + "hcd", + map[string]interface{}{ + "many-restrictions-hcd": ptr.To("qix"), + "parent": map[string]interface{}{ + "foo": map[string]interface{}{ + "simple": map[string]interface{}{ + "hcd": ptr.To(true), + }, + }, + }, + }, + assert.NoError, + }, { "complex DSE 6.8 with cassandra server type", reflect.ValueOf(&dse{ diff --git a/pkg/cassandra/config_test.go b/pkg/cassandra/config_test.go index ffea39877..240b7bfa5 100644 --- a/pkg/cassandra/config_test.go +++ b/pkg/cassandra/config_test.go @@ -344,13 +344,3 @@ func TestSmartTokenAllocCassandra(t *testing.T) { _, exists := dcConfig.CassandraConfig.CassandraYaml["allocate_tokens_for_local_replication_factor"] assert.False(t, exists, "allocate_tokens_for_local_replication_factor should not be set for Cassandra") } - -func TestSmartTokenAllocHcd(t *testing.T) { - dcConfig := &DatacenterConfig{ - ServerType: api.ServerDistributionHcd, - } - - EnableSmartTokenAllocation(dcConfig) - _, exists := dcConfig.CassandraConfig.CassandraYaml["allocate_tokens_for_local_replication_factor"] - assert.False(t, exists, "allocate_tokens_for_local_replication_factor should not be set for HCD") -} diff --git a/test/e2e/dse_test.go b/test/e2e/dse_test.go index ada87ecd5..0a6e54758 100644 --- a/test/e2e/dse_test.go +++ b/test/e2e/dse_test.go @@ -5,6 +5,7 @@ import ( "crypto/tls" "encoding/base64" "fmt" + "github.com/k8ssandra/k8ssandra-operator/test/kubectl" "net/http" "testing" "time" @@ -75,6 +76,32 @@ func createSingleDseDatacenterCluster(t *testing.T, ctx context.Context, namespa checkStargateK8cStatusReady(t, f, ctx, kcKey, dcKey) } +// createSingleDseDatacenterCluster creates a K8ssandraCluster with one CassandraDatacenter running +func createSingleHcdDatacenterCluster(t *testing.T, ctx context.Context, namespace string, f *framework.E2eFramework) { + t.Log("check that the K8ssandraCluster was created") + kc := &api.K8ssandraCluster{} + kcKey := types.NamespacedName{Namespace: namespace, Name: "test"} + err := f.Client.Get(ctx, kcKey, kc) + require.NoError(t, err, "failed to get K8ssandraCluster in namespace %s", namespace) + dcKey := framework.ClusterKey{K8sContext: f.DataPlaneContexts[0], NamespacedName: types.NamespacedName{Namespace: namespace, Name: "dc1"}} + checkDatacenterReady(t, ctx, dcKey, f) + checkDatacenterHasHeapSizeSet(t, ctx, dcKey, f) + assertCassandraDatacenterK8cStatusReady(ctx, t, f, kcKey, dcKey.Name) + dcPrefix := DcPrefix(t, f, dcKey) + + t.Log("Check that we can communicate through CQL with HCD") + _, err = f.ExecuteCql(ctx, f.DataPlaneContexts[0], namespace, kc.SanitizedName(), dcPrefix+"-default-sts-0", + "SELECT * FROM system.local") + require.NoError(t, err, "failed to execute CQL query against HCD", err) + opts := kubectl.Options{ + Namespace: namespace, + Context: f.DataPlaneContexts[0], + } + output, err := kubectl.Exec(opts, dcPrefix+"-default-sts-0", "ps", "-aux") + require.NoError(t, err, "failed to execute ps command") + assert.Contains(t, output, "java -Dhcd.server_process -Xms536870912 -Xmx536870912", "expected heap size to be set to 512M") +} + // createSingleDseSearchDatacenterCluster creates a K8ssandraCluster with one CassandraDatacenter running with search enabled func createSingleDseSearchDatacenterCluster(t *testing.T, ctx context.Context, namespace string, f *framework.E2eFramework) { t.Log("check that the K8ssandraCluster was created") diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index bb4686113..7ead381c4 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -183,23 +183,23 @@ func TestOperator(t *testing.T) { t.Run("CreateSingleDseDatacenterCluster", e2eTest(ctx, &e2eTestOpts{ testFunc: createSingleDseDatacenterCluster, fixture: framework.NewTestFixture("single-dc-dse", controlPlane), - dse: true, + })) + t.Run("CreateSingleHcdDatacenterCluster", e2eTest(ctx, &e2eTestOpts{ + testFunc: createSingleHcdDatacenterCluster, + fixture: framework.NewTestFixture("single-dc-hcd", controlPlane), })) t.Run("CreateSingleDseSearchDatacenterCluster", e2eTest(ctx, &e2eTestOpts{ testFunc: createSingleDseSearchDatacenterCluster, fixture: framework.NewTestFixture("single-dc-dse-search", controlPlane), - dse: true, installMinio: true, })) t.Run("CreateSingleDseGraphDatacenterCluster", e2eTest(ctx, &e2eTestOpts{ testFunc: createSingleDseGraphDatacenterCluster, fixture: framework.NewTestFixture("single-dc-dse-graph", controlPlane), - dse: true, })) t.Run("ChangeDseWorkload", e2eTest(ctx, &e2eTestOpts{ testFunc: changeDseWorkload, fixture: framework.NewTestFixture("single-dc-dse", controlPlane), - dse: true, })) t.Run("CreateStargateAndDatacenter", e2eTest(ctx, &e2eTestOpts{ testFunc: createStargateAndDatacenter, @@ -450,9 +450,6 @@ type e2eTestOpts struct { // an upgrade test. initialVersion *string - // dse is used to specify if the e2e tests will run against DSE or Cassandra - dse bool - // installMinio is used to specify if the e2e tests will require to install Minio before creating the k8c object. installMinio bool } @@ -462,7 +459,7 @@ type e2eTestFunc func(t *testing.T, ctx context.Context, namespace string, f *fr func e2eTest(ctx context.Context, opts *e2eTestOpts) func(*testing.T) { return func(t *testing.T) { - f, err := framework.NewE2eFramework(t, kubeconfigFile, opts.dse, controlPlane, dataPlanes...) + f, err := framework.NewE2eFramework(t, kubeconfigFile, controlPlane, dataPlanes...) if err != nil { t.Fatalf("failed to initialize test framework: %v", err) } @@ -1797,6 +1794,20 @@ func checkDatacenterReady(t *testing.T, ctx context.Context, key framework.Clust }), polling.datacenterReady.timeout, polling.datacenterReady.interval, fmt.Sprintf("timed out waiting for datacenter %s to become ready", key.Name)) } +func checkDatacenterHasHeapSizeSet(t *testing.T, ctx context.Context, key framework.ClusterKey, f *framework.E2eFramework) { + t.Logf("check that datacenter %s in cluster %s has its heap size set", key.Name, key.K8sContext) + withDatacenter := f.NewWithDatacenter(ctx, key) + require.Eventually(t, withDatacenter(func(dc *cassdcapi.CassandraDatacenter) bool { + dcConfig, err := utils.UnmarshalToMap(dc.Spec.Config) + if err != nil { + t.Logf("failed to unmarshal datacenter %s config: %v", key.Name, err) + return false + } + initialHeapSize := dcConfig["jvm-server-options"].(map[string]interface{})["initial_heap_size"].(float64) + return initialHeapSize > 0 + }), 10*time.Second, 1*time.Second, fmt.Sprintf("timed out waiting for datacenter %s to become ready", key.Name)) +} + func checkDatacenterUpdating(t *testing.T, ctx context.Context, key framework.ClusterKey, f *framework.E2eFramework) { t.Logf("check that datacenter %s in cluster %s is updating", key.Name, key.K8sContext) withDatacenter := f.NewWithDatacenter(ctx, key) @@ -1906,7 +1917,7 @@ func checkKeyspaceExists( ctx context.Context, k8sContext, namespace, clusterName, pod, keyspace string, ) { - assert.Eventually(t, func() bool { + require.Eventually(t, func() bool { keyspaces, err := f.ExecuteCql(ctx, k8sContext, namespace, clusterName, pod, "describe keyspaces") if err != nil { t.Logf("failed to describe keyspaces: %v", err) diff --git a/test/framework/e2e_framework.go b/test/framework/e2e_framework.go index cf83314a4..c5890dce4 100644 --- a/test/framework/e2e_framework.go +++ b/test/framework/e2e_framework.go @@ -56,17 +56,14 @@ var ( nodeToolStatusDN = regexp.MustCompile(`DN\s\s`) ) -func NewE2eFramework(t *testing.T, kubeconfigFile string, useDse bool, controlPlane string, dataPlanes ...string) (*E2eFramework, error) { +func NewE2eFramework(t *testing.T, kubeconfigFile string, controlPlane string, dataPlanes ...string) (*E2eFramework, error) { config, err := clientcmd.LoadFromFile(kubeconfigFile) if err != nil { return nil, err } // Specify if DSE is used to adjust paths to binaries (cqlsh, ...) - cqlshBinLocation := "/opt/cassandra/bin/cqlsh" - if useDse { - cqlshBinLocation = "/opt/dse/bin/cqlsh" - } + cqlshBin := "cqlsh" remoteClients := make(map[string]client.Client, 0) t.Logf("Using config file: %s", kubeconfigFile) @@ -98,7 +95,7 @@ func NewE2eFramework(t *testing.T, kubeconfigFile string, useDse bool, controlPl f := NewFramework(remoteClients[controlPlane], controlPlane, validDataPlanes, remoteClients) - return &E2eFramework{Framework: f, cqlshBin: cqlshBinLocation}, nil + return &E2eFramework{Framework: f, cqlshBin: cqlshBin}, nil } func newRemoteClient(config *clientcmdapi.Config, context string) (client.Client, error) { diff --git a/test/testdata/fixtures/add-dc-cass-only/k8ssandra.yaml b/test/testdata/fixtures/add-dc-cass-only/k8ssandra.yaml index 5e16781fe..e64e24f12 100644 --- a/test/testdata/fixtures/add-dc-cass-only/k8ssandra.yaml +++ b/test/testdata/fixtures/add-dc-cass-only/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: "4.1.0" + serverImage: "k8ssandra/cass-management-api:4.1.0" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/add-dc/k8ssandra.yaml b/test/testdata/fixtures/add-dc/k8ssandra.yaml index 453b84b63..27828a18f 100644 --- a/test/testdata/fixtures/add-dc/k8ssandra.yaml +++ b/test/testdata/fixtures/add-dc/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/add-external-dc/cassdc1.yaml b/test/testdata/fixtures/add-external-dc/cassdc1.yaml index 1fa565780..c5b084a45 100644 --- a/test/testdata/fixtures/add-external-dc/cassdc1.yaml +++ b/test/testdata/fixtures/add-external-dc/cassdc1.yaml @@ -82,6 +82,7 @@ spec: resources: {} serverType: cassandra serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" size: 2 storageConfig: cassandraDataVolumeClaimSpec: diff --git a/test/testdata/fixtures/add-external-dc/k8ssandra2.yaml b/test/testdata/fixtures/add-external-dc/k8ssandra2.yaml index 99a23b514..9916062b9 100644 --- a/test/testdata/fixtures/add-external-dc/k8ssandra2.yaml +++ b/test/testdata/fixtures/add-external-dc/k8ssandra2.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/gc/3.11-jdk8-CMS/k8ssandra.yaml b/test/testdata/fixtures/gc/3.11-jdk8-CMS/k8ssandra.yaml index 059176a01..2a777b19e 100644 --- a/test/testdata/fixtures/gc/3.11-jdk8-CMS/k8ssandra.yaml +++ b/test/testdata/fixtures/gc/3.11-jdk8-CMS/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/gc/3.11-jdk8-G1/k8ssandra.yaml b/test/testdata/fixtures/gc/3.11-jdk8-G1/k8ssandra.yaml index e9b8daa75..d2bc3df95 100644 --- a/test/testdata/fixtures/gc/3.11-jdk8-G1/k8ssandra.yaml +++ b/test/testdata/fixtures/gc/3.11-jdk8-G1/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/gc/4.0-jdk11-CMS/k8ssandra.yaml b/test/testdata/fixtures/gc/4.0-jdk11-CMS/k8ssandra.yaml index 9a924fb3b..5a88c6470 100644 --- a/test/testdata/fixtures/gc/4.0-jdk11-CMS/k8ssandra.yaml +++ b/test/testdata/fixtures/gc/4.0-jdk11-CMS/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 4.0.13 + serverImage: "k8ssandra/cass-management-api:4.0.13" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/gc/4.0-jdk11-G1/k8ssandra.yaml b/test/testdata/fixtures/gc/4.0-jdk11-G1/k8ssandra.yaml index b1d3f3753..ec907e96c 100644 --- a/test/testdata/fixtures/gc/4.0-jdk11-G1/k8ssandra.yaml +++ b/test/testdata/fixtures/gc/4.0-jdk11-G1/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 4.0.13 + serverImage: "k8ssandra/cass-management-api:4.0.13" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/gc/4.0-jdk11-ZGC/k8ssandra.yaml b/test/testdata/fixtures/gc/4.0-jdk11-ZGC/k8ssandra.yaml index fb0116b90..0b173d8a0 100644 --- a/test/testdata/fixtures/gc/4.0-jdk11-ZGC/k8ssandra.yaml +++ b/test/testdata/fixtures/gc/4.0-jdk11-ZGC/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 4.0.13 + serverImage: "k8ssandra/cass-management-api:4.0.13" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/multi-dc-auth/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-auth/k8ssandra.yaml index daa8df1bd..8823160db 100644 --- a/test/testdata/fixtures/multi-dc-auth/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-auth/k8ssandra.yaml @@ -6,6 +6,7 @@ spec: auth: false cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/multi-dc-cluster-scope/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-cluster-scope/k8ssandra.yaml index 43106ac60..f4d545db9 100644 --- a/test/testdata/fixtures/multi-dc-cluster-scope/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-cluster-scope/k8ssandra.yaml @@ -11,6 +11,7 @@ spec: prefix: test cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/multi-dc-encryption-medusa/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-encryption-medusa/k8ssandra.yaml index 04ea03d01..dbd5cd284 100644 --- a/test/testdata/fixtures/multi-dc-encryption-medusa/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-encryption-medusa/k8ssandra.yaml @@ -30,6 +30,7 @@ spec: name: client-certificates cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/multi-dc-encryption-reaper/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-encryption-reaper/k8ssandra.yaml index 9d9bcc959..b03106a8a 100644 --- a/test/testdata/fixtures/multi-dc-encryption-reaper/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-encryption-reaper/k8ssandra.yaml @@ -46,6 +46,7 @@ spec: heapSize: 256Mi cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/multi-dc-encryption-stargate/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-encryption-stargate/k8ssandra.yaml index 44d9eec6b..6c674bd7a 100644 --- a/test/testdata/fixtures/multi-dc-encryption-stargate/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-encryption-stargate/k8ssandra.yaml @@ -22,6 +22,7 @@ metadata: spec: cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/multi-dc-initial-tokens/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-initial-tokens/k8ssandra.yaml index 5c769a528..aa4a786cb 100644 --- a/test/testdata/fixtures/multi-dc-initial-tokens/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-initial-tokens/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/multi-dc-mixed/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-mixed/k8ssandra.yaml index 145b355ed..b89cdae64 100644 --- a/test/testdata/fixtures/multi-dc-mixed/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-mixed/k8ssandra.yaml @@ -6,6 +6,7 @@ spec: cassandra: clusterName: "E2E Test Cluster" serverVersion: "4.0.13" + serverImage: "k8ssandra/cass-management-api:4.0.13" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/multi-dc-reaper/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-reaper/k8ssandra.yaml index e6ddb9424..12837f925 100644 --- a/test/testdata/fixtures/multi-dc-reaper/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-reaper/k8ssandra.yaml @@ -35,6 +35,7 @@ spec: cassandra: clusterName: "E2E Test Cluster" serverVersion: "4.0.13" + serverImage: "k8ssandra/cass-management-api:4.0.13" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/multi-dc-stargate/k8ssandra.yaml b/test/testdata/fixtures/multi-dc-stargate/k8ssandra.yaml index 8ee294def..26435c7a1 100644 --- a/test/testdata/fixtures/multi-dc-stargate/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc-stargate/k8ssandra.yaml @@ -23,6 +23,7 @@ spec: cassandra: clusterName: "E2E Test Cluster" serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/multi-dc/k8ssandra.yaml b/test/testdata/fixtures/multi-dc/k8ssandra.yaml index 9091f2401..1c5a8b7e2 100644 --- a/test/testdata/fixtures/multi-dc/k8ssandra.yaml +++ b/test/testdata/fixtures/multi-dc/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/multi-stargate/cassdc.yaml b/test/testdata/fixtures/multi-stargate/cassdc.yaml index ba48d27af..37f7cde2e 100644 --- a/test/testdata/fixtures/multi-stargate/cassdc.yaml +++ b/test/testdata/fixtures/multi-stargate/cassdc.yaml @@ -34,6 +34,7 @@ spec: max_heap_size: 512m serverType: cassandra serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" networking: hostNetwork: false size: 3 diff --git a/test/testdata/fixtures/reaper/cassdc.yaml b/test/testdata/fixtures/reaper/cassdc.yaml index 995d41b82..66922fccc 100644 --- a/test/testdata/fixtures/reaper/cassdc.yaml +++ b/test/testdata/fixtures/reaper/cassdc.yaml @@ -37,6 +37,7 @@ spec: superuser: true serverType: cassandra serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" networking: hostNetwork: false size: 3 diff --git a/test/testdata/fixtures/remove-dc/k8ssandra.yaml b/test/testdata/fixtures/remove-dc/k8ssandra.yaml index ba9510529..dbd727f78 100644 --- a/test/testdata/fixtures/remove-dc/k8ssandra.yaml +++ b/test/testdata/fixtures/remove-dc/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: "4.0.13" + serverImage: "k8ssandra/cass-management-api:4.0.13" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/remove-local-dc/k8ssandra.yaml b/test/testdata/fixtures/remove-local-dc/k8ssandra.yaml index d0ab1bed8..72606fb78 100644 --- a/test/testdata/fixtures/remove-local-dc/k8ssandra.yaml +++ b/test/testdata/fixtures/remove-local-dc/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: "4.0.13" + serverImage: "k8ssandra/cass-management-api:4.0.13" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/single-dc-encryption-medusa/k8ssandra.yaml b/test/testdata/fixtures/single-dc-encryption-medusa/k8ssandra.yaml index afe17fa8c..bd0e93ef3 100644 --- a/test/testdata/fixtures/single-dc-encryption-medusa/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc-encryption-medusa/k8ssandra.yaml @@ -31,6 +31,7 @@ spec: cassandra: clusterName: "First Cluster" serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/single-dc-encryption-reaper/k8ssandra.yaml b/test/testdata/fixtures/single-dc-encryption-reaper/k8ssandra.yaml index 319cebd6b..6294e545c 100644 --- a/test/testdata/fixtures/single-dc-encryption-reaper/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc-encryption-reaper/k8ssandra.yaml @@ -19,6 +19,7 @@ spec: heapSize: 256Mi cassandra: serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/single-dc-encryption-stargate/k8ssandra.yaml b/test/testdata/fixtures/single-dc-encryption-stargate/k8ssandra.yaml index 0e748c8aa..ced1a7a02 100644 --- a/test/testdata/fixtures/single-dc-encryption-stargate/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc-encryption-stargate/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/single-dc-hcd/k8ssandra.yaml b/test/testdata/fixtures/single-dc-hcd/k8ssandra.yaml new file mode 100644 index 000000000..d63cb5374 --- /dev/null +++ b/test/testdata/fixtures/single-dc-hcd/k8ssandra.yaml @@ -0,0 +1,35 @@ +apiVersion: k8ssandra.io/v1alpha1 +kind: K8ssandraCluster +metadata: + name: test +spec: + auth: true + cassandra: + serverVersion: 1.0.0 + serverImage: datastax/hcd:1.0.0-early-preview + serverType: hcd + dseWorkloads: + graphEnabled: false + searchEnabled: false + datacenters: + - metadata: + name: dc1 + k8sContext: kind-k8ssandra-0 + size: 2 + networking: + hostNetwork: true + storageConfig: + cassandraDataVolumeClaimSpec: + storageClassName: standard + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + config: + dseYaml: + server_id: server-id + jvmOptions: + heap_initial_size: 512Mi + heap_max_size: 512Mi + mgmtAPIHeap: 64Mi diff --git a/test/testdata/fixtures/single-dc-hcd/kustomization.yaml b/test/testdata/fixtures/single-dc-hcd/kustomization.yaml new file mode 100644 index 000000000..2ac1a3634 --- /dev/null +++ b/test/testdata/fixtures/single-dc-hcd/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - k8ssandra.yaml diff --git a/test/testdata/fixtures/single-dc-multi-cluster-medusa/k8ssandra.yaml b/test/testdata/fixtures/single-dc-multi-cluster-medusa/k8ssandra.yaml index ade01f1a8..6b194cb8e 100644 --- a/test/testdata/fixtures/single-dc-multi-cluster-medusa/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc-multi-cluster-medusa/k8ssandra.yaml @@ -23,6 +23,7 @@ metadata: spec: cassandra: serverVersion: 4.0.13 + serverImage: "k8ssandra/cass-management-api:4.0.13" datacenters: - metadata: name: cluster1-dc1 diff --git a/test/testdata/fixtures/single-dc-per-node-config/k8ssandra.yaml b/test/testdata/fixtures/single-dc-per-node-config/k8ssandra.yaml index 70c212d7b..e4f2f4b36 100644 --- a/test/testdata/fixtures/single-dc-per-node-config/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc-per-node-config/k8ssandra.yaml @@ -17,6 +17,7 @@ metadata: spec: cassandra: serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/single-dc-reaper/k8ssandra.yaml b/test/testdata/fixtures/single-dc-reaper/k8ssandra.yaml index 5e32b38dd..94a45c542 100644 --- a/test/testdata/fixtures/single-dc-reaper/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc-reaper/k8ssandra.yaml @@ -21,6 +21,7 @@ spec: memory: 512Mi cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" clusterName: "My Cluster" jmxInitContainerImage: repository: library diff --git a/test/testdata/fixtures/single-dc-upgrade/k8ssandra.yaml b/test/testdata/fixtures/single-dc-upgrade/k8ssandra.yaml index baa28ff8c..6b91d652f 100644 --- a/test/testdata/fixtures/single-dc-upgrade/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc-upgrade/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/single-dc/k8ssandra.yaml b/test/testdata/fixtures/single-dc/k8ssandra.yaml index a33f05303..57f162e9a 100644 --- a/test/testdata/fixtures/single-dc/k8ssandra.yaml +++ b/test/testdata/fixtures/single-dc/k8ssandra.yaml @@ -39,6 +39,7 @@ spec: k8sContext: kind-k8ssandra-0 size: 3 serverVersion: 4.0.13 + serverImage: "k8ssandra/cass-management-api:4.0.13" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard diff --git a/test/testdata/fixtures/stargate-jwt/k8ssandra.yaml b/test/testdata/fixtures/stargate-jwt/k8ssandra.yaml index ae651772d..432a864ec 100644 --- a/test/testdata/fixtures/stargate-jwt/k8ssandra.yaml +++ b/test/testdata/fixtures/stargate-jwt/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" datacenters: - metadata: name: dc1 diff --git a/test/testdata/fixtures/stargate-reaper-http/k8ssandra.yaml b/test/testdata/fixtures/stargate-reaper-http/k8ssandra.yaml index 459b88d4d..eacd01c74 100644 --- a/test/testdata/fixtures/stargate-reaper-http/k8ssandra.yaml +++ b/test/testdata/fixtures/stargate-reaper-http/k8ssandra.yaml @@ -36,6 +36,7 @@ spec: timeoutSeconds: 20 cassandra: serverVersion: "3.11.14" + serverImage: "k8ssandra/cass-management-api:3.11.14" clusterName: "My Cluster" jmxInitContainerImage: repository: library diff --git a/test/testdata/fixtures/stargate/cassdc.yaml b/test/testdata/fixtures/stargate/cassdc.yaml index ba48d27af..37f7cde2e 100644 --- a/test/testdata/fixtures/stargate/cassdc.yaml +++ b/test/testdata/fixtures/stargate/cassdc.yaml @@ -34,6 +34,7 @@ spec: max_heap_size: 512m serverType: cassandra serverVersion: 3.11.14 + serverImage: "k8ssandra/cass-management-api:3.11.14" networking: hostNetwork: false size: 3 diff --git a/test/testdata/fixtures/stop-dc/k8ssandra.yaml b/test/testdata/fixtures/stop-dc/k8ssandra.yaml index 576ecb2d4..d32962a28 100644 --- a/test/testdata/fixtures/stop-dc/k8ssandra.yaml +++ b/test/testdata/fixtures/stop-dc/k8ssandra.yaml @@ -5,6 +5,7 @@ metadata: spec: cassandra: serverVersion: "4.0.13" + serverImage: "k8ssandra/cass-management-api:4.0.13" storageConfig: cassandraDataVolumeClaimSpec: storageClassName: standard