-
Notifications
You must be signed in to change notification settings - Fork 96
⚠️ Make helm chart values extensible per component #638
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
Welcome @rbjorklin! |
Hi @rbjorklin. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-cluster-api-operator ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/ok-to-test |
@rbjorklin hey, would you be able to look into failing CI tests and fix them, so that we can start reviewing it ? |
0eeb087
to
d297aca
Compare
1691bc3
to
d22f12b
Compare
Fixed, please take a look! |
@furkatgofurov7 given that this changes the structure of |
@rbjorklin good idea, it seems to be useful when using |
@furkatgofurov7 I have just pushed a minimal ❯ helm template test hack/charts/cluster-api-operator
Error: values don't meet the specifications of the schema(s) in the following chart(s):
cluster-api-operator:
- bootstrap: Invalid type. Expected: array, given: string
- controlPlane: Invalid type. Expected: array, given: string
- infrastructure: Invalid type. Expected: array, given: string
- addon: Invalid type. Expected: array, given: string
- ipam: Invalid type. Expected: array, given: string
- core: Invalid type. Expected: object, given: string |
@furkatgofurov7 @afarbos reworked and tests are passing. Please take a look! 🙏 |
This introduces a minimal values.schema.json file to catch the breaking structural changes made to the values.yaml file in the related commits to this PR. This will cause the 'helm template' or 'helm lint' commands to throw errors and require consumers of the chart to fix their values.yaml before deploying.
This is required because iterating over a list and a dict does not necessarily result in the same order of elements.
I've addressed the review comment by @afarbos. I'd like to believe that this is in merge:able shape now! |
core: "" | ||
bootstrap: "" | ||
controlPlane: "" | ||
infrastructure: "" | ||
ipam: "" | ||
addon: "" |
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.
So, now options have been updated to use structured objects for providers instead of plain strings. Could it be potentially a breaking change since existing deployments rely on the old string format and need to be updated to the new format?
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.
It is, this would be a major upgrade for the helm 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.
Yeah this is a breaking change which is why I have put the values.schema.json
file as that will catch the breaking change and provide an appropriate warning when users try to render. This is what they will see.
core: "" | ||
bootstrap: "" | ||
controlPlane: "" | ||
infrastructure: "" | ||
ipam: "" | ||
addon: "" |
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.
It is, this would be a major upgrade for the helm chart.
{{- range $name, $addon := $.Values.addon }} | ||
{{- $addonNamespace := default ( printf "%s-%s" $name "addon-system" ) (get $addon "namespace") }} | ||
{{- $addonName := $name }} | ||
{{- $addonVersion := get $addon "version" }} |
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.
{{- $addonVersion := get $addon "version" }} | |
{{- $addonVersion := get $addon "version" }} | |
{{- $addonEnabled := default (get $addon "enabled") true }} | |
{{- if not $addonEnabled }} | |
{{- continue }} | |
{{- end }} |
I would have use enabled, no?
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 figured range
ing over the the dict was sufficient. If the dict is empty no manifests will be created. I can add the enabled
check if you prefer though.
Sidenote: Helm does not actually have a continue
keyword.
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexander-demicev The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Thanks @rbjorklin for patience and pushing this to the finish line.
/retitle
/lgtm
LGTM label has been added. Git tree hash: 4d06ee6100c17372717d5b17a680038d8669e43f
|
@rbjorklin hey, I noticed we forgot to have some docs around this breaking change. Would you be willing to contribute to document it, which would greatly help existing/new users facing challenges with the new values schema. |
What this PR does / why we need it:
When deploying clusters to AKS using Workload Identity an annotation is required on the service account and a label is required on the pod. By extending the chart to expose the already existing functionality to patch provider manifests this PR allows for setting up AKS clusters using Workload Identity.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #