blendle / kubecrt

Convert Helm charts to Kubernetes resources.
ISC License
115 stars 11 forks source link

Add support for partials in charts.yml #14

Closed JeanMertz closed 6 years ago

JeanMertz commented 6 years ago

The rest of this description is the same as the updated README.md


Partial Templates

You can optionally split your charts.yml file into multiple chunks, by using partial templates. This works almost the same way as Helm's support for these in charts. See the Helm documentation for more details.

To use these partials, you have to set the --partials-dir flag when calling kubecrt, pass it the path to your partials directory, and then use those partials in your charts.yml.

Example:

charts.yml:

apiVersion: v1
name: my-bundled-apps
namespace: apps
charts:
- stable/factorio:
    values:
      resources:
{{ include "factorio/resources" . | indent 8 }}

partials/factorio/resources.yml

{{- define "factorio/resources" -}}
requests:
  memory: 1024Mi
  cpu: 750m
{{- end -}}

You can then run this as follows:

kubecrt --partials-dir ./partials charts.yml

And the result is a fully-parsed charts printed to stdout.

Some notes: