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

flatten ghost package with better envs handling #3398

Closed
wants to merge 3 commits into from

Conversation

yuwenma
Copy link
Contributor

@yuwenma yuwenma commented Jul 21, 2022

Related to #3343.

The nested structure for ghost package is unnecessary.

Nested package actually makes user configuration harder:
Deployment and StatefulSet spec.template.spec.containers[].env have shared env configurations like BITNAMI_DEBUG ALLOW_EMPTY_PASSWORD. Users today need to update the config twice. This progress can be much simplified (and better protected) if we can change the containers[].env to use configMapKeyRef.

This PR also fixes the MariaDB config name my.cnf, This file name is a MariaDB convention doc

@yuwenma yuwenma changed the title flatten ghost package flatten ghost package with better envs handling Jul 21, 2022
Copy link
Contributor

@justinsb justinsb left a comment

Choose a reason for hiding this comment

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

I like this direction!

@@ -5,7 +5,7 @@ metadata:
name: mariadb
namespace: example
data:
my.ini: |-
my.cnf: |-
Copy link
Contributor

Choose a reason for hiding this comment

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

I remember some discussion about keepting the extension to ini. Is it intended change ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I added the reason in the PR description. The my.cnf is MariaDB default config file name

value: "true"
envFrom:
- configMapRef:
name: ghost-env
Copy link
Contributor

Choose a reason for hiding this comment

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

One disadvantage of using the same configmap here is that any config change to that configmap affects restarting ghost-app and mysql. ghost-app config is superset of mysql. Like changing the ghost-app's host is going to restart the mysql for now reason.

So an optimal solution could be, define two config-maps. one for db config and another for pure ghost-app config.

ghost-app's config will be provided by both the config-map and mysql one will be powered by just the db configmap.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One disadvantage of using the same configmap here is that any config change to that configmap affects restarting ghost-app and mysql. ghost-app config is superset of mysql. Like changing the ghost-app's host is going to restart the mysql for now reason.

That's true. Restarting both to align the env change is expected behavior. One issue I had today is that I only updated the env config for MariaDB (so we saw the MariaDB pod works) but not Ghost host.

So an optimal solution could be, define two config-maps. one for db config and another for pure ghost-app config.

ghost-app's config will be provided by both the config-map and mysql one will be powered by just the db configmap.

Sure, I can use two ConfigMaps since the envFrom accept a list

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually thought some more and realized, this looks nice from config organization perspective but functionally is inferior to previous approach of inline config in the deployment itself. Because now I have to worry about updating the deployment or statefulset otherwise new change will not rollout and in the previous approach it will happen automatically :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another thing I discovered is that the envFrom cannot be updated. This seems not to be the model we are looking for.

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.

3 participants