<p>I have the following chartInflator.yml file:</p>
<pre><code>apiVersion: builtin
kind: ChartInflator
metadata:
  name: project-helm-inflator
chartName: helm-k8s
chartHome: ../../../helm-k8s/
releaseName: project-monitoring-chart
values: ../../values.yaml
releaseNamespace: project-monitoring-ns
</code></pre>
<p>When I ran it using this, I got the error message below:</p>
<pre><code>$ kustomize build .
Error: loading generator plugins: failed to load generator: plugin HelmChartInflationGenerator.builtin.[noGrp]/project-helm-inflator.[noNs] fails configuration: chart name cannot be empty
</code></pre>
<p>Here is my project structure:</p>
<pre><code>project
  - helm-k8s
   - values.yml
   - Chart.yml
   - templates
    - base
      - project-namespace.yml
      - grafana
        - grafana-service.yml
        - grafana-deployment.yml
        - grafana-datasource-config.yml
      - prometheus
        - prometheus-service.yml
        - prometheus-deployment.yml
        - prometheus-config.yml
        - prometheus-roles.yml
      - kustomization.yml
    - prod
      - kustomization.yml
    - test
      - kustomization.yml
</code></pre>

joesan
<p>I think you may have found some outdated documentation for the helm chart generator. The canonical documentation for this is <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/examples/chart.md" rel="nofollow noreferrer">here</a>. Reading that implies several changes:</p>
<ol>
<li><p>Include the inflator directly in your <code>kustomization.yaml</code> in the <code>helmCharts</code> section.</p>
</li>
<li><p>Use <code>name</code> instead of <code>chartName</code>.</p>
</li>
<li><p>Set <code>chartHome</code> in the <code>helmGlobals</code> section rather than per-chart.</p>
</li>
</ol>
<p>That gets us something like this in our <code>kustomization.yaml</code>:</p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmGlobals:
  chartHome: ../../../helm-k8s/

helmCharts:
- name: helm-k8s
  releaseName: project-monitoring-chart
  values: ../../values.yaml
  releaseNamespace: project-monitoring-ns
</code></pre>
<p>I don't know if this will actually work -- you haven't provided a reproducer in your question, and I'm not familiar enough with Helm to whip one up on the spot -- but I will note that your project layout is highly unusual. You appear to be trying to use Kustomize to deploy a Helm chart that <em>contains</em> your kustomize configuration, and it's not clear what the benefit is of this layout vs. just creating a helm chart and then using kustomize to inflate it from <em>outside</em> of the chart templates directory.</p>
<p>You may need to add <code>--load-restrictor LoadRestrictionsNone</code> when calling <code>kustomize build</code> for this to work; by default, the <code>chartHome</code> location must be contained by the same directory that contains your <code>kustomization.yaml</code>.</p>
<hr />
<p><strong>Update</strong></p>
<p>To make sure things are clear, this is what I'm recommending:</p>
<ol>
<li><p>Remove the kustomize bits from your helm chart, so that it looks <a href="https://github.com/larsks/open-electrons-deployments/tree/less-weird-layout/open-electrons-monitoring" rel="nofollow noreferrer">like this</a>.</p>
</li>
<li><p>Publish your helm charts somewhere. I've set up github pages for that repository and published the charts at <a href="http://oddbit.com/open-electrons-deployments/" rel="nofollow noreferrer">http://oddbit.com/open-electrons-deployments/</a>.</p>
</li>
<li><p>Use kustomize to deploy the chart with transformations. Here we add a <code>-prod</code> suffix to all the resources:</p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmCharts:
  - name: open-electrons-monitoring
    repo: http://oddbit.com/open-electrons-deployments/

nameSuffix: -prod
</code></pre>
</li>
</ol>
