Terraform configuration for spinning up a Google kubernetes engine cluster with helm
-
Fill the terraform.tfvars with your own variables
-
Log in to gcloud cli and set the default project which you have previously created on GCP Dashboard
gcloud auth application-default login
export GOOGLE_PROJECT=$(gcloud config get-value project)
- After terraform apply: point your kubeconfig file to the recently created gke cluster
gcloud container clusters get-credentials $(terraform output cluster_name) --zone $(terraform output cluster_zone)
- Install helm
kubectl get pods -n dev
helm init --upgrade
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'