-
Notifications
You must be signed in to change notification settings - Fork 29
Update terraform module to use helm3 #20
This wiki page prepared for ticket #20
- Under your $home directory create bin directory and install helm3:
mkdir bin
cd bin/
wget https://get.helm.sh/helm-v3.3.2-linux-amd64.tar.gz
tar -xvf helm-v3.3.2-linux-amd64.tar.gz
mv linux-amd64/helm /home/gulsenjm/bin/helm3
- Check you helm version:
[gulsenjm@bastion-fuchicorp-com ~]$ helm3 version
version.BuildInfo{Version:"v3.3.2", GitCommit:"e5077257b6ca106d1f65652b4ca994736d221ab1", GitTreeState:"clean", GoVersion:"go1.14.9"}
-
Go to the terraform-helm-chart repository and create your branch from the master branch to have the latest updates.
-
Go to your terminal and clone the terraform-helm-chart repository:
git clone git@github.com:fuchicorp/terraform-helm-chart.git
- Checkout to your branch:
git checkout YOUR_BRANCH
-
Before starting to work on files read properly README.md file, you will find which files you need to create to work and test.
-
Create a directory to create inside helm chart to test. If you would like to quickly create helm chart then run:
cd terraform-helm-chart
mkdir module-test
cd module-test/
- If you would like to quickly create helm chart then run:
helm3 create charts/example
- After you created your helm chart you can go ahead and do modifications inside (modify ingress part):
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
hosts:
- host: ${deployment_endpoint}
paths:
- /
tls:
- secretName: chart-example-tls
hosts:
- ${deployment_endpoint}
- When modifications are done for values.yaml you will need to create module.tf to call the module. Make sure you created you module.tf file under module-test directory.
module.tf:
module "helm_deploy" {
source = "../"
deployment_name = "example-deployment"
deployment_environment = "dev"
deployment_endpoint = "example.your_domain.com"
deployment_path = "example"
}
-
Try to run the terraform init command to make sure your current module supports helm3 or not. If you get red output complaining about the version you have to do the next steps.
-
Now go to versions.tf open the file which is under the terraform-helm-chart directory.
-
On your browser open terraform registry and find the official helm module On top of the page, you will see the Version bar, click on it and you will see list of versions.
-
Check which version you have on your versions.tf file under provider "helm". As you see, your helm provider version is old. Now you have to try versions to find out which one is supports helm3.
You are going to try one by one version and run terraform init until you will see the green output, successfully initialized. Then run terraform apply to deploy your example chart. Then check your ingress and pods:
kubectl get pods -n dev
kubectl get ingress -n dev