Skip to content

Commit

Permalink
kubernetes on cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Anurag Guda committed Dec 18, 2020
1 parent becfd04 commit 98988f4
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
40 changes: 40 additions & 0 deletions terraform/gcp/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<h1> Terraform on GCP </h1>

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
```

0 comments on commit 98988f4

Please sign in to comment.