<p>How I see there is two options (from my exp):</p>

<ol>
<li>Use configuration for provider. 
<a href="https://www.terraform.io/docs/providers/helm/index.html" rel="nofollow noreferrer">https://www.terraform.io/docs/providers/helm/index.html</a>, there is option to install tiller.</li>
<li>Use prefabricated modules, for example:
<a href="https://github.com/sagikazarmark/terraform-tiller" rel="nofollow noreferrer">https://github.com/sagikazarmark/terraform-tiller</a>
<a href="https://registry.terraform.io/modules/Vidimensional/tiller/kubernetes/0.0.1" rel="nofollow noreferrer">https://registry.terraform.io/modules/Vidimensional/tiller/kubernetes/0.0.1</a></li>
</ol>

CC BY-SA 4.0
2019-06-13T09:38:32.617Z
2019-10-24T19:16:02.190Z
2019-10-24T19:16:02.190Z
Janis Orlovs
<p>I think this is achieveable with <code>terraform</code>s <code>null_resource</code> (<a href="https://www.terraform.io/docs/providers/null/resource.html" rel="nofollow noreferrer">https://www.terraform.io/docs/providers/null/resource.html</a>) with <code>local-exec</code>.</p>

<p>Example (untested):</p>

<pre><code>resource "null_resource" "helm_init_command" {

  provisioner "local-exec" {
    command = "helm --kubeconfig=&lt;...&gt; init"

}
</code></pre>

CC BY-SA 4.0
2019-06-13T08:42:46.420Z
2019-06-13T10:36:33.307Z
2019-06-13T10:36:33.307Z
Morishiri
<p>I need to be able to generate disposable kubernetes environments using <code>terraform</code>.  These environments should use <code>helm</code> for application deployment and ideally have <code>tiller</code> installed during the <code>terraform</code> resource provision.</p>

<p>What is the best way of automating this?  Should I "copy" the deployment generated by <code>helm init</code> and translate it to <code>terraform</code> lingo?  Is there any other solution more elegant than this?</p>

<p>I tried to explicitly declare the <code>terraform</code>'s <code>helm</code> provider block, but without any real chart deployment it does not bother into installing the <code>tiller</code> service. </p>

CC BY-SA 4.0
2019-04-02T01:57:56.673Z
helm provider should install tiler by default, but in order to use helm repository data source, there's a need to run `helm init` which installs tiller :( I'm not sure how to force provider to install tiller before you do helm init
holms
CC BY-SA 4.0
2019-04-09T10:53:21.823Z
You can actually perform a `helm init` without installing `tiller` by adding the flag `--client-only`.
Navarro
CC BY-SA 4.0
2019-07-13T11:48:44.370Z
I prefer using something like "helm template | kubectl apply -f -" until tiller becomes tillerless in the next version.
Robert
<kubernetes><terraform><helm>
Automate Helm's tiller installation with Terraform
Navarro
# Automate Helm's tiller installation with Terraform

(Asked by: username_0 on 2019-03-26)

I need to be able to generate disposable kubernetes environments using `terraform`. These environments should use `helm` for application deployment and ideally have `tiller` installed during the `terraform` resource provision.

What is the best way of automating this? Should I "copy" the deployment generated by `helm init` and translate it to `terraform` lingo? Is there any other solution more elegant than this?

I tried to explicitly declare the `terraform`'s `helm` provider block, but without any real chart deployment it does not bother into installing the `tiller` service.

**Tags:** kubernetes, terraform, helm

> **Comments:**
> **username_1**: helm provider should install tiler by default, but in order to use helm repository data source, there's a need to run `helm init` which installs tiller :( I'm not sure how to force provider to install tiller before you do helm init  
> **username_0**: You can actually perform a `helm init` without installing `tiller` by adding the flag `--client-only`.  
> **username_2**: I prefer using something like "helm template | kubectl apply -f -" until tiller becomes tillerless in the next version.  

---

## 2 answers

### Answer by username_3 on 2019-06-13. Score: 1

How I see there is two options (from my exp):

1. Use configuration for provider.
   <https://www.terraform.io/docs/providers/helm/index.html>, there is option to install tiller.
2. Use prefabricated modules, for example:
   <https://github.com/sagikazarmark/terraform-tiller>
   <https://registry.terraform.io/modules/Vidimensional/tiller/kubernetes/0.0.1>


---

### Answer by username_4 on 2019-06-13. Score: 0

I think this is achieveable with terraforms null_resource (https://www.terraform.io/docs/providers/null/resource.html) with local-exec.
Example (untested):
resource "null_resource" "helm_init_command" {

  provisioner "local-exec" {
    command = "helm --kubeconfig=<...> init"

}


---

