Skip to content

Commit 415b777

Browse files
committed
Added basic makefile to automatize the installation steps.
1 parent 6a90664 commit 415b777

File tree

3 files changed

+129
-64
lines changed

3 files changed

+129
-64
lines changed

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 install --namespace eoapi --create-namespace --set gitSha=$$(git rev-parse HEAD | cut -c1-10) eoapi ./eoapi
22+
23+
minikube:
24+
@echo "Starting minikube."
25+
@command -v minikube >/dev/null 2>&1 || { echo "minikube is required but not installed"; exit 1; }
26+
minikube start
27+
# Deploy eoAPI via the regular helm install routine
28+
@make deploy
29+
minikube addons enable ingress
30+
@echo "eoAPI is now available at:"
31+
@minikube service ingress-nginx-controller -n ingress-nginx --url
32+
33+
help:
34+
@echo "Makefile commands:"
35+
@echo " make deploy - Install eoAPI on a cluster kubectl is connected to."
36+
@echo " make minikube - Install eoAPI on minikube."
37+
@echo " make help - Show this help message."

README.md

Lines changed: 33 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -26,80 +26,49 @@
2626

2727
## Getting Started
2828

29+
Make sure you have the following installed:
30+
31+
* [Helm](https://helm.sh/docs/intro/install/)
32+
* [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
33+
34+
Additionally, wou will need a cluster set up to deploy the eoAPI helm chart. This can be on AWS, GCP, or any other cloud provider that supports k8s. You can also run a local cluster using minikube.
35+
36+
### Local
37+
38+
For a local installation you can use a preinstalled, empty:
39+
40+
* [Minikube](https://minikube.sigs.k8s.io/)
41+
42+
And simply execute the following command:
43+
44+
```bash
45+
$ make minikube
46+
```
47+
48+
### Cloud
49+
2950
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
3051

3152
> ⓘ The helm chart in this repo assumes your cluster has a few third-party add-ons and controllers installed. So
3253
> it's in your best interest to read through the IaC guides to understand what those defaults are
3354
3455
* [AWS EKS Cluster Setup](./docs/aws-eks.md)
35-
3656
* [GCP GKE Cluster Setup](./docs/gcp-gke.md)
37-
57+
58+
Then simply execute the following command:
59+
60+
```bash
61+
$ make deploy
62+
```
63+
3864
<a name="helminstall"/>
3965

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-
66+
## Manual step-by-step installation
67+
68+
Instead of using the `make` commands above you can also [manually `helm install` eoAPI](./docs/helm-install.md).
69+
10170
<a name="options"/>
10271

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

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)