Issues upgrading on Kubernetes 1.25 - bump the Postgres (and possibly other) chart dependencies? #387
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
My Gitea won't update, with the following error:
The version of the Postgres chart used is pretty old, I'm thinking it's probably time to bump it? That may also explain why it's trying to look for
PodSecurityPolicy
, even though they've been removed from Kubernetes (deprecated in 1.21, removed in 1.25, which is where I've been seeing these issues).Thanks for the info!
One can surely think about bumping these versions (esp. for compat with k8s 1.25) though I am not sure we can provide all the required testing for various k8s versions constantly.
Most large cloud providers are at 1.24 now with 1.25 coming in Q1 2023.
In your case, you seem to have a conflict between k8s and and old postgres (chart) version. I guess it's your turn here bumping the version for compatibility for the moment. I guess the easiest might be to stay on the respective major version and just bump the to the latest patch version.
My personal opinion on this matter is: I would avoid depending on dependencies of charts if these are crucial elements like databases. A managed DB service solves a lot of headaches - or at least a central DB that you use for multiple services.
@justusbunsi What is your opinion here? I could also see a solution that sets all of these to
:latest
and adds a warning into the README that we do not recommend relying on this config for production installs?Another, more drastic one, would be to force users to connect to an external DB and not even ship a fallback dependency to avoid future pains (or only ship one for testing purposes). I sometimes see this practice in other charts, i.e. just requiring a successful connection to an external DB in the first place.
Looking at the Nextcloud Helm chart (which similarly bundles Postgres, MariaDB, etc), this is what they do:
These deps are then occasionally bumped, which also prompts a bump of the major version of the chart.
Users of the chart should know that a new major version of the Gitea Helm chart means they should check the changelog for any breaking changes. In the changelog/release notes of said newer major version, you could note that the Postgres dependency was bumped. IMO this is quite reasonable.
What you describe here is how an potential upgrade procedure would work in terms of NEWS etc. This is pretty clear and actually not the "problem" and I think we all agree on the procedure.
The questions are more generic:
:latest
would be a better pick here, being aware of all the issues that come when working with a:latest
tagAll ideas are welcome!
I think this is a good issues to think a bit more about the bigger picture rather than doing a "quick fix" - this can already easily be done by changing the image tag on the user level.
Helm supports marking a template with kubeVersion. That would be a way to set a semVer range for a given chart.
We are still looking for a best practice approach for managing the k8s api changes, such as this. Looking at separate charts (ugh) or using a macro to detect the kubernetes version and then adapt the chart accordingly.
IMO :latest is more problematic by default. Users can always override the image field if they want to in their own deployments.
Agreed, testing all combos of versions is not really practical, but best effort and then adapt based on feedback.
Helm is usually flexible enough that a lot of things can be hacked or templated over to get around issues, so users aren't generally 'stuck' and waiting for a release.
Not sure if I'm misunderstanding, but to be clear, I think my issue is not with the image version of Postgres which I know I can bump, but with the chart version of the Postgres chart bundled with the Gitea chart which (as far as I know?) I cannot bump.
I think, because the Bitnami Postres chart is set to an old version, it doesn't properly implement not trying to install a PodSecurityPolicy, which my cluster does not have (it was removed in k8s 1.25). So I think I need a newer version of the Postgres Helm chart that does not try to do anything with the PSP, because atm it is refusing to Helm upgrade my Gitea install (the aforementioned
no matches for kind "PodSecurityPolicy" in version "policy/v1beta1
). Hopefully that made a bit more sense.The postgresql chart has a config override (confirmed in gitea helm chart v5.0.9).
try adding that property to the 'postgres:' section of your values.yaml to override.
The wider conversation is about how to manage k8s api change (& deprecation) and dependency versions.
I found that Helm has some built-ins for kubernetes version management. This looks to be a solid approach.
h/t: https://renehernandez.io/snippets/customize-api-version-helm-templates/
Ah yes, you cannot (easily). I think we need to upgrade this one to have proper k8s support.
Looking at https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/ there might be a bit of work needed but we can just see how it goes.
@sseneca I can create a branch with 11.x and you could potentially test this with helm-git if that helps? We can also try going to 12.x afterwards if you're interested.
@mattrpav Thanks for the info! Though I think putting the time in to go with the latest release of the chart might make more sense in contrast to adding (complex) semver conditions for k8s versions?
Hey, really bad timing I know but just before that branch went up, I decided to just downgrade my cluster, delete the PSP, upgrade Gitea, and then upgrade my cluster again. This worked fine, but I unfortunately can't test your solution.
See #391
Assuming this has been solved by the PG dependency bump.