Closed Miles-Garnsey closed 2 years ago
Your YAML is not correct, you missed the jvmOptions
level below config
:
config:
jvmOptions:
jmx_connection_type: remote-no-auth
additionalOptions:
- -Dcassandra.jmx.remote.port=7199
- -Djava.rmi.server.hostname=127.0.0.1
- -Dcom.sun.management.jmxremote.rmi.port=7199
I guess this didn't trigger an error because CassandraDatacenterTemplate
is annotated as follows:
// +kubebuilder:pruning:PreserveUnknownFields
type CassandraDatacenterTemplate struct {
I think we need to assess whether we still need PreserveUnknownFields
or not.
I think you're right for that original manifest I posted! When I add the additionalOptions
level to the yaml it does all start working.
I don't think PreserveUnknownFields
is still required, could we try removing it in the interests of usability?
Here's another issue (and I think this is the one I hit at first). If I define config at both cluster and DC level, it seems like the DC level config overwrites the cluster level config without any merge behaviour?
apiVersion: k8ssandra.io/v1alpha1
kind: K8ssandraCluster
metadata:
name: test
spec:
auth: false
cassandra:
config:
jvmOptions:
jmx_connection_type: remote-no-auth
additionalOptions:
- -Dcassandra.jmx.remote.port=7199
- -Djava.rmi.server.hostname=127.0.0.1
- -Dcom.sun.management.jmxremote.rmi.port=7199
telemetry:
prometheus:
enabled: true
serverVersion: "4.0.4"
datacenters:
- metadata:
name: dc1
size: 1
cdc:
pulsarServiceUrl: pulsar://pulsar-proxy.pulsar.svc.cluster.local:6650
storageConfig:
cassandraDataVolumeClaimSpec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
config:
jvmOptions:
heapSize: 512Mi
This manifest also results in the env variables not appearing (even though jvmOptions
is added here.)
I don't think PreserveUnknownFields is still required, could we try removing it in the interests of usability?
Agreed, I think we can remove it.
it seems like the DC level config overwrites the cluster level config without any merge behaviour?
Yes that comes from this code: https://github.com/k8ssandra/k8ssandra-operator/blob/bbcfe3450272920014a242750bc31ec9863c333d/pkg/cassandra/datacenter.go#L334-L338.
This manifest also results in the env variables not appearing
Sorry what env variables? I don't see any specified in the manifest.
Sorry what env variables? I don't see any specified in the manifest.
Sorry, I meant JVM startup options (I was raising too many related tickets last week).
I am closing this in favour of the following two tickets to address PreserveUnknownFields
as well as address the DC/Cluster level override behaviour.
What happened?
Attempting to add JVM startup options via
cassandra.config.jvmOptions.additionalOptions
doesn't appear to work. The environment variables do not appear in theserver-config-init
container, nor is Cassandra started with the options.Did you expect to see something different?
Yes, Cassandra should start with the JVM options.
server-config-init starts with the following environment (does not contain expected variables):
Cassandra starts as follows (according to
ps aux | grep cassandra
):How to reproduce it (as minimally and precisely as possible):
┆Issue is synchronized with this Jira Task by Unito ┆friendlyId: K8SSAND-1724 ┆priority: Medium