-
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 affinity and tolerations APIManager configurability for DeploymentConfigs #384
Conversation
For the moment I've implemented configurability in APIManager level for APIcast production and APIcast staging DeploymentConfigs. @eguzki please let's first review the implementation to see if we can go forward with this. Thank you |
Looks go. For database DC as well. |
de0645c
to
f89e5e6
Compare
I've added fields and implementations for both non-db and db DCs. As originally commented in issue system-memcached. I've added two fields in the main 'System' section: system-sphinx. I've added a new section called 'sphinx' in 'system' zync-database. I've added two fields in the main 'Zync' section: The reasons why sphinx has its own section and the others don't are:
I also have some doubts regarding the naming of memcached and zync postgresql. If you look at the Jira issue memcached: maybe a more generic term name than memcached that is not limited to memcached implementation in case it changes in the future (for example being in redis instead of memcached)? It's true though that we already have memcached-named fields (memcachedImage) Finally, keep in mind that depending on what changes are performed it might additional code migrations (due to possible deprecations of fields, changes in current schema, ...) I've also just realized that currently some reconcilers would not be reconciling affinity and tolerations. We have to change the mutators/create new mutators for the following items so reconciliation of affinity and nodeaffinity is performed: The reason for that is that some use the CreateOnlyMutator, others use the Resources mutator only, some others have a custom one, ... so we need to create new custom mutators for each of them. EDIT: I've also realized that some unit tests are failing due to nil pointer exceptions when dereferencing some intermediate sections of the CR. The issue does not happen when in a real environment and the reason for that is that those intermediate sections are initialized by the controller using the Please let's review the current implementation before continuing. Thank you. |
f89e5e6
to
a0e02a3
Compare
For unittest, you can "initialize" your apimanager objects calling |
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.
LGTM so far
@@ -41,19 +41,1353 @@ spec: | |||
type: boolean | |||
productionSpec: | |||
properties: | |||
affinity: |
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.
Definitely this CRD file is not human readable anymore. It is already too big.
We have to trust on tooling
a0e02a3
to
2eb48ee
Compare
Even if we don't provide configurability for a specific DeploymentConfig, due to affinity and tolerations are nil by default no changes will be detected so it can be applied to all DeploymentConfigs
2eb48ee
to
5a81cc0
Compare
New changes made:
Ready for review @eguzki |
Overall LGTM. I miss some documentation example. Updating API reference is not enough. Something like, let's configure:
I guess this is going to be useful eventually. |
Being advanced use cases I considered there was not much point on having specific examples for it but I've added an example anyway 👍 |
57aa4b0
to
3185e63
Compare
…ons customization
3185e63
to
67f1fed
Compare
Code Climate has analyzed commit 67f1fed and detected 25 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
This PR intends to add configurability of affinity and tolerations in APIManager for DeploymentConfigs (database and non-database ones)
The implementation has the following remarkable points: