Commit a45cf8ab authored by Yauheni  Rykhter (EPAM)'s avatar Yauheni Rykhter (EPAM) Committed by Oleksandr Kosse (EPAM)
Browse files

GONRG-3257: review deployment framework installation

parent edf78413
# OSDU module/deploument framework
# OSDU module/deployment framework
Creates fully functional GCP based OSDU installation.
......@@ -14,64 +14,72 @@ Creates fully functional GCP based OSDU installation.
These actions couldn't be automated at this moment. Should be done once in a new Google Cloud project.
- Cloud Resource Manager API - Go to -> `APIs & Services` - click on `Enable Apis and Services` - search for `Cloud Resource Manager API` and **enable** this API.
- Acquire new user credentials via gcloud command to Use for Application default Credentials [cloud.google.com](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login).
- Create AppEngine app using Google Console GUI: Go to -> `App Engine` - click `Create app` - choose region corresponding your deployment. Or use bash script for creating AppEngine app located [here](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-gcp-provisioning/-/blob/master/bootstrap_infra/create-definitions/create-index-definitions.sh)
- Set variable "domain" in file variables.tf or provide it in command line using `-var` option when running the terraform plan and terraform apply commands:
`terraform apply -var="domain=example.com"`
- Enable Cloud Resource Manager API:
- Go to -> `APIs & Services` -> click on `Enable Apis and Services` -> search for `Cloud Resource Manager API` and **enable** this API.
- Get credentials from gcloud command:
- Acquire new user credentials via gcloud command to use for Application default credentials (use this link [cloud.google.com](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login) as an example).
- Create AppEngine app using Google Console GUI:
- Go to -> `App Engine` -> click `Create app` -> choose region corresponding your deployment **Or** use bash script for creating datastore indexes located [here](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-gcp-provisioning/-/blob/master/bootstrap_infra/create-definitions/create-index-definitions.sh)
## Before install
At the respective GCP project we need to create OAuth 2.0 Client ID.
According to GCP requirement you need to first create OAuth consent screen,
and then activate `API & Services` so you could create OAuth 2.0 Client ID of type Web application.
At the respective GCP project, we need to create OAuth 2.0 Client ID.
According to GCP requirement, you need:
- Create `OAuth consent screen`
- Activate `API & Services`
- Create `OAuth 2.0 Client ID (type: Web application)`
### **To create OAuth consent screen:**
Go to **GCP navigation menu** -> **API & Services** -> **OAuth consent screen**
```
- choose type `Internal` and click `CREATE`
- fillin `App name`, `User support email`, `Authorized domains` and `Developer contact information` fields.
- press `SAVE AND CONTINUE`, next step press `SAVE AND CONTINUE`.
```
- Choose type `Internal` and click `CREATE`
- Fill in these fields (you can fild example below):
- `App name`
- `User support email`
- `Authorized domains`
- `Developer contact information`
- Press now and later `SAVE AND CONTINUE`
![alt text](img/gcp-consent-screen.png "Content Screen")
### **To create OAuth 2.0 Client ID of type Web application:**
Go to **GCP navigation menu** -> **API & Services** -> **Credentials**
```
- click `+ CREATE CREDENTIALS`
-> OAuth client ID
-> Application type (choose `Web application`)
-> fillin `Name` field like `project_name-audiences`
-> add Authorized redirect URIs (`http://localhost:8080/auth/callback`, `https://developers.google.com/oauthplayground/`)
-> click `CREATE`
```
- Go to **GCP navigation menu** -> **API & Services** -> **Credentials**
- Click `+ CREATE CREDENTIALS`
- Use `OAuth client ID`
- Application type (choose `Web application`)
- Fill in `Name` field like `project_name-audiences`
- Add Authorized redirect URIs:
- `http://localhost:8080/auth/callback`
- `https://developers.google.com/oauthplayground/`
- Click `CREATE`
![alt text](img/web-credentials.png "Web application credentials")
## How to run **osdu-module** with **Terraform**
Make shure that your gcloud client is configured with oppropriate GCP **project** and **region**
Make sure that your gcloud client is configured with appropriate GCP **project** and **region**\
Use this links as examples:
### To start installation use the following commands
- Set default [project](https://cloud.google.com/artifact-registry/docs/gcloud-defaults)
- Set default [region](https://cloud.google.com/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client)
```
$ git clone git@community.opengroup.org:osdu/platform/deployment-and-operations/infra-gcp-provisioning.git
$ cd infra-gcp-provisioning/examples/simple_osdu/
# fill-in variables.tf file
```
### To start installation, use the following commands
### Then you need to fill-in **mandatory** variables at **variables.tf** file
```\
- git clone git@community.opengroup.org:osdu/platform/deployment-and-operations/infra-gcp-provisioning.git
- cd infra-gcp-provisioning/examples/simple_osdu/
```
## Mandatory **Variables.tf**
### Then you need to fill in **mandatory** variables at **variables.tf** file
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
**project_id** | your GCP project ID | string | none | yes
**project_region** | your GCP project region | string | none | yes
**project_zone** | your GCP project zone | string | none | yes
**data_partition_id** | Data Partition ID and also Tenant Name | string | **dataid** | yes
**domain** | DNS name for OSDU installation | string | none | yes
**elastic_pass** | password for ElasticSearch instance | string | none | yes
......@@ -83,13 +91,16 @@ $ cd infra-gcp-provisioning/examples/simple_osdu/
Then perform following commands:
```
```\
terraform init
terraform plan
terraform apply
```
You can provide variables by `-var` option when running the terraform plan and terraform apply commands.\
Example: `terraform apply -var="domain=example.com"`
## Post install steps
After successfull installation please look at the **outputs** of terraform execution and
get **ingress_ip** variable value. Use this ip-address for our DNS domain name.
After successfull installation, look at the **outputs** of terraform execution and
get **ingress_ip** variable value for usage this ip-address in DNS domain name
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment