Repository navigation
Allow customization of API Versions when using Helm Template - #5392
Conversation
3a4e23c to
2361b74
Compare
|
hi @bacongobbler - would you be able to take a look at this addition to |
|
+1 |
|
This would be very useful! |
|
Agree, would be nice if this is going to be merged! |
|
Pending on this feature to be available. |
|
+1 |
|
@bnookala This is awesome, and the addition of the missing flags is just great ! A few things: |
|
@waveywaves I may be wrong, but I think presently helm doesn't make any assumptions about the structure of a chart (beyond certain expectations), so it seems like having a feature look for a certain directory (ie CRDs) might be out of the scope of what I was thinking for this. Given that a number of projects incorrectly generate manifests (argocd, fluent-bit, I'm sure others…) via helm template, I'd still love to have this, however I can imagine the Helm team to be a bit busy with Helm 3 at the moment. |
|
I like this @bnookala ! Could we have this feature in helm3 / "dev-v3" branch as well, please? |
thomastaylor312
left a comment
There was a problem hiding this comment.
This is looking great! Just need a super small change on the flag name and this will be good to go
2361b74 to
69b1964
Compare
…pi-versions or -a Signed-off-by: Bhargav Nookala <[email protected]>
69b1964 to
300aa76
Compare
There was a problem hiding this comment.
I know it's sorta last minute here, but I would LOVE to see some documentation on how users can consume this flag, where it's useful, etc.
Regardless thank you for the PR! Looking forward to seeing this in 2.15. I'll leave it for @thomastaylor312 to review and merge since he kicked off the review process.
|
@bacongobbler oh for sure, can totally do that - do you have a suggestion on where the docs should live? at a quick glance, thinking the "thinking about charts" section might be a good option: https://helm.sh/docs/using_helm/#thinking-about-charts |
|
@bnookala I would actually suggest somewhere here: https://helm.sh/docs/chart_template_guide/#debugging-templates Info on the template command was never added there and would be useful to have |
thomastaylor312
left a comment
There was a problem hiding this comment.
Thanks for all the hard work here
This is a port of helm#5392. It also takes care of the small chore to update the default k8s version to 1.16, which is the latest supported version Signed-off-by: Taylor Thomas <[email protected]>
This is a port of helm#5392. It also takes care of the small chore to update the default k8s version to 1.16, which is the latest supported version Signed-off-by: Taylor Thomas <[email protected]>
The commit introduces the `--api-versions` parameter for the `install` sub-command, which allows for users to set helm's Capabilities.APIVersions as needed for Cilium chart validation. If a user does not provide a value or set of values for `--api-versions`, then a discovery client will be used to auto-fill this value based on the available api versions in a cluster (see install/helm.go#L271). This change is needed because helm will not contact the k8s api server to determine what CRDs are installed into a cluster, leading to chart validation to fail anytime a CRD is required. For this reason, the `--api-versions` CLI argument was introduced to `helm template` (see pr [helm/helm#5392]). The cilium-cli does not allow for users to specify this argument to helm, therefore users can face a similar issue when installing cilium with certain features. For instance, enabling the use of prometheus ServiceMonitors will trigger a check for `monitoring.coreos.com/v1` while performing chart validation (by [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]), but since helm does not adjust Capabilties.APIVersions based on the CRDs installed in a cluster, helm will _always_ believe that `monitoring.coreos.com/v1` is not available. [helm/helm#5392]: helm/helm#5392 [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]: https://github.com/cilium/cilium/blob/v1.12.2/install/kubernetes/cilium/templates/validate.yaml#L21 Fixes: cilium#1107 Signed-off-by: Ryan Drew <[email protected]>
The commit introduces the `--api-versions` parameter for the `install` sub-command, which allows for users to set helm's Capabilities.APIVersions as needed for Cilium chart validation. If a user does not provide a value or set of values for `--api-versions`, then a discovery client will be used to auto-fill this value based on the available api versions in a cluster (see install/helm.go#L271). This change is needed because helm will not contact the k8s api server to determine what CRDs are installed into a cluster, leading to chart validation to fail anytime a CRD is required. For this reason, the `--api-versions` CLI argument was introduced to `helm template` (see pr [helm/helm#5392]). The cilium-cli does not allow for users to specify this argument to helm, therefore users can face a similar issue when installing cilium with certain features. For instance, enabling the use of prometheus ServiceMonitors will trigger a check for `monitoring.coreos.com/v1` while performing chart validation (by [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]), but since helm does not adjust Capabilties.APIVersions based on the CRDs installed in a cluster, helm will _always_ believe that `monitoring.coreos.com/v1` is not available. [helm/helm#5392]: helm/helm#5392 [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]: https://github.com/cilium/cilium/blob/v1.12.2/install/kubernetes/cilium/templates/validate.yaml#L21 Fixes: cilium#1107 Signed-off-by: Ryan Drew <[email protected]>
The commit introduces the `--api-versions` parameter for the `install` sub-command, which allows for users to set helm's Capabilities.APIVersions as needed for Cilium chart validation. If a user does not provide a value or set of values for `--api-versions`, then a discovery client will be used to auto-fill this value based on the available api versions in a cluster (see install/helm.go#L271). This change is needed because helm will not contact the k8s api server to determine what CRDs are installed into a cluster, leading to chart validation to fail anytime a CRD is required. For this reason, the `--api-versions` CLI argument was introduced to `helm template` (see pr [helm/helm#5392]). The cilium-cli does not allow for users to specify this argument to helm, therefore users can face a similar issue when installing cilium with certain features. For instance, enabling the use of prometheus ServiceMonitors will trigger a check for `monitoring.coreos.com/v1` while performing chart validation (by [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]), but since helm does not adjust Capabilties.APIVersions based on the CRDs installed in a cluster, helm will _always_ believe that `monitoring.coreos.com/v1` is not available. [helm/helm#5392]: helm/helm#5392 [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]: https://github.com/cilium/cilium/blob/v1.12.2/install/kubernetes/cilium/templates/validate.yaml#L21 Fixes: cilium#1107 Signed-off-by: Ryan Drew <[email protected]>
The commit introduces the `--api-versions` parameter for the `install` sub-command, which allows for users to set helm's Capabilities.APIVersions as needed for Cilium chart validation. If a user does not provide a value or set of values for `--api-versions`, then a discovery client will be used to auto-fill this value based on the available api versions in a cluster (see install/helm.go#L271). This change is needed because helm will not contact the k8s api server to determine what CRDs are installed into a cluster, leading to chart validation to fail anytime a CRD is required. For this reason, the `--api-versions` CLI argument was introduced to `helm template` (see pr [helm/helm#5392]). The cilium-cli does not allow for users to specify this argument to helm, therefore users can face a similar issue when installing cilium with certain features. For instance, enabling the use of prometheus ServiceMonitors will trigger a check for `monitoring.coreos.com/v1` while performing chart validation (by [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]), but since helm does not adjust Capabilties.APIVersions based on the CRDs installed in a cluster, helm will _always_ believe that `monitoring.coreos.com/v1` is not available. [helm/helm#5392]: helm/helm#5392 [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]: https://github.com/cilium/cilium/blob/v1.12.2/install/kubernetes/cilium/templates/validate.yaml#L21 Fixes: cilium#1107 Signed-off-by: Ryan Drew <[email protected]>
The commit introduces the `--api-versions` parameter for the `install` sub-command, which allows for users to set helm's Capabilities.APIVersions as needed for Cilium chart validation. If a user does not provide a value or set of values for `--api-versions`, then a discovery client will be used to auto-fill this value based on the available api versions in a cluster (see install/helm.go#L271). This change is needed because helm will not contact the k8s api server to determine what CRDs are installed into a cluster, leading to chart validation to fail anytime a CRD is required. For this reason, the `--api-versions` CLI argument was introduced to `helm template` (see pr [helm/helm#5392]). The cilium-cli does not allow for users to specify this argument to helm, therefore users can face a similar issue when installing cilium with certain features. For instance, enabling the use of prometheus ServiceMonitors will trigger a check for `monitoring.coreos.com/v1` while performing chart validation (by [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]), but since helm does not adjust Capabilties.APIVersions based on the CRDs installed in a cluster, helm will _always_ believe that `monitoring.coreos.com/v1` is not available. [helm/helm#5392]: helm/helm#5392 [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]: https://github.com/cilium/cilium/blob/v1.12.2/install/kubernetes/cilium/templates/validate.yaml#L21 Fixes: #1107 Signed-off-by: Ryan Drew <[email protected]>
The commit introduces the `--api-versions` parameter for the `install` sub-command, which allows for users to set helm's Capabilities.APIVersions as needed for Cilium chart validation. If a user does not provide a value or set of values for `--api-versions`, then a discovery client will be used to auto-fill this value based on the available api versions in a cluster (see install/helm.go#L271). This change is needed because helm will not contact the k8s api server to determine what CRDs are installed into a cluster, leading to chart validation to fail anytime a CRD is required. For this reason, the `--api-versions` CLI argument was introduced to `helm template` (see pr [helm/helm#5392]). The cilium-cli does not allow for users to specify this argument to helm, therefore users can face a similar issue when installing cilium with certain features. For instance, enabling the use of prometheus ServiceMonitors will trigger a check for `monitoring.coreos.com/v1` while performing chart validation (by [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]), but since helm does not adjust Capabilties.APIVersions based on the CRDs installed in a cluster, helm will _always_ believe that `monitoring.coreos.com/v1` is not available. [helm/helm#5392]: helm/helm#5392 [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]: https://github.com/cilium/cilium/blob/v1.12.2/install/kubernetes/cilium/templates/validate.yaml#L21 Fixes: cilium#1107 Signed-off-by: Ryan Drew <[email protected]>
[ cherry-picked from cilium/cilium-cli repository ] The commit introduces the `--api-versions` parameter for the `install` sub-command, which allows for users to set helm's Capabilities.APIVersions as needed for Cilium chart validation. If a user does not provide a value or set of values for `--api-versions`, then a discovery client will be used to auto-fill this value based on the available api versions in a cluster (see install/helm.go#L271). This change is needed because helm will not contact the k8s api server to determine what CRDs are installed into a cluster, leading to chart validation to fail anytime a CRD is required. For this reason, the `--api-versions` CLI argument was introduced to `helm template` (see pr [helm/helm#5392]). The cilium-cli does not allow for users to specify this argument to helm, therefore users can face a similar issue when installing cilium with certain features. For instance, enabling the use of prometheus ServiceMonitors will trigger a check for `monitoring.coreos.com/v1` while performing chart validation (by [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]), but since helm does not adjust Capabilties.APIVersions based on the CRDs installed in a cluster, helm will _always_ believe that `monitoring.coreos.com/v1` is not available. [helm/helm#5392]: helm/helm#5392 [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]: https://github.com/cilium/cilium/blob/v1.12.2/install/kubernetes/cilium/templates/validate.yaml#L21 Fixes: cilium#1107 Signed-off-by: Ryan Drew <[email protected]>
[ cherry-picked from cilium/cilium-cli repository ] The commit introduces the `--api-versions` parameter for the `install` sub-command, which allows for users to set helm's Capabilities.APIVersions as needed for Cilium chart validation. If a user does not provide a value or set of values for `--api-versions`, then a discovery client will be used to auto-fill this value based on the available api versions in a cluster (see install/helm.go#L271). This change is needed because helm will not contact the k8s api server to determine what CRDs are installed into a cluster, leading to chart validation to fail anytime a CRD is required. For this reason, the `--api-versions` CLI argument was introduced to `helm template` (see pr [helm/helm#5392]). The cilium-cli does not allow for users to specify this argument to helm, therefore users can face a similar issue when installing cilium with certain features. For instance, enabling the use of prometheus ServiceMonitors will trigger a check for `monitoring.coreos.com/v1` while performing chart validation (by [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]), but since helm does not adjust Capabilties.APIVersions based on the CRDs installed in a cluster, helm will _always_ believe that `monitoring.coreos.com/v1` is not available. [helm/helm#5392]: helm/helm#5392 [cilium/install/kubernetes/cilium/templates/validate.yaml#L21]: https://github.com/cilium/cilium/blob/v1.12.2/install/kubernetes/cilium/templates/validate.yaml#L21 Fixes: cilium#1107 Signed-off-by: Ryan Drew <[email protected]>
Signed-off-by: Bhargav Nookala [email protected]
What this PR does / why we need it:
Resolves #3377 for
helm template.This PR adds
--api-version(or-a) to add custom API versions to Capabilites.APIVersion, allowing a user to correctly render templates that depend on certain API versions.Special notes for your reviewer:
If applicable: