abdennour / dockerfiles

Container images Kitchen
16 stars 13 forks source link

Add helm to the terraform Dockerfile? #2

Closed mogul closed 4 years ago

mogul commented 4 years ago

(Also asked as a question on your course).

In your course, you segment invocation of Terraform from invocation of helm/helmfile. For this reason your image for Terraform doesn't contain the CLI binary for Helm.

However, in the time since your course was published, Terraform's Helm provider has matured and uses "tiller-less" Helm 3. This makes Terraform an all-in-one alternative to using helmfile; all of your IaC can be driven by one tool, and Terraform can provide values to Helm charts easily.

Hashicorp's Helm provider requires the helm CLI to be available locally. So when I try to use your Terraform image with a .tf file that contains a helm resource, I get

Error: provider.helm: no suitable version installed
  version requirements: "~> 1.2.3"
  versions installed: none

Can you add Helm to your Terraform image to make this easier?

abdennour commented 4 years ago

Hello Bret @mogul

done! https://github.com/abdennour/dockerfiles/commit/e69d6d8a7eff962fc8349a608fcc86eaee0ea817 Two new images are now available:

README is available here.

One hint ; if you want to install plugins automatically (like diff), you can do that by assigning an env var HELM_PLUGIN_<name>=<url> to the container.

.e.g:

    environment:
      HELM_REPO_cetic: https://cetic.github.io/helm-charts
      HELM_PLUGIN_diff: 'https://github.com/databus23/helm-diff'
     # install plugin with version
      HELM_PLUGIN_diff: 'https://github.com/databus23/helm-diff --version v3.1.1'

Another note : a simple merge to master branch triggers auto-deployment to Dockerhub. Thus, if tools are outdates, you can update .env file, and open PR. That's it :)

mogul commented 4 years ago

Thanks so much! And great idea to provide for plugins through env vars.

mogul commented 4 years ago

Here's a bugfix