-
Notifications
You must be signed in to change notification settings - Fork 12
Add a basic makefile #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+129
−81
Merged
Add a basic makefile #162
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
pantierra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.