-
Notifications
You must be signed in to change notification settings - Fork 95
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
Add support for PodDisruptionBudget #308
Conversation
056e6a9
to
d2f46b6
Compare
Hi @wei-lee, Thank you for the contribution. I've been trying the PodDisruptionBudget and the behaviour I understand it has is the following one:
As I understand, apart from enabling the PodDisruptionBudget field, to really use this functionality the number of replicas of the different components have to be configured with more than one replica. Otherwise downtime avoidance is not prevented. We are currently reviewing the code and we'll get back to you with feedback about it. Thank you. |
Yes, that's right.
That's right too.
Yes, right again.
Thank you for reviewing! |
Good Job 🏅 The PR introduces lots of changes. Reviewing will continue |
Feel free to ask anything about the code structure. Happy to answer |
No PDB has been created for |
@wei-lee Fair enough. To be honest we do not even know if it is scalable. My bet is that it is actually scalable. Furthermore, the operator creates a service for it. For this PR, we are not creating PDB for |
looking soo good, congrats @wei-lee 🏅 |
@miguelsorianod @eguzki Thanks for the review, really appreciated it. I think I have addressed all your comments now, do you mind taking a look again and let me know if there is anything else you want to change. Thanks a lot! |
Forgot to mention I have also deployed the 3scale operator to an openshift cluster and it works fine. |
Functionality wise looks good to me 👍 . I've also tried to deploy it in my local cluster and trying to enable and disable PodDisruptionBudget and it works correctly too 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be almost merged. To me there's only pending to address the go.sum changes and the generated openapi changes that we left you feeback about.
Also before merging the PR, can you clean the commit history?
We usually have one or more commits for the code functionality (separated in "logical" commits) and another different commit with the generated templates that we usually name it as "generator: update templates".
Thank you.
4e56164
to
c7824fc
Compare
@miguelsorianod I have now reverted changes to the I also regenerated the files by using 0.8.0 version of the operator-sdk by running |
Hi @wei-lee, The changes in the pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go and pkg/apis/apps/v1alpha1/zz_generated.openapi.go files are expected and correct now. The changes are expected because are due to the addition of the PodDisruptionBudget changes so it's ok in that regard 👍 . About the deploy/crds/capabilities* files please exclude those changes from the commits. Those changes happens because some fields in the CRDs are not generated by the operator-sdk's openapi generator tool but we wanted to include them to offer security at deploy time. |
@miguelsorianod understood. Thanks for the detailed explanation. I will make the changes you suggested. |
9ce30d3
to
e8a4557
Compare
@miguelsorianod ok, all issues are addressed now. Please let me know if there is anything else you need. Thanks for the help! 👍 |
Hi @wei-lee, The final state of the changes looks good now 👍 Regarding the commit history, I think the commits do not correspond with the changes. On the update templates commit I do not see that the amp-ha template changes are there, which should be the only file in that commit. |
@miguelsorianod is it ok if i just merge the 2 commits to 1? The commits are already squashed so it will be tricky to reorganise them again. |
@wei-lee this is one of my favorite git tricks. Merge both commits into one, and then split them as you wish. Split commit in two https://emmanuelbernard.com/blog/2014/04/14/split-a-commit-in-two-with-git/
|
@eguzki thanks for the trick. That's really useful. Will try that now. |
e8a4557
to
1e10de5
Compare
Code Climate has analyzed commit 1e10de5 and detected 46 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
@miguelsorianod thanks again @eguzki for the trick, it is easier than I thought. Now it should be ok now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me now and on my view it can be merged, good job 👍
Thank you very much, we appreciate your contribution and work on this @wei-lee.
WHAT
This PR will add support for PodDisruptionBudget to the 3scale operator. See JIRA.
HOW
A new feature flag is introduced to the
APIManager
CRD to allow users to enable this feature. An example can be found here.When enabled, the following PDBs are created:
All PDBs have the
MaxUnavailable
field value set to1
. This will ensure when the node is being drained, only 1 pod per component is allowed to be evicted. We do not to update/delete these PDBs even if there is only 1 instance of these components are deployed as it won't violate the rules in PDBs. Also all the components can still be scaled up and down as normal. It will be count against the PDB rules, but PDB won't stop replica controllers from scaling down the pods.Verification
To verify:
quay.io/wei_lee/3scale-operator:test
.