Skip to content
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

How to handle .Capabilities.APIVersions.Has #7

Closed
daurnimator opened this issue Aug 11, 2020 · 4 comments
Closed

How to handle .Capabilities.APIVersions.Has #7

daurnimator opened this issue Aug 11, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@daurnimator
Copy link

Various helm charts use .Capabilities.APIVersions.Has to change their behaviour based on resource types available in the destination cluster.
https://helm.sh/docs/chart_template_guide/function_list/#capabilitiesapiversionshas

How can I tell the chart inflator that different capabilities are available?

@mgoltzsche
Copy link
Owner

mgoltzsche commented Aug 11, 2020

kustomize is actually just a renderer and has no idea about the k8s cluster the rendered resources are deployed in. Correspondingly this helm plugin has no idea about the target k8s cluster either currently.
How is this solved in helm template? Is it querying the k8s API based on some option or config file?
Ideally that information should be statically configurable since, in many workflows, the rendered manifest will be rendered into a git repo by a CI pipeline before a CD pipeline with access to a concrete k8s cluster applies it.

@daurnimator
Copy link
Author

How is this solved in helm template? Is it querying the k8s API based on some option or config file?

Found helm/helm#5392

Looks like you pass a series of --api-version arguments to helm when invoking it.
I guess we should have a field in the renderer config that contains an array of api versions to pass along to helm?

@mgoltzsche
Copy link
Owner

Sounds good! We could indeed add such a field to the generator resource.
A PR would be welcome.

@mgoltzsche
Copy link
Owner

@daurnimator there's now a apiVersions field supported within the generator resource (see conditionalcr example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants