-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Support naming customization on helm chart resources #31066
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
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
hussein-awala
left a comment
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.
We must pay attention that this can cause multiple resources to be recreated with different names, which may affect monitoring/logging of these resources or break something that was created outside of the chart.
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 we should have significant note about it at least. I am a little concerned about the case when the user had fullnameOverride set before and performs upgrade with this new chart. What would happen then? I guess the old resources would remin leaving the k8s deployment with many duplicate resources duplicated - differing by name.
I think (or maybe I am wrong) that the only way to upgrade in case someone already had fullnameOverride is to delete the old application using old chart and recreate it using the new one. Or delete the whole namespace before reinstalling.
Or am I wrong?
If I am not wrong - then If we are to implement this change we need to have a warning in the docs at least, possibly also some warning (if possible) when you override the old chart with the new and some viable path for our existing users to migrate.
50af30b to
1e5aa83
Compare
|
thanks for your review @potiuk
Actually
Technically speaking old resources will be deleted by helm if these are renamed, so they will just be replaces with the new resources. The only thing we need to be careful is with the PVCs created by statefulset/deployments, as that means data needs to be moved from the old PVC to the new PVC. To make this change non-disruptive, I've added on the next commit 084b66c this change as an opt-in via an option This PR bring consistency where by default it won't honor the standard naming convention (as-it has been) but optionally and at user's discretion they can opt in for standard naming conventions. This is also reflected in the unit tests, where no changes happened by default, only in the newly added tests when Always happy to hear for feedback 👍 |
I am absolutely for consistency! I love that PR in general, in case it was not clear. It's just we have to care not only about the "target" state but also how to guide our users to the "target" state from their current state, and possibly in the way that will not overwhelm us - maintainers - with "I upgraded to the new Helm Chart version from the previous one as usual and all hell broke loose" kind of issues :). Changing something is easy, but making it in the way that existing users wil not complain and have an easy path to follow is what I am worried about, and this is actually the GIST of that change and part of the change should be to consider the scenario, and have a ready answer for the users on what should they do.
Yep. this is a good step I think, but I also think we need to be a bit more specific for the migration steps. The current proposal here is a bit vague:
This is cool, but I wonder if we can somehow be a more precise od what needs to be done (or maybe even just say don't do it - delete and recreate your installation if you want to use standard naming? - this is perfectly fine IMHO). Also, maybe we can even figure out a way to find out that someone did not have I think if we don't set it on by default and find a good way how to address upgrades (even even by failing them if the value is nost set to false) then we are throwing the problem over the fence to future developers - who will have to bite the bullet. I would very much prefer to find a solution now. Of course we can always say - we will flip the flag in 2.* version of the chart when we make non-backwards-compatible release (and that is also acceptable) - but if we find a way to do it now without it, that would be even better (I think).
All right. I was not sure of that, but I did experiment and indeed helm nicely removed the old resources and added new ones, so that is cool. While doing the experiment noticed a few issues though (and I am sure our users will also do that, so I wanted to be able to go ahead and see what kind of problems they might have).
As you observed - lack of consistency. Not good.
So far, so good. Run There are some config errors |
Makes sense.. added some notes in chart/INSTALL let me know if that could be a bit more helpful for people that wants to use standard naming conventions
airflow-airflow-config should be fixed now, config and results-backend, I've standardized config and results-backend with the rest of the logic, thus I adjusted tests for those as well, but for those 2 upgrade goes smooth and get replaced gracefully airflow-postgresgl unfortunately we cannot change anything from postgres via airflow chart as this is a sub-chart, however we can pass "fullnameOverride to postgresql to influence the name we want. e.g if we want all resources to be prefixed with 'airflow-override' then we could do:
Should be working on the last commit, indeed it was mismatch on the config map name. I tried without useStandardNaming, with useStandardNaming and with/without fullnameOverride and they seem to be working Thanks again for the feedback |
|
@potiuk does it look good with the last version? |
|
thanks for approving running the workflows - I've just fixed the static lint errors - is this https://github.com/apache/airflow/actions/runs/5006110170/jobs/8971309829 a sporadic failure? as I believe that is unrelated to the helm chart isn't it? I've merged from main just in case |
|
looks like this time static checks are happy 👍 but Test docker-compose quick start kept failing and also InProgressDisabledPostgres11, Py3.7: Core Providers[-amazon,google] Other Providers[amazon] WWW API Always CLI Providers[google] - are those known flaky runs? |
|
I restarted those - let's see. We have a few flakes starting to appear recently. Let's see where the restart leads us. |
yay! looks like that did the trick - thanks |
|
any additional comments @potiuk or @hussein-awala? happy to address if any additional suggestions :) |
|
is it good to go @potiuk ? :) |
|
@hussein-awala / @potiuk any additional input? :) |
|
@fgalind1 I will not be able to test this PR this week, I will do that and add my review next week |
|
@hussein-awala / @potiuk / @jedcunningham wonder if you folks may have a chance to review this PR? :) Happy to address any feedback that's needed |
|
@hussein-awala / @potiuk / @jedcunningham folks sorry to bother again, but wonder if this PR could get any traction 😃 |
potiuk
left a comment
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 is mostly for @jedcunningham (sorry Jed) - this is all bout the back-compat thing. We are about to release new chart soon I think and this one is kinda, somewhat breaking and the question is is it breaking too much.
The new approach is totally different and needs a new review
potiuk
left a comment
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.
Looks fantastic. Approved - pending test succeeding.
|
cc:: @jedcunningham -> I think with the e2e tests and breeze support to run "standard Naming" I thiink this one looks really, really good. |
|
BTW. You also need to add the new flag to the _configy.py dictionary @fgalind1 - see the failing Breeze unit tests. This will make |
|
@jedcunningham /@potiuk can I have some help in approving the workflows? |
|
I've just rebased as it had conflicts with a merge changed on the output-commands-hash.txt. Would you mind approving the workflows again pls? |
|
does it look good @jedcunningham /@potiuk? 😄 |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
|
Thanks @fgalind1! Congrats on your first commit 🎉 |
|
🎉 |
|
thanks guys for the help! |
|
@jedcunningham /@potiuk do you guys know if there are plans to release the next helm chart 1.11.0 https://github.com/apache/airflow/milestone/77? :) |
|
Yes, very soon now that 2.7.1 is out. I plan to start on it tomorrow or next week. |
PR apache#31066 introduced a new option to standardize the naming of the different helm chart resources. However this didn't include also updating the reference when creating the pgbouncer connection in the metadata secret. This PR fixes that and makes sure we use the proper hostname for pgbouncer based on the new option useStandardNaming
PR #31066 introduced a new option to standardize the naming of the different helm chart resources. However this didn't include also updating the reference when creating the pgbouncer connection in the metadata secret. This PR fixes that and makes sure we use the proper hostname for pgbouncer based on the new option useStandardNaming

Some resources use
include "airflow.fullname" .helper and some just use{{ .Release.Name }}. fullname helper is a common good practice to name all the different helm resources.This allows to customize the resources and leverage the existing options
fullnameOverrideornameOverrideand have consistency in all resources to always useinclude "airflow.fullname" .This makes it much easier when deploying airflow as a dependency on another chart or in the same namespace, as we can clearly see airflow's chart name "airflow" in the resources and/or allow to customize the prefix for all airflow resources
The proposed helm chart was deployed in my local environment and all names match properly between deployments, secrets, configmaps, etc.