Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 63: Enabling ephemeral storage for zookeeper. #64

Closed

Conversation

HoustonPutman
Copy link
Contributor

@HoustonPutman HoustonPutman commented May 2, 2019

Changelog Description

This PR allows users to create zookeepers with ephemeral storage instead of PVCs.

To enable ephemeral storage, omit

spec:
    persistence

This change breaks backwards compatibility, but it does adhere to the documentation of the Zookeeper CRD:

// PersistentVolumeClaimSpec is the spec to describe PVC for the container
// This field is optional. If no PVC spec, stateful containers will use
// emptyDir as volume.
PersistentVolumeClaimSpec *v1.PersistentVolumeClaimSpec `json:"persistence,omitempty"`

Purpose of the change

Fix #63

How to verify

Start the operator, create a Zk cluster without persistence.

Signed-off-by: Houston Putman hputman1@bloomberg.net

@HoustonPutman HoustonPutman force-pushed the issue-63-ephem-storage branch 2 times, most recently from df7f4f9 to 5a25d41 Compare May 3, 2019 16:00
@codecov-io
Copy link

Codecov Report

Merging #64 into master will decrease coverage by 0.61%.
The diff coverage is 70.45%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #64      +/-   ##
=======================================
- Coverage   52.61%   52%   -0.62%     
=======================================
  Files           5     5              
  Lines         785   800      +15     
=======================================
+ Hits          413   416       +3     
- Misses        345   355      +10     
- Partials       27    29       +2
Impacted Files Coverage Δ
...kg/apis/zookeeper/v1beta1/zz_generated.deepcopy.go 0% <0%> (ø) ⬆️
...g/apis/zookeeper/v1beta1/zookeepercluster_types.go 90% <100%> (+0.08%) ⬆️
pkg/zk/generators.go 82.43% <72.72%> (-3.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d42ddf...2c7f01d. Read the comment docs.

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #64 into master will decrease coverage by 0.61%.
The diff coverage is 70.45%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #64      +/-   ##
=======================================
- Coverage   52.61%   52%   -0.62%     
=======================================
  Files           5     5              
  Lines         785   800      +15     
=======================================
+ Hits          413   416       +3     
- Misses        345   355      +10     
- Partials       27    29       +2
Impacted Files Coverage Δ
...kg/apis/zookeeper/v1beta1/zz_generated.deepcopy.go 0% <0%> (ø) ⬆️
...g/apis/zookeeper/v1beta1/zookeepercluster_types.go 90% <100%> (+0.08%) ⬆️
pkg/zk/generators.go 82.43% <72.72%> (-3.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d42ddf...2c7f01d. Read the comment docs.

Signed-off-by: Houston Putman <hputman1@bloomberg.net>
@HoustonPutman
Copy link
Contributor Author

Rebased to comply with new Persistence option.

Now ephemeral storage is enabled if Persistence is not provided.

Signed-off-by: Houston Putman <hputman1@bloomberg.net>
Copy link
Contributor

@adrianmo adrianmo 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 contribution @HoustonPutman. Let me share my thoughts on this.

On one hand, I'm a bit concerned about altering the default persistence settings as it can inadvertently impact users who might be thinking that their data is still persisted, but it's not.

On the other hand, I think this change makes sense, adheres to the documentation, and we are still on time to make breaking changes as the project is in alpha state.

From my side, I'm more inclined to making this change. I'll review the code if there's a consensus on accepting the change.

@Tristan1900 @spiegela what do you think?

@Tristan1900
Copy link
Member

I agree with you @adrianmo, this is a good change since it just implements what the doc promises. I would vote to make the change.

@HoustonPutman
Copy link
Contributor Author

I should also mention, that I updated the format checking script to output the diffs of the expected vs. actual formatting. Making it much easier to debug, since the formatting is tested against multiple go versions.

@HoustonPutman
Copy link
Contributor Author

Have y'all had a chance to look at the implementation?

@prune998
Copy link

prune998 commented Sep 9, 2019

Any issue on that ? Can it be merged ?

@@ -467,7 +467,7 @@ func (r *ReconcileZookeeperCluster) yamlConfigMap(instance *zookeeperv1beta1.Zoo
}

func (r *ReconcileZookeeperCluster) reconcileFinalizers(instance *zookeeperv1beta1.ZookeeperCluster) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we need coverage of reconcileFinalizers, but it isn't currently there, so I'll file that in a separate issue.

Copy link
Contributor

@spiegela spiegela left a comment

Choose a reason for hiding this comment

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

Sorry for the delay getting back around to this. These changes all look good to me. Thanks!

@HoustonPutman
Copy link
Contributor Author

Thanks for approving @spiegela! Can we get this merged?

@spiegela
Copy link
Contributor

spiegela commented Nov 4, 2019

@pbelgundi can you also provide a review for this?

@priyavj08
Copy link

when can we expect this to be merged?

thanks

@HoustonPutman
Copy link
Contributor Author

Is there anything blocking this getting approved/merged @pbelgundi?

@pbelgundi pbelgundi requested review from anishakj and removed request for pbelgundi May 4, 2020 09:31
Copy link
Contributor

@anishakj anishakj left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@pbelgundi pbelgundi left a comment

Choose a reason for hiding this comment

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

Before any change is merged, it is necessary to have it tested it for the following usecases, manually if automated testing is not feasible:

  1. Deployment & Deletion ( same & separate NS)
  2. DR (delete 1, multiple, all ZK pods, delete ZK STS and it should be able to come back up functioning correctly…)
  3. Upgrades/Rollback
  4. Cluster Scale Up/Down.

Spec: persistence.PersistentVolumeClaimSpec,
})
} else {
extraVolumes = append(extraVolumes, v1.Volume{
Copy link
Contributor

Choose a reason for hiding this comment

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

Our zookeeperStartup.sh script relies on persistent volumes to be able to handle server restarts which will be broken when using ephemeral volumes.

Copy link
Contributor

@pbelgundi pbelgundi left a comment

Choose a reason for hiding this comment

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

Defaulting to ephemeral storage breaks our DR Strategy. While I like the idea of using ephemeral storage with Zookeeper, at this point it can't be made a default option.

@spiegela
Copy link
Contributor

Defaulting to ephemeral storage breaks our DR Strategy. While I like the idea of using ephemeral storage with Zookeeper, at this point it can't be made a default option.

@pbelgundi If we make this a non-default option, is everything else in this PR kosher? If so, perhaps we should create a parallel PR with the changes we need to get this unblocked.

@pbelgundi
Copy link
Contributor

Defaulting to ephemeral storage breaks our DR Strategy. While I like the idea of using ephemeral storage with Zookeeper, at this point it can't be made a default option.

@pbelgundi If we make this a non-default option, is everything else in this PR kosher? If so, perhaps we should create a parallel PR with the changes we need to get this unblocked.

Yes, I'm good as long as existing defaults don't change.

@HoustonPutman
Copy link
Contributor Author

Better implementation available at #215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Zookeepers to be run with ephemeral storage.
10 participants