|
3 | 3 | - navigation |
4 | 4 | --- |
5 | 5 |
|
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)). |
7 | 6 |
|
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) |
9 | 8 |
|
10 | | -## AWS (Lambda) |
11 | 9 |
|
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). |
13 | 15 |
|
14 | 16 | 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. |
15 | 17 |
|
@@ -86,6 +88,73 @@ The example commands here will deploy a CloudFormation stack called `eoAPI-stagi |
86 | 88 |
|
87 | 89 | 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. |
88 | 90 |
|
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) |
90 | 103 |
|
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