-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add helmChart support to kustomize.Directory resource #2470
Comments
Looks like we need to upgrade to krusty v0.14 to get this functionality |
Didn't see that on the api release for 0.14, am I looking in the right place? Where did you get this information from? https://github.com/kubernetes-sigs/kustomize/releases/tag/api%2Fv0.14.0 |
Hi @jaxxstorm - could you provide a little more detail around what the desired design / UX looks like here? Is this an option we'd like to pass down through the pulumi cli to the provider? What would the intended behavior be when it is provided? |
@kpitzen I'm not super familiar with this myself, but from a quick google: https://github.com/kubernetes-sigs/kustomize/blob/master/examples/chart.md
I believe this just needs to be added to the provider |
--enable-helm
command line option to kustomize resources
Thanks for the effort, really looking forward to this release. That was super fast and I'm really happy with the result. 🙇♂️ |
Looks like this was shipped in 3.30.1 so closing, thanks all! |
Cannot close issue without required labels: |
The long-term plan for Helm support in Kustomize: kubernetes-sigs/kustomize#4401 |
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ## Proposed changes This PR implements the Kustomize `Directory` resource (v2) as a multi-language component resource. The `Directory` resource creates child resources based on a kustomization directory. The input is a path to a directory containing 'kustomization.yaml', or a git repository URL with a path suffix and other qualifiers. ### Related issues (optional) <!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes #1234'. Or link to full URLs to issues or pull requests in other GitHub repositories. --> Closes #2786 ### API |property|description| |-|-| | `directory` | The directory or git URL containing the kustomization to apply. | | `namespace` | Overrides the default namespace. | | `skipAwait` | Applies the skipAwait annotation. | | `resourcePrefix` | Prefix for child resources, defaults to the component name. | ### Feature: Remote Targets This implementation supports remote kustomization targets as described [here](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md). Note: the v1 implementation also supports git references, but resolves them using the Pulumi SDK ([`RetrieveGitFolder`](https://github.com/pulumi/pulumi/blob/v3.117.0/sdk/go/common/workspace/templates.go#L392)) rather than using Kustomize's own implementation. ### Feature: Enable Alpha Plugins This implementation always enables Kustomize's plugin support, akin to `kustomize build --enable-alpha-plugins`. Plugins are drawn from `KUSTOMIZE_PLUGIN_HOME` (default: `~/.config/kustomize/plugin/`). Note: the kustomize library doesn't allow for easy customization of the plugin home. ### Feature: Unrestricted Loading Kustomize has a strict and a relaxed mode with respect to path references outside the kustomization base directory (`--load-restrictor`, default is `strict`). The feature seems intended to encourage portability, similarly to paths in Dockerfiles. This implementation simply enables the relaxed mode. ### Feature: Enable Helm Charts This implementation enables [Helm chart support in Kustomize](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/helmcharts/), which is an experimental feature of Directory v1 (see: #2470). Note that chart support in Kustomize is limited and evolving; see kubernetes-sigs/kustomize#4401 for the long-term support plan. The `helm` binary is assumed to be on the path. ### Feature: Namespace Override New to v2 is support for overriding the default namespace (default is from provider configuration), as a convenience. Kustomize itself has a similar facility (see: [namespace](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/namespace/)) but it makes sense to support it natively. ### Feature: Resource Ordering The Directory resource uses Pulumi's engine to install the resources produced by kustomize. It automatically detects dependencies between some resources. For example, it knows to install namespaces and Custom Resource Definitions (CRDs) first. Use the `config.kubernetes.io/depends-on` annotation to declare an explicit resource dependency. See [blog post](https://www.pulumi.com/blog/kubernetes-yaml-v2/#resource-ordering) for more info. ### Limitation: Kubernetes-Style Transformations The older v1 implementation provides the ability to transform the Kubernetes objects produced by kustomize before being sent to the server. That feature isn't available in Directory v2 at this time. You may still use Pulumi's [transform option](https://www.pulumi.com/docs/concepts/options/transformations/) to modify the child resources. ### Tests The PR includes unit tests covering the provider implementation code. ### Example Here's an example of deploying a couple of kustomizations. The `local` kustomization (see: [helloWorld](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/helloWorld) for details) shows how to use a variable to select a kustomization overlay. ```yaml name: issue-2786-yaml runtime: yaml description: | Demonstrates the Directory resource. Reference: https://github.com/kubernetes-sigs/kustomize/tree/master/examples/helloWorld config: variant: type: string default: staging outputs: name: ${local.resources} resources: ns: type: kubernetes:core/v1:Namespace local: type: kubernetes:kustomize/v2:Directory properties: namespace: ${ns.metadata.name} directory: ./config/${variant} skipAwait: true remote: type: kubernetes:kustomize/v2:Directory properties: namespace: ${ns.metadata.name} directory: https://github.com/kubernetes-sigs/kustomize//examples/helloWorld/?ref=v3.3.1 skipAwait: true ```
Some kustomize folders contain nested helm charts. To utilize these, you need to specify--enable-helm
as an optionUpdated description:
Kustomize optionally supports expanding helm charts with a plugin. We add experimental support for this feature in #2471 behind the
PULUMI_K8S_KUSTOMIZE_HELM
environment variable flag. If we decide to make this feature generally available, the following work still needs to be done:helm
binaryhelmChart
feature do not require thehelm
binary to be present. This works currently, but could regress in the future.The text was updated successfully, but these errors were encountered: