Skip to content

Commit adaf926

Browse files
authored
Update deployment docs (#115)
* Update deployment docs Add description and pointers to eoapi-template, eoapi-cdk, eoapi-k8s. Add information on running services with docker-compose to deployment section. Refactor mkdocs deployment to reference sub-repositories and follow similar formatting for k8s vs. cdk approach. * Modifications based on Vincent's feedback Add how to launch official services via docker-compose. Add full sentence on IaC.
1 parent 6d54655 commit adaf926

File tree

2 files changed

+82
-9
lines changed

2 files changed

+82
-9
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ Note: services might have incompatible dependencies which you can resolve by usi
6262

6363
## Deployment
6464

65-
This repository has the demonstration runtimes that are consistently updated with new functionality.
65+
This repository has current runtimes that are consistently updated with new functionality.
6666

67-
The default runtimes are available through separate repositories ([eoapi-cdk](https://github.com/developmentseed/eoapi-cdk) and [eoapi-k8s](https://github.com/developmentseed/eoapi-k8s)).
67+
The services can be deployed locally via docker with `docker-compose up`. The official runtimes can be launched with `docker-compose -f docker-compose.yml -f docker-compose.official.yml up stac-fastapi titiler-pgstac tipg`.
6868

69-
A demonstration application is accessible with the repository [eoapi-template](https://github.com/developmentseed/eoapi-template).
69+
Two Infrastructure as Code (IaC) repositories are available:
70+
- [eoapi-cdk](https://github.com/developmentseed/eoapi-cdk): A set of AWS CDK constructs to deploy eoAPI services
71+
- [eoapi-k8s](https://github.com/developmentseed/eoapi-k8s): IaC and Helm charts for deploying eoAPI services on AWS and GCP
72+
73+
Finally, [eoapi-template](https://github.com/developmentseed/eoapi-template) is an AWS CDK app that shows how to configure the eoapi-cdk constructs.
7074

7175
## Contribution & Development
7276

docs/src/deployment.md

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ hide:
33
- navigation
44
---
55

6-
The default runtimes are available through separate repositories ([eoapi-cdk](https://github.com/developmentseed/eoapi-cdk) and [eoapi-k8s](https://github.com/developmentseed/eoapi-k8s)).
76

8-
A demonstration application is accessible with the repository [eoapi-template](https://github.com/developmentseed/eoapi-template).
7+
## Via [eoapi-cdk](https://github.com/developmentseed/eoapi-cdk)
98

10-
## AWS (Lambda)
119

12-
An example of Cloud Stack is available for AWS (RDS for the database and Lambda for the APIs)
10+
[eoapi-cdk](https://github.com/developmentseed/eoapi-cdk) is a set of AWS CDK constructs to deploy eoAPI services.
11+
12+
[eoapi-template](https://github.com/developmentseed/eoapi-template) is an AWS CDK app that shows how to configure the [eoapi-cdk](https://github.com/developmentseed/eoapi-cdk) constructs.
13+
14+
An example of Cloud Stack is available for AWS (RDS for the database and Lambda for the APIs).
1315

1416
The stack is deployed by the [AWS CDK](https://aws.amazon.com/cdk/) utility. Under the hood, CDK will create the deployment packages required for AWS Lambda, upload it to AWS, and handle the creation of the Lambda and API Gateway resources.
1517

@@ -86,6 +88,73 @@ The example commands here will deploy a CloudFormation stack called `eoAPI-stagi
8688

8789
If you get an error saying that the max VPC's has been reached, this means that you have hit the limit for the amount of VPCs per unique AWS account and region combination. You can change the AWS region to a region that has less VPCs and deploy again to fix this.
8890
89-
## K8S
91+
## Via [eoapi-k8s](https://github.com/developmentseed/eoapi-k8s)
92+
93+
[eoapi-k8s](https://github.com/developmentseed/eoapi-k8s) has the IaC and Helm charts for deploying eoAPI services on AWS and GCP.
94+
95+
**Getting started**
96+
97+
If you don't have a k8s cluster set up on AWS or GCP then follow an IaC guide below that is relevant to you
98+
99+
> ⓘ The helm chart in this repo assumes your cluster has a few third-party add-ons and controllers installed. So
100+
> it's in your best interest to read through the IaC guides to understand what those defaults are
101+
102+
* [AWS EKS Cluster Setup](./docs/aws-eks.md)
90103
91-
A Kubernetes chart is currently being developed at https://github.com/developmentseed/eoapi-k8s
104+
* [TBD: GCP GKE Cluster Setup](./docs/gcp-gke.md)
105+
106+
**Helm Installation**
107+
108+
Once you have a k8s cluster set up you can `helm install` eoAPI as follows
109+
110+
1. `helm install` from this repo's `helm-chart/` folder:
111+
112+
```python
113+
######################################################
114+
# create os environment variables for required secrets
115+
######################################################
116+
$ export GITSHA=$(git rev-parse HEAD | cut -c1-10)
117+
$ export PGUSER=s00pers3cr3t
118+
$ export POSTGRES_USER=s00pers3cr3t
119+
$ export POSTGRES_PASSWORD=superuserfoobar
120+
$ export PGPASSWORD=foobar
121+
122+
$ cd ./helm-chart
123+
124+
$ helm install \
125+
--namespace eoapi \
126+
--create-namespace \
127+
--set gitSha=$GITSHA \
128+
--set db.settings.secrets.PGUSER=$PGUSER \
129+
--set db.settings.secrets.POSTGRES_USER=$POSTGRES_USER \
130+
--set db.settings.secrets.PGPASSWORD=$PGPASSWORD \
131+
--set db.settings.secrets.POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
132+
eoapi \
133+
./eoapi
134+
```
135+
136+
2. or `helm install` from https://devseed.com/eoapi-k8s/:
137+
138+
```python
139+
# add the eoapi helm repo locally
140+
$ helm repo add eoapi https://devseed.com/eoapi-k8s/
141+
142+
# list out the eoapi chart versions
143+
$ helm search repo eoapi
144+
NAME CHART VERSION APP VERSION DESCRIPTION
145+
eoapi/eoapi 0.1.1 0.1.0 Create a full Earth Observation API with Metada...
146+
eoapi/eoapi 0.1.2 0.1.0 Create a full Earth Observation API with Metada...
147+
148+
# add the required secret overrides to an arbitrarily named `.yaml` file (`config.yaml` below)
149+
$ cat config.yaml
150+
db:
151+
settings:
152+
secrets:
153+
PGUSER: "username"
154+
POSTGRES_USER: "username"
155+
PGPASSWORD: "password"
156+
POSTGRES_PASSWORD: "password"
157+
158+
# then run `helm install` with those overrides
159+
helm install eoapi eoapi/eoapi --version 0.1.1 -f config.yaml
160+
```

0 commit comments

Comments
 (0)