-
-
Notifications
You must be signed in to change notification settings - Fork 275
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 option to disable read-only/writable setting in operator #522
base: master
Are you sure you want to change the base?
Conversation
Hi @dougfales, sorry for the delay! This is an interesting feature and a useful one. I'm wondering if it can be a global mode for the operator. In other words to add an option flag to enable/disable it and using the helm chart to set Do you need this feature per cluster? What do you think? How do you use it? And I'm also curious to know more details about dougfales@5ab4183 😄 Thank you for your patience! 😄 |
Hey @AMecea, sorry for the delay on this one! I'm happy to report that we now run this in production in a fork, and that means we are also running the Presslabs operator in production, which is exciting! Thanks again to you and the Presslabs team for making it available.
That would be ok with me, if I understand correctly. Do you have an example of this global mode idea in the operator code somewhere so I could look into it?
No, this is a global thing for us. We prefer to manage RO/W status through other means.
I'll try to explain our reasoning and the background for wanting this, and if I miss anything important, @stankevich and @eik3 can jump in and correct me where I'm wrong or not specific enough...
In the end, we decided, the operator gives us so many nice things, but the ability to set the entire cluster read-only was not one of the things we needed. We could manage that ourselves with scripts or in orchestrator. So, we thought it would make sense to trade the cluster It's been working pretty well for us so far. If the master becomes read-only suddenly, we know it was either one of us, or orchestrator. The operator keeps chugging along, doing all of the useful things it does, but it stays out of orchestrator's way during failover.
Oh yes, this was done to make sure that a newly built cluster would always be writable after it was initialized. But then I discussed it with the guys, and we decided it was overly complicated for our needs. Instead, we set the master to writable as part of a deployment script. In that way, the change is consistent: the Operator won't touch the master's RO/W status, even during bootstrapping. |
I am a fan of this change because I also don't like the operator determining who should be RO/W. I want that job dedicated to be performed by Orchestrator. I've had the cluster get in odd states when being volatile with it, which normally is not an issue when it is simply Orchestrator managing it. |
Hi @dougfales no problem, I'm sorry for the delay! I'm glad that you are using MySQL operator in production! I would like to add this feature because I see that this feature that we've implemented of having control over MySQL server read-only state is buggy. We rely on this but having a switch will be beneficial for all of us!
So what I'm saying is to have a command-line flag defined here which will toggle this feature for all clusters and not for each cluster as you intended. There is no example but the implementation is similar and straight forward.
Why? Now the operator chart is compatible with helm v3, no need for tiller anymore 😄. We have a lot of logic inside that chart of how to configure Orchestrator. It will be useful to add support to deploy the operator using kustomize? I'm asking to understand the reasons and also to know how to improve the operator in the future. Also, I think we need a way to make the cluster writable. But this can be added later.
Did you have some examples of failure scenarios for dougfales@5ab4183? In conclusion, this will be a nice feature and I hope that it will be included in the next release. So If you have the time to complete it let me know. |
Awesome! 👍
Sounds good, I think that would work for us.
Cool, I'll look into that.
We don't use the helm charts due to a combination of things for us. One, we had already built an internal deployment tool, and two, we already had some experience with Orchestrator and we knew what we wanted for its configuration, so the charts were just an added layer for us to think about. And I'm not sure about kustomize for us specifically, but maybe others would find that to be a useful option. While I'm doing this, I will keep an eye out for any other Orchestrator settings we modified that make this type of setup more stable for us. If I find any, I'll include them in my updates.
Not really because I didn't test it heavily. In the end, I omitted it to keep this PR as simple as possible. But I could see it being useful in an application where you are creating new clusters dynamically and you want the operator to leave a new cluster in a writable state before it is considered "ready." If it failed to do that, then maybe we could retry a few times before giving up? I didn't get that far because we decided it wasn't worth having the operator do this one time thing that we could easily do with a deployment script.
Great! I'd love to see if I can add it as a global setting and update those Orchestrator settings in the charts. I'll have a look at this some more next week and see what I can do. Also, we have a few additional operator customizations that we're running in production which we'd like to submit in the next couple of months. We'll try to get those in soon. Thanks @AMecea! |
I don't think this is a good solution to do this.
|
We would prefer to manage the readable/writable state of mysql instances outside of the operator. On the rare occasion (for us) that the entire cluster must be set to RO, we will do this ourselves. In all other scenarios, we are used to trusting Orchestrator to do the right thing. As @chasebolt alluded to in #482, if you set
ApplyMySQLPromotionAfterMasterFailover
totrue
in the Orchestrator config, you can rely on Orchestrator make sure the newly promoted master becomes writable.This change allows you to specify
ignoreReadOnly: true
in your cluster settings in order to bypass all of thesetReadOnlyNode
/setWritableNode
inmarkReadOnlyNodesInOrc
.Because this setting doesn't make sense without also flipping the
ApplyMySQLPromotionAfterMasterFailover
switch, I've included some more explanation by that setting in the operator'svalues.yaml
.I've also tried to make it clear in the spec documentation that this setting is not to be changed without understanding that the burden is then on you, not the operator, to make your cluster writable.
Other Notes