Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Custom Cassandra YAML and JVM options. #9

Merged
merged 11 commits into from
Nov 8, 2019
Merged

Custom Cassandra YAML and JVM options. #9

merged 11 commits into from
Nov 8, 2019

Conversation

phrynchanka
Copy link
Contributor

What changes are proposed in this PR?

Resolves DCOS-59496
Resolves DCOS-59495

This PR Implement adding:

  • Base64 encoded Cassandra properties appended to cassandra.yaml.
  • Base64 encoded JVM Options appended to jvm.options.

Implementation steps :

  1. Added CUSTOM_CASSANDRA_YAML_BASE64 and CUSTOM_JVM_OPTIONS_BASE64 properties to params.yml
  2. Modified jvm-options.yaml and cassandra-yaml.yaml.
  3. Used b64dec template function to decode base64 property.

How were these changes tested?

Manually tested

  1. Install operator
  2. Look into pod cassandra-node-0 from k8s ui. On exec console cat the content of etc/cassadra/cassanda.yaml and etc/cassadra/jvm.options and see that properties were decoded and propagated.

Copy link

@samvantran samvantran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice @phrynchanka ! Only one minor nit but can we also add a test? Want to make sure this feature continues to works as we make future updates.

operator/templates/cassandra-yaml.yaml Outdated Show resolved Hide resolved
@phrynchanka
Copy link
Contributor Author

Very nice @phrynchanka ! Only one minor nit but can we also add a test? Want to make sure this feature continues to works as we make future updates.

@samvantran @mpereira
Thanks! Ok, I'm starting test implementation.

Copy link
Contributor

@mpereira mpereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @phrynchanka, this looks great!

I have left some requests, but none of them are blocking.

Do you intend on adding a test for JVM options as well?

operator/params.yaml Outdated Show resolved Hide resolved
operator/params.yaml Outdated Show resolved Hide resolved
tests/suites/sanity_test.go Outdated Show resolved Hide resolved
tests/suites/sanity_test.go Outdated Show resolved Hide resolved
tests/suites/sanity_test.go Outdated Show resolved Hide resolved
Pavel Hrynchanka and others added 3 commits November 6, 2019 16:18
Co-Authored-By: Murilo Pereira <[email protected]>
Co-Authored-By: Murilo Pereira <[email protected]>
Co-Authored-By: Murilo Pereira <[email protected]>
@phrynchanka
Copy link
Contributor Author

Thanks @mpereira !

Do you intend on adding a test for JVM options as well?

Yep. Now working on it.

Pavel Hrynchanka and others added 2 commits November 6, 2019 17:55
@phrynchanka
Copy link
Contributor Author

Test for jvm options done.

"github.com/mesosphere/kudo-cassandra-operator/tests/utils/cassandra"
"github.com/mesosphere/kudo-cassandra-operator/tests/utils/k8s"
"github.com/mesosphere/kudo-cassandra-operator/tests/utils/kubectl"
"github.com/mesosphere/kudo-cassandra-operator/tests/utils/kudo"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about this change.

return getConfigurationFromNodeLogs(namespaceName, instanceName, "o.a.c.service.CassandraDaemon - JVM Arguments: \\[(.+)\\]", ",")
}

func getConfigurationFromNodeLogs(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice approach.

Copy link
Contributor

@mpereira mpereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work @phrynchanka.

I've opened a PR on top of this PR with a few formatting and naming changes. Nothing blocking, but please take a look: #20

@mpereira mpereira changed the title Make Configurable JVM_OPTIONS_OVERRIDES and CASSANDRA_YAML_OVERRIDES Custom Cassandra YAML and JVM options. Nov 7, 2019
* Move cassandra.yaml related parameter to its block.

* Improve test name.

* Fix custom JVM options test name.

* Improve function name.

* Enforce 80 lines and consistency with line breaks.

* The KUDO dependency updated, reflect that.
@mpereira mpereira merged commit 46fc04b into master Nov 8, 2019
@mpereira mpereira deleted the DCOS-59495 branch November 8, 2019 14:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants