Skip to content

Commit a4955ff

Browse files
Added basic makefile to automatize the installation steps. (#162)
Co-authored-by: Ciaran Sweet <[email protected]>
1 parent 6a90664 commit a4955ff

File tree

3 files changed

+129
-81
lines changed

3 files changed

+129
-81
lines changed

Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Makefile for eoapi-k8s
2+
3+
# Variables
4+
HELM_REPO_URL=https://devseed.com/eoapi-k8s/
5+
HELM_CHART_NAME=eoapi/eoapi
6+
PGO_CHART_VERSION=5.5.2
7+
8+
.PHONY: all deploy minikube help
9+
10+
# Default target
11+
all: deploy
12+
13+
deploy:
14+
@echo "Installing dependencies."
15+
@command -v helm >/dev/null 2>&1 || { echo "helm is required but not installed"; exit 1; }
16+
helm install --set disable_check_for_upgrades=true pgo oci://registry.developers.crunchydata.com/crunchydata/pgo --version $(PGO_CHART_VERSION)
17+
@echo "Adding eoAPI helm repository."
18+
@helm repo add eoapi $(HELM_REPO_URL)
19+
@echo "Installing eoAPI helm chart."
20+
@cd ./helm-chart && \
21+
helm dependency build ./eoapi && \
22+
helm install --namespace eoapi --create-namespace --set gitSha=$$(git rev-parse HEAD | cut -c1-10) eoapi ./eoapi
23+
24+
minikube:
25+
@echo "Starting minikube."
26+
@command -v minikube >/dev/null 2>&1 || { echo "minikube is required but not installed"; exit 1; }
27+
minikube start
28+
# Deploy eoAPI via the regular helm install routine
29+
@make deploy
30+
minikube addons enable ingress
31+
@echo "eoAPI is now available at:"
32+
@minikube service ingress-nginx-controller -n ingress-nginx --url | head -n 1
33+
34+
help:
35+
@echo "Makefile commands:"
36+
@echo " make deploy - Install eoAPI on a cluster kubectl is connected to."
37+
@echo " make minikube - Install eoAPI on minikube."
38+
@echo " make help - Show this help message."

README.md

Lines changed: 32 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -9,97 +9,48 @@
99
</a>
1010
</p>
1111

12-
## Table of Contents
13-
* [What is eoAPI](#whatitis)
14-
* [Getting Started](#gettingstarted)
15-
* [Helm Installation](#helminstall)
16-
* [Default Configuration and Options](#options)
17-
* [Autoscaling / Monitoring / Observability](./docs/autoscaling.md)
18-
19-
<a name="whatitis"/>
20-
2112
## What is eoAPI?
2213

2314
[https://eoapi.dev/](https://eoapi.dev/)
2415

25-
<a name="gettingstarted"/>
26-
2716
## Getting Started
2817

18+
Make sure you have [helm](https://helm.sh/docs/intro/install/) installed on your machine.
19+
Additionally, you will need a cluster to deploy the eoAPI helm chart. This can be on a cloud provider, like AWS, GCP, or any other that supports Kubernetes. You can also run a local cluster using minikube.
20+
21+
### Local
22+
23+
For a local installation you can use a preinstalled [Minikube](https://minikube.sigs.k8s.io/), and simply execute the following command:
24+
25+
```bash
26+
$ make minikube
27+
```
28+
29+
Once the deployment is done, the url to access eoAPI will be printed to your terminal.
30+
31+
### Cloud
32+
2933
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
3034

3135
> &#9432; The helm chart in this repo assumes your cluster has a few third-party add-ons and controllers installed. So
3236
> it's in your best interest to read through the IaC guides to understand what those defaults are
3337
3438
* [AWS EKS Cluster Setup](./docs/aws-eks.md)
35-
3639
* [GCP GKE Cluster Setup](./docs/gcp-gke.md)
37-
38-
<a name="helminstall"/>
39-
40-
## Helm Installation
41-
42-
Once you have a k8s cluster set up you can `helm install` eoAPI with the following steps:
43-
44-
0. `eoapi-k8s` depends on the [Crunchydata Postgresql Operator](https://access.crunchydata.com/documentation/postgres-operator/latest/installation/helm). Install that first:
45-
46-
```python
47-
$ helm install --set disable_check_for_upgrades=true pgo oci://registry.developers.crunchydata.com/crunchydata/pgo --version 5.5.2
48-
```
49-
50-
51-
1. Add the eoapi repo from https://devseed.com/eoapi-k8s/:
52-
53-
```python
54-
$ helm repo add eoapi https://devseed.com/eoapi-k8s/
55-
```
56-
57-
2. List out the eoapi chart versions
58-
59-
```python
60-
$ helm search repo eoapi --versions
61-
NAME CHART VERSION APP VERSION DESCRIPTION
62-
eoapi/eoapi 0.2.14 0.3.1 Create a full Earth Observation API with Metada...
63-
eoapi/eoapi 0.1.13 0.2.11 Create a full Earth Observation API with Metada...
64-
```
65-
3. Optionally override keys/values in the default `values.yaml` with a custom `config.yaml` like below:
66-
67-
```python
68-
$ cat config.yaml
69-
vector:
70-
enable: false
71-
pgstacBootstrap:
72-
settings:
73-
envVars:
74-
LOAD_FIXTURES: "0"
75-
RUN_FOREVER: "1"
76-
```
77-
4. Then `helm install` with those `config.yaml` values:
78-
79-
```python
80-
$ helm install -n eoapi --create-namespace eoapi eoapi/eoapi --version 0.1.2 -f config.yaml
81-
```
82-
83-
5. or check out this repo and `helm install` from this repo's `helm-chart/` folder:
84-
85-
```python
86-
######################################################
87-
# create os environment variables for required secrets
88-
######################################################
89-
$ export GITSHA=$(git rev-parse HEAD | cut -c1-10)
90-
91-
$ cd ./helm-chart
92-
93-
$ helm install \
94-
--namespace eoapi \
95-
--create-namespace \
96-
--set gitSha=$GITSHA \
97-
eoapi \
98-
./eoapi
99-
```
100-
101-
<a name="options"/>
102-
103-
## Configuration Options and Defaults
104-
Read about [Default Configuration](./docs/configuration.md#default-configuration) and
105-
other [Configuration Options](./docs/configuration.md#additional-options) in the documentation
40+
41+
Make sure you have your `kubectl` configured to point to the cluster you want to deploy eoAPI to. Then simply execute the following command:
42+
43+
```bash
44+
$ make deploy
45+
```
46+
47+
### Manual step-by-step installation
48+
49+
Instead of using the `make` commands above you can also [manually `helm install` eoAPI](./docs/helm-install.md).
50+
51+
52+
## More information
53+
54+
* Read about [Default Configuration](./docs/configuration.md#default-configuration) and
55+
other [Configuration Options](./docs/configuration.md#additional-options)
56+
* Learn about [Autoscaling / Monitoring / Observability](./docs/autoscaling.md)

docs/helm-install.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Manual Helm Install
2+
3+
0. `eoapi-k8s` depends on the [Crunchydata Postgresql Operator](https://access.crunchydata.com/documentation/postgres-operator/latest/installation/helm). Install that first:
4+
5+
```bash
6+
$ helm install --set disable_check_for_upgrades=true pgo oci://registry.developers.crunchydata.com/crunchydata/pgo --version 5.5.2
7+
```
8+
9+
1. Add the eoapi repo from https://devseed.com/eoapi-k8s/:
10+
11+
```bash
12+
$ helm repo add eoapi https://devseed.com/eoapi-k8s/
13+
```
14+
15+
2. List out the eoapi chart versions
16+
17+
```bash
18+
$ helm search repo eoapi --versions
19+
NAME CHART VERSION APP VERSION DESCRIPTION
20+
eoapi/eoapi 0.2.14 0.3.1 Create a full Earth Observation API with Metada...
21+
eoapi/eoapi 0.1.13 0.2.11 Create a full Earth Observation API with Metada...
22+
```
23+
24+
3. Optionally override keys/values in the default `values.yaml` with a custom `config.yaml` like below:
25+
26+
```bash
27+
$ cat config.yaml
28+
vector:
29+
enable: false
30+
pgstacBootstrap:
31+
settings:
32+
envVars:
33+
LOAD_FIXTURES: "0"
34+
RUN_FOREVER: "1"
35+
```
36+
37+
4. Then `helm install` with those `config.yaml` values:
38+
39+
```bash
40+
$ helm install -n eoapi --create-namespace eoapi eoapi/eoapi --version 0.1.2 -f config.yaml
41+
```
42+
43+
5. or check out this repo and `helm install` from this repo's `helm-chart/` folder:
44+
45+
```bash
46+
######################################################
47+
# create os environment variables for required secrets
48+
######################################################
49+
$ export GITSHA=$(git rev-parse HEAD | cut -c1-10)
50+
51+
$ cd ./helm-chart
52+
53+
$ helm install \
54+
--namespace eoapi \
55+
--create-namespace \
56+
--set gitSha=$GITSHA \
57+
eoapi \
58+
./eoapi
59+
```

0 commit comments

Comments
 (0)