Skip to content

Commit

Permalink
Merge branch 'main' into docs/ingestion-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
pantierra authored Oct 31, 2024
2 parents 5bba76d + a4955ff commit 9ea9124
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 81 deletions.
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Makefile for eoapi-k8s

# Variables
HELM_REPO_URL=https://devseed.com/eoapi-k8s/
HELM_CHART_NAME=eoapi/eoapi
PGO_CHART_VERSION=5.5.2

.PHONY: all deploy minikube help

# Default target
all: deploy

deploy:
@echo "Installing dependencies."
@command -v helm >/dev/null 2>&1 || { echo "helm is required but not installed"; exit 1; }
helm install --set disable_check_for_upgrades=true pgo oci://registry.developers.crunchydata.com/crunchydata/pgo --version $(PGO_CHART_VERSION)
@echo "Adding eoAPI helm repository."
@helm repo add eoapi $(HELM_REPO_URL)
@echo "Installing eoAPI helm chart."
@cd ./helm-chart && \
helm dependency build ./eoapi && \
helm install --namespace eoapi --create-namespace --set gitSha=$$(git rev-parse HEAD | cut -c1-10) eoapi ./eoapi

minikube:
@echo "Starting minikube."
@command -v minikube >/dev/null 2>&1 || { echo "minikube is required but not installed"; exit 1; }
minikube start
# Deploy eoAPI via the regular helm install routine
@make deploy
minikube addons enable ingress
@echo "eoAPI is now available at:"
@minikube service ingress-nginx-controller -n ingress-nginx --url | head -n 1

help:
@echo "Makefile commands:"
@echo " make deploy - Install eoAPI on a cluster kubectl is connected to."
@echo " make minikube - Install eoAPI on minikube."
@echo " make help - Show this help message."
113 changes: 32 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,97 +9,48 @@
</a>
</p>

## Table of Contents
* [What is eoAPI](#whatitis)
* [Getting Started](#gettingstarted)
* [Helm Installation](#helminstall)
* [Default Configuration and Options](#options)
* [Autoscaling / Monitoring / Observability](./docs/autoscaling.md)

<a name="whatitis"/>

## What is eoAPI?

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

<a name="gettingstarted"/>

## Getting Started

Make sure you have [helm](https://helm.sh/docs/intro/install/) installed on your machine.
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.

### Local

For a local installation you can use a preinstalled [Minikube](https://minikube.sigs.k8s.io/), and simply execute the following command:

```bash
$ make minikube
```

Once the deployment is done, the url to access eoAPI will be printed to your terminal.

### Cloud

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

> &#9432; The helm chart in this repo assumes your cluster has a few third-party add-ons and controllers installed. So
> it's in your best interest to read through the IaC guides to understand what those defaults are
* [AWS EKS Cluster Setup](./docs/aws-eks.md)

* [GCP GKE Cluster Setup](./docs/gcp-gke.md)

<a name="helminstall"/>

## Helm Installation

Once you have a k8s cluster set up you can `helm install` eoAPI with the following steps:

0. `eoapi-k8s` depends on the [Crunchydata Postgresql Operator](https://access.crunchydata.com/documentation/postgres-operator/latest/installation/helm). Install that first:

```python
$ helm install --set disable_check_for_upgrades=true pgo oci://registry.developers.crunchydata.com/crunchydata/pgo --version 5.5.2
```


1. Add the eoapi repo from https://devseed.com/eoapi-k8s/:

```python
$ helm repo add eoapi https://devseed.com/eoapi-k8s/
```

2. List out the eoapi chart versions

```python
$ helm search repo eoapi --versions
NAME CHART VERSION APP VERSION DESCRIPTION
eoapi/eoapi 0.2.14 0.3.1 Create a full Earth Observation API with Metada...
eoapi/eoapi 0.1.13 0.2.11 Create a full Earth Observation API with Metada...
```
3. Optionally override keys/values in the default `values.yaml` with a custom `config.yaml` like below:

```python
$ cat config.yaml
vector:
enable: false
pgstacBootstrap:
settings:
envVars:
LOAD_FIXTURES: "0"
RUN_FOREVER: "1"
```
4. Then `helm install` with those `config.yaml` values:

```python
$ helm install -n eoapi --create-namespace eoapi eoapi/eoapi --version 0.1.2 -f config.yaml
```

5. or check out this repo and `helm install` from this repo's `helm-chart/` folder:

```python
######################################################
# create os environment variables for required secrets
######################################################
$ export GITSHA=$(git rev-parse HEAD | cut -c1-10)

$ cd ./helm-chart

$ helm install \
--namespace eoapi \
--create-namespace \
--set gitSha=$GITSHA \
eoapi \
./eoapi
```

<a name="options"/>

## Configuration Options and Defaults
Read about [Default Configuration](./docs/configuration.md#default-configuration) and
other [Configuration Options](./docs/configuration.md#additional-options) in the documentation

Make sure you have your `kubectl` configured to point to the cluster you want to deploy eoAPI to. Then simply execute the following command:

```bash
$ make deploy
```

### Manual step-by-step installation

Instead of using the `make` commands above you can also [manually `helm install` eoAPI](./docs/helm-install.md).


## More information

* Read about [Default Configuration](./docs/configuration.md#default-configuration) and
other [Configuration Options](./docs/configuration.md#additional-options)
* Learn about [Autoscaling / Monitoring / Observability](./docs/autoscaling.md)
59 changes: 59 additions & 0 deletions docs/helm-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Manual Helm Install

0. `eoapi-k8s` depends on the [Crunchydata Postgresql Operator](https://access.crunchydata.com/documentation/postgres-operator/latest/installation/helm). Install that first:

```bash
$ helm install --set disable_check_for_upgrades=true pgo oci://registry.developers.crunchydata.com/crunchydata/pgo --version 5.5.2
```

1. Add the eoapi repo from https://devseed.com/eoapi-k8s/:

```bash
$ helm repo add eoapi https://devseed.com/eoapi-k8s/
```

2. List out the eoapi chart versions

```bash
$ helm search repo eoapi --versions
NAME CHART VERSION APP VERSION DESCRIPTION
eoapi/eoapi 0.2.14 0.3.1 Create a full Earth Observation API with Metada...
eoapi/eoapi 0.1.13 0.2.11 Create a full Earth Observation API with Metada...
```

3. Optionally override keys/values in the default `values.yaml` with a custom `config.yaml` like below:

```bash
$ cat config.yaml
vector:
enable: false
pgstacBootstrap:
settings:
envVars:
LOAD_FIXTURES: "0"
RUN_FOREVER: "1"
```

4. Then `helm install` with those `config.yaml` values:

```bash
$ helm install -n eoapi --create-namespace eoapi eoapi/eoapi --version 0.1.2 -f config.yaml
```

5. or check out this repo and `helm install` from this repo's `helm-chart/` folder:
```bash
######################################################
# create os environment variables for required secrets
######################################################
$ export GITSHA=$(git rev-parse HEAD | cut -c1-10)
$ cd ./helm-chart
$ helm install \
--namespace eoapi \
--create-namespace \
--set gitSha=$GITSHA \
eoapi \
./eoapi
```
16 changes: 16 additions & 0 deletions docs/postgres-operator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Q: eoapi-k8s uses the postgres-operator from crunchydata. Is there a reason why you have chosen this solution? There is also a postgres-operator from Zalando. What are the benefits using an operator instead of a postgres helm chart?

A: We made the choice to use Crunchydata's operator over Zalando's operator and cloudnative-pg's operator (they all install operators even if using the helm install option) after considering the following things:

1. quality of the documentation
2. backlog of issues
3. knowing that a lot of core PG contributors work at Crunchydata and hearing about some of the cutting edge things they are doing
4. talking with other folks in our community

That said, what we want out of an operator "most" of the above options share:

1. backups
2. some kind of connection pooling option set up for us
3. good solid docs and choices about how upgrades work

See also https://github.com/developmentseed/eoapi-k8s/issues/132

0 comments on commit 9ea9124

Please sign in to comment.