Overhaul ingress configuration #679
Reference in New Issue
Block a user
Delete Branch "fix-674"
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?
Description of the change
Redesigned ingress configuration to align better with implicit best practices.
Benefits
extensions/v1beta1) and always usenetworking.k8s.io/v1Possible drawbacks
Hopefully 🙃 none
Applicable issues
fix #674
Additional information
ingress.annotationsvia helperstests/deploymenttotests/ingresspathandpathTypeare always renderedingress. pathTypeingress.hosts[0].pathsto[]to ensure proper rendering via template⚠ BREAKING
I think all of these changes should be backward comp with existing ingress definitions, but surely worth highlighting in the changelog of the release.
Checklist
values.yamland added to theREADME.mdusing readme-generator-for-helmREADME.mdLooks like the ability to customize is now gone. We either have to restore this, or drop the unused values key.
Well spotted!
The doc says:
Maybe this was needed in the past but I don't see how/why argocd specifically would need this option. Having
ingress.apiVersionas an option is also quite uncommon, looking at other charts.I'll remove it from the docs. Let me know if this is ok for you.
EDIT: Ah, found the initial reason: https://gitea.com/gitea/helm-chart/issues/251
3 years ago, meanwhile the networking resource is out of beta anyway, and I think argocd is also fine with it. At least I haven't found any issues in my argocd install.
@justusbunsi I also added a deprecation for
ingress.classNamein favor ofingress.ingressClassName.I had some issues with the
deprecation.yamltemplate and getting the unittests to work.Specifically, the
failcall wasn't honored as the unittest only renders theingress.yamltest file and notdeprecations.yaml. When including the latter, other testing issues arise.We might want to think about moving everything inside
deprecation.yamlintohelpers.tpland include the specific tasks with adefineinto the respective templates. This might ease compatibility withhelm-unittests. Let me know what you think about the current structure here and the general topic. This is of course it's own topic then.The old apiVersion is outdated since Kubernetes 1.22. Quite some time. Works for me to remove this option. 👍
What is the intention for doing so? IMO,
ingress.ingressClassNameis duplicated information. You are already iningressobject.Good idea to move the deprecations into
helpers.tpl. Should be done in a separate PR.ingressClassNameis the canonical naming across most charts and from k8s itself. While on it to revamp the ingress definition, I wanted to align with naming conventions.If you're ok with this PR in general, we could include it in the release together with the 1.22.1 upstream release (which we should get out soonish, as it contains many bug fixes).
Feel free to merge and create a release if everything looks ok to you.
I obviously made changes 😉. But somehow I am still not completely happy with the current changes. I can see similarities to the Hashicorp Vault Helm Chart1 which I consider not the easiest approach from a user perspective. Right now it is very hidden that the ingress
pathcan be changed. The emptyingress.hosts[0].pathsis misleading with the newly extracted values. What would take precedence: Extracted values or explicitly defining an entry of thatpathsarray? You'd have to mix'n'mesh them all to get the same rendered resource as right now. ThepathTypechange is even breaking right now.I am not against a breaking change, not at all. Especially not for our ingress definition. I suggest we completely eliminate the
ingress.hostsarray and define the main ingress resource settings at root level of theingressobject. Like the ones you introduced. That way, the main ingress settings become easier to define (and to handle during templating). If we want to keep the ability to add additional hosts/paths/..., I suggest adding anextraHostsarray that is capable of the currentingress.hosts. I took inspiration from the Bitnami MinIO Helm Chart2 .I suggest we improve this PR and release it as a dedicated major change version (we don't have to wait for the next Gitea release to do so). I didn't liked the idea to completely rewrite the PR without discussing this.
https://github.com/hashicorp/vault-helm/blob/636f8da6a614e596fb0af9cb119e3a5816f8ef5a/templates/server-ingress.yaml#L56 and https://github.com/hashicorp/vault-helm/blob/636f8da6a614e596fb0af9cb119e3a5816f8ef5a/values.yaml#L423-L434 ↩︎
https://github.com/bitnami/charts/blob/8cf3a792d4ec1db94d581b12e342a892404a0461/bitnami/minio/values.yaml#L796-L854 ↩︎
Just FYI I am still on it and hope to get to it again in the coming days/weeks.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.