Add README with steps to run and optional vars

Signed-off-by: harshvkarn <harshvkarn54@gmail.com>
This commit is contained in:
harshvkarn 2018-08-01 13:53:06 +05:30
parent e995db70d3
commit 0156a70500
1 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,52 @@
# GCP platform specific code and scripts
## Google Cloud provisioning and setting up Kubernetes cluster using KOPS
These playbook act as a wrapper class for all the `kops`, `gsutil` & `gcloud` command.
### Prerequisites
- kubectl
- gcloud
- kops
### Setting up
- Run `glcloud init`, and authenticate into your google account linked with the Google Cloud
---
### Running
- Run `create-vpc.yml` using anisble-playbook, that will create a Virtual Private Cloud
```bash
ansible-playbook create-vpc.yml --extra-vars "project=<project-name> vpc_name=<vpc-name>"
```
- Run `create-k8s-cluster`, this will create a Bucket and the cluster
```bash
ansible-playbook create-k8s-cluster.yml -vv --extra-vars "project=<project-name> nodes=1 vpc_name=<vpc-name>"
```
**Optional --extra-vars**
> k8s_version=1.11.1
> cluster_name=my-Cluster
---
### Deleting the cluster
- Run `delete-k8s-cluster`, this will delete the cluster as well as the Bucket associated
```bash
ansible-playbook delete-k8s-cluster.yml
```
**Optional --extra-vars**
> cluster_name=my-Cluster
It will delete the cluster specified else it will delete the last created cluster
- Run `delete-vpc` to delete the existing VPC (if required)
```bash
ansible-playbook delete-vpc.yml --extra-vars "project=<project-name> vpc_name=<vpc-name>"
```