k8ssandra / k8ssandra-operator

The Kubernetes operator for K8ssandra
https://k8ssandra.io/
Apache License 2.0
174 stars 79 forks source link

Make Reaper's backend configurable #1365

Closed rzvoncek closed 2 months ago

rzvoncek commented 4 months ago

What this PR does: This PR adds the option to configure Reaper to use a memory sotrage backend. If this storage type is used, Reaper will be deployed as a Stateful Set instead of a Deployment. It will also get a new volume to store the data on. This volume is not being cleared up after Reaper's parent k8ssandra cluster object gets deleted. This is intentional - we want to keep that data, plus it's a pre-work for deploying reaper individually (w/o the k8ssandra cluster).

Which issue(s) this PR fixes: Fixes #1275

Checklist

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 78.73563% with 37 lines in your changes missing coverage. Please review.

Project coverage is 59.14%. Comparing base (8804770) to head (6dc5aaf). Report is 20 commits behind head on main.

:exclamation: Current head 6dc5aaf differs from pull request most recent head af184aa

Please upload reports for the commit af184aa to get more accurate results.

Files Patch % Lines
pkg/reaper/deployment.go 85.81% 19 Missing and 1 partial :warning:
controllers/reaper/reaper_controller.go 43.33% 16 Missing and 1 partial :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/k8ssandra/k8ssandra-operator/pull/1365/graphs/tree.svg?width=650&height=150&src=pr&token=5FJ9A7ZBA1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k8ssandra)](https://app.codecov.io/gh/k8ssandra/k8ssandra-operator/pull/1365?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k8ssandra) ```diff @@ Coverage Diff @@ ## main #1365 +/- ## ========================================== + Coverage 58.65% 59.14% +0.48% ========================================== Files 122 122 Lines 11910 12049 +139 ========================================== + Hits 6986 7126 +140 + Misses 4315 4298 -17 - Partials 609 625 +16 ``` | [Files](https://app.codecov.io/gh/k8ssandra/k8ssandra-operator/pull/1365?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k8ssandra) | Coverage Δ | | |---|---|---| | [apis/reaper/v1alpha1/reaper\_types.go](https://app.codecov.io/gh/k8ssandra/k8ssandra-operator/pull/1365?src=pr&el=tree&filepath=apis%2Freaper%2Fv1alpha1%2Freaper_types.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k8ssandra#diff-YXBpcy9yZWFwZXIvdjFhbHBoYTEvcmVhcGVyX3R5cGVzLmdv) | `100.00% <ø> (ø)` | | | [pkg/reaper/vector.go](https://app.codecov.io/gh/k8ssandra/k8ssandra-operator/pull/1365?src=pr&el=tree&filepath=pkg%2Freaper%2Fvector.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k8ssandra#diff-cGtnL3JlYXBlci92ZWN0b3IuZ28=) | `63.63% <100.00%> (ø)` | | | [controllers/reaper/reaper\_controller.go](https://app.codecov.io/gh/k8ssandra/k8ssandra-operator/pull/1365?src=pr&el=tree&filepath=controllers%2Freaper%2Freaper_controller.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k8ssandra#diff-Y29udHJvbGxlcnMvcmVhcGVyL3JlYXBlcl9jb250cm9sbGVyLmdv) | `50.93% <43.33%> (-1.76%)` | :arrow_down: | | [pkg/reaper/deployment.go](https://app.codecov.io/gh/k8ssandra/k8ssandra-operator/pull/1365?src=pr&el=tree&filepath=pkg%2Freaper%2Fdeployment.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k8ssandra#diff-cGtnL3JlYXBlci9kZXBsb3ltZW50Lmdv) | `89.33% <85.81%> (-5.00%)` | :arrow_down: | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/k8ssandra/k8ssandra-operator/pull/1365/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k8ssandra)
rzvoncek commented 4 months ago

@burmanm , I've resolved all the comments you had, plus I've amended Reaper's e2e tests to cover deployment as a STS. I chose this instead of creating a brand new e2e test. I hope it's okay. Could you please have another look?

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
5 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

rzvoncek commented 2 months ago

Tests passed, merging.