Skip to content

Commit 9743486

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

File tree

2 files changed

+72
-11
lines changed

2 files changed

+72
-11
lines changed

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 help minikube
9+
10+
# Default target
11+
all: deploy
12+
13+
deploy:
14+
@echo "Installing dependencies."
15+
helm install --set disable_check_for_upgrades=true pgo oci://registry.developers.crunchydata.com/crunchydata/pgo --version $(PGO_CHART_VERSION)
16+
@echo "Adding eoAPI helm repository."
17+
helm repo add eoapi $(HELM_REPO_URL)
18+
@echo "Installing eoAPI helm chart."
19+
cd ./helm-chart && \
20+
helm install --namespace eoapi --create-namespace --set gitSha=$$(git rev-parse HEAD | cut -c1-10) eoapi ./eoapi
21+
22+
minikube:
23+
@echo "Starting minikube."
24+
minikube start
25+
make deploy
26+
minikube addons enable ingress
27+
@echo "eoAPI is now available at:"
28+
minikube service ingress-nginx-controller -n ingress-nginx --url
29+
30+
help:
31+
@echo "Makefile commands:"
32+
@echo " make deploy - Install eoAPI on a cluster kubectl is connected to."
33+
@echo " make minikube - Install eoAPI on minikube."
34+
@echo " make help - Show this help message."

README.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,46 +26,72 @@
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:
39+
40+
* [Minikube](https://minikube.sigs.k8s.io/)
41+
42+
And simply execute the following commands:
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
66+
## Manual helm installation
4167

42-
Once you have a k8s cluster set up you can `helm install` eoAPI with the following steps:
68+
Instead of using the `make` commands above you can also manually `helm install` eoAPI with the following steps:
4369

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

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

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

5378
```python
5479
$ helm repo add eoapi https://devseed.com/eoapi-k8s/
5580
```
5681

5782
2. List out the eoapi chart versions
58-
83+
5984
```python
6085
$ helm search repo eoapi --versions
61-
NAME CHART VERSION APP VERSION DESCRIPTION
86+
NAME CHART VERSION APP VERSION DESCRIPTION
6287
eoapi/eoapi 0.2.14 0.3.1 Create a full Earth Observation API with Metada...
6388
eoapi/eoapi 0.1.13 0.2.11 Create a full Earth Observation API with Metada...
6489
```
90+
6591
3. Optionally override keys/values in the default `values.yaml` with a custom `config.yaml` like below:
6692

6793
```python
68-
$ cat config.yaml
94+
$ cat config.yaml
6995
vector:
7096
enable: false
7197
pgstacBootstrap:
@@ -74,6 +100,7 @@ Once you have a k8s cluster set up you can `helm install` eoAPI with the followi
74100
LOAD_FIXTURES: "0"
75101
RUN_FOREVER: "1"
76102
```
103+
77104
4. Then `helm install` with those `config.yaml` values:
78105

79106
```python
@@ -87,7 +114,7 @@ Once you have a k8s cluster set up you can `helm install` eoAPI with the followi
87114
# create os environment variables for required secrets
88115
######################################################
89116
$ export GITSHA=$(git rev-parse HEAD | cut -c1-10)
90-
117+
91118
$ cd ./helm-chart
92119

93120
$ helm install \
@@ -97,9 +124,9 @@ Once you have a k8s cluster set up you can `helm install` eoAPI with the followi
97124
eoapi \
98125
./eoapi
99126
```
100-
127+
101128
<a name="options"/>
102129

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

0 commit comments

Comments
 (0)