Deploying Nginx Helm chart on minikube using terraform
How to runn Nginx deployment in Minikube with Terraform in own namespace
Prerequisites :
- minikube
- terraform
- helm 3
What we will complete by the end of this exercise :
- Install Nginx Helm Chart
- Set values of Helm chart via Terraform to use NodePort service and specific Port
- Use default namespace
- Access Nginx Deployment via minikube ip & NodePort port
Nodeport exposes the service on every node on a fixed port. In our case, will expose it on our minikube ip and fixed , dedicated port
Which makes it easy to access in combination with minikube ip
1) Start minikube :
2) Clone this article GIT REPO
Switch into correct folder :
Edit main.tf file, and edit appropiately to point to your kubeconfig file location :
3) Initialize terraform
4) Plan
5) Terraform apply
Enter : Yes
6) Verify helm chart is installed
Should show :
6) Verify Nginx pods are created
Expected output :
Expected output :
7) Access Nginx deployment via NodePort IP
Use the port , from the output and “minikube ip”
Taking into account my output :
Port : 30201
Minikube ip : 192.168.64.2
Nginx service will be accessible on :
8) You will see “Welcome to nginx!” page