diff --git a/README.md b/README.md index d83789c..d9974d2 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ bash k8scluster.sh google To clean up the AWS environment with kubernetes, run the below command ``` -cd terrform/google +cd terrform/gcp terraform destroy -auto-approve ``` diff --git a/terraform/gcp/Readme.md b/terraform/gcp/Readme.md new file mode 100644 index 0000000..096df73 --- /dev/null +++ b/terraform/gcp/Readme.md @@ -0,0 +1,40 @@ +

Terraform on GCP

+ +For kubernetes with kubeadm multi node cluster we need to bring up multi nodes with help of terraform + +- Prerequisites + - Google Cloud account + - Login Google cloud account with below commands + - gcloud init + - gcloud beta compute config-ssh + - gcloud auth application-default login +Make sure you have an access to your Google account + +If you want to modify any details like number of worker node, use variable.tf file to refer that + +### Usage + +Make sure to inititate the terraform to load all plugins + +``` +terraform init +``` + +Now verify the terrafor plan with below command + +``` +terraform plan +``` + +Once verify the plan, now apply the terraform state to aws account + +``` +terraform apply -auto-aprrove +``` + +To create a ansible inventory, run the below command . if you want to change the format of inventory file modify outputs.tf file. + +``` +terraform output inventory > ../ansible/inventory +``` +