Originally reported by a user in #1144 (NodePort enabled, Reaper keeps connecting to :9042, "I do not see any way to set up the custom port for reaper").
Bug
The Reaper Deployment hardcodes the Cassandra CQL port 9042 in the REAPER_CASS_CONTACT_POINTS environment variable. When a K8ssandraCluster/CassandraDatacenter enables NodePort (networking.nodePort.native, e.g. 30942), cass-operator moves Cassandra's native_transport_port to the configured NodePort value, so 9042 is no longer listening.
As a result Reaper (v4+) cannot connect to its storage Cassandra: it fails to initialize the reaper_db schema, never becomes ready, and crash-loops on its :8081 liveness probe.
Where
pkg/reaper/deployment.go, computeEnvVars, the isReaperPostV4 branch:
envVars = append(envVars, corev1.EnvVar{
Name: "REAPER_CASS_CONTACT_POINTS",
Value: fmt.Sprintf("[{\"host\": \"%s\", \"port\": 9042}]", dc.GetDatacenterServiceName()),
})
This is still present on main.
Expected
The contact-point port should follow the datacenter, the same way cass-operator derives it for its own services in pkg/reconciliation/construct_service.go:
nativePort := cassdcapi.DefaultNativePort
if dc.IsNodePortEnabled() {
nativePort = dc.GetNodePortNativePort()
}
Reproduce
Deploy a K8ssandraCluster with cassandra.networking.nodePort.native: 30942 and Reaper enabled → Reaper crash-loops with connection-refused to :9042.
Fix
PR follows: derive the native port via dc.IsNodePortEnabled() / dc.GetNodePortNativePort(), falling back to cassdcapi.DefaultNativePort (9042). Backward compatible for non-NodePort clusters.
Bug
The Reaper
Deploymenthardcodes the Cassandra CQL port9042in theREAPER_CASS_CONTACT_POINTSenvironment variable. When aK8ssandraCluster/CassandraDatacenterenables NodePort (networking.nodePort.native, e.g.30942), cass-operator moves Cassandra'snative_transport_portto the configured NodePort value, so9042is no longer listening.As a result Reaper (v4+) cannot connect to its storage Cassandra: it fails to initialize the
reaper_dbschema, never becomes ready, and crash-loops on its:8081liveness probe.Where
pkg/reaper/deployment.go,computeEnvVars, theisReaperPostV4branch:This is still present on
main.Expected
The contact-point port should follow the datacenter, the same way cass-operator derives it for its own services in
pkg/reconciliation/construct_service.go:Reproduce
Deploy a
K8ssandraClusterwithcassandra.networking.nodePort.native: 30942and Reaper enabled → Reaper crash-loops with connection-refused to:9042.Fix
PR follows: derive the native port via
dc.IsNodePortEnabled()/dc.GetNodePortNativePort(), falling back tocassdcapi.DefaultNativePort(9042). Backward compatible for non-NodePort clusters.