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
Chore: refactoring jsonnet to explicitly include the deployment mode in the config #3475
Conversation
…in the config Signed-off-by: Marco Pracucci <marco@pracucci.com>
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.
Not a jsonnet expert, but LGTM
I will keep this PR open for at least 1 business day to see if anyone has any objection. |
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.
One small nit is that I feel comparing to a string value can be a little bit fragile.
We could consider having $._config.is_microservices_deployment_mode
and $._config.is_read_write_deployment_mode
variables and referencing those, making the compiler enforce the correctness, and have a validation in the config to ensure that exactly one is set.
… mode is enabled Signed-off-by: Marco Pracucci <marco@pracucci.com>
|
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, one small suggestion.
Signed-off-by: Marco Pracucci <marco@pracucci.com>
…in the config (grafana#3475) * Chore: refactoring jsonnet to explicitly include the deployment mode in the config Signed-off-by: Marco Pracucci <marco@pracucci.com> * Add explicit booleans (checked by compiler) to check which deployment mode is enabled Signed-off-by: Marco Pracucci <marco@pracucci.com> * Rephrase error message to clarify what config option should be used Signed-off-by: Marco Pracucci <marco@pracucci.com> Signed-off-by: Marco Pracucci <marco@pracucci.com>
What this PR does
#3379 introduced read-write deployment mode support in jsonnet. When enabled, the read-write deployment mode jsonnet "uninstall" all microservices K8S resources (e.g. ingester statefulset). This was a trick introduced to not touch the microservices deployment at all in a initial stage.
In this PR I'm proposing a refactoring to introduce
deployment_mode
in the jsonnet config (defaults tomicroservices
) and then use it when defining K8S resources (e.g. do not defineingester_statefulset
at all ifdeployment_mode != 'microservices'
).This PR is expected to be a no-op with regards to all jsonnet tests.
Which issue(s) this PR fixes or relates to
Fixes #3364
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]