README.md 4.29 KB
Newer Older
1
# OSDU module/deploument framework
ethiraj krishnamanaidu's avatar
ethiraj krishnamanaidu committed
2

3
Creates fully functional GCP based OSDU installation.
Oleksandr Kosse (EPAM)'s avatar
Oleksandr Kosse (EPAM) committed
4

5
## Prerequisites
6

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
- **Terraform** (version: v1.0.0) [terraform](https://www.terraform.io/downloads.html)
- **Gcloud** (version: Google Cloud SDK 345.0.0) [googleCloud](https://cloud.google.com/sdk/docs/install)
- **Kubectl** (version: v1.21.0) [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
- **kpt** (version: v0.39.3) [github](https://github.com/GoogleContainerTools/kpt/releases/tag/v0.39.3)
- **jq** (version: jq-1.6)

### Manual actions

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

23
## Before install
24

25
26
27
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.
28

29
### **To create OAuth consent screen:**
30

31
Go to **GCP navigation menu** -> **API & Services** -> **OAuth consent screen**
32

33
34
35
36
37
```
- 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`.
```
38

39
![alt text](img/gcp-consent-screen.png "Content Screen")
Oleksandr Kosse (EPAM)'s avatar
Oleksandr Kosse (EPAM) committed
40

41
### **To create OAuth 2.0 Client ID of type Web application:**
42

43
Go to **GCP navigation menu** -> **API & Services** -> **Credentials**
44

45
```
46
47
48
49
50
51
- 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`
52
```
53

54
55
![alt text](img/web-credentials.png "Web application credentials")

56
## How to run **osdu-module** with **Terraform**
57

58
Make shure that your gcloud client is configured with oppropriate GCP **project** and **region**
59
60
61
62
63
64
65
66
67

### To start installation use the following commands

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

68
### Then you need to fill-in **mandatory** variables at **variables.tf** file
Oleksandr Kosse (EPAM)'s avatar
Oleksandr Kosse (EPAM) committed
69

70
## Mandatory **Variables.tf**
71

72
73
74
75
76
77
78
79
80
81
82
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
**project_id** | your GCP project ID | 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
**elastic_host** | hostname of ElasticSearch instance | string | none | yes
**audiences** | this variable is ClientID from previous step of creating OAuth 2.0 Client ID | string | none | yes
**admin_user_email** | Admin person user email in project or at google identity service | string | **user@example.com** | yes

> **audiences** variable could look like: 689762842995-pv21xxxxxxx803kk6gqf52qb5amos3a9.apps.googleusercontent.com
83

84
Then perform following commands:
85

86
```
87
88
89
terraform init
terraform plan
terraform apply
90
```
91

92
## Post install steps
93

94
After successfull installation please look at the **outputs** of terraform execution and
95
get **ingress_ip** variable value. Use this ip-address for our DNS domain name.