Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 20 additions & 30 deletions .github/workflows/helm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,50 +51,40 @@ jobs:
echo -n "verifying images:"
docker images

- name: render raster templates
- name: helm render/install eoapi templates
run: |
export PGUSER=username
export POSTGRES_USER=username
export PGPASSWORD=password
export POSTGRES_PASSWORD=password
export GITSHA='A12345'

cd helm-chart/eoapi

MANIFEST=eoapi-manfests.yaml
echo "" > $MANIFEST
MANIFESTS=$(find ./templates/* -name "*.yaml" -not -name "ingress*.yaml")
while read MFILE; do
path_without_dot_prefix=$(echo "$MFILE" | sed 's/^\.\///g')
printf "[ RENDERING ]: %s\n" "$path_without_dot_prefix"
helm template . \
-s $path_without_dot_prefix \
--set gitSha=$GITSHA \
--set db.settings.secrets.PGUSER=$PGUSER \
--set db.settings.secrets.POSTGRES_USER=$POSTGRES_USER \
--set db.settings.secrets.PGPASSWORD=$PGPASSWORD \
--set db.settings.secrets.POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
-f values.yaml \
-f test-unittest-values.yaml >> $MANIFEST
done < <(echo "$MANIFESTS")

- name: deploy to minikube
run: |
cd helm-chart/eoapi
kubectl apply -f eoapi-manfests.yaml
cd helm-chart

- name: sleep for 20s seconds while services boot
helm install \
--namespace default \
--create-namespace \
--set gitSha=$GITSHA \
--set db.settings.secrets.PGUSER=$PGUSER \
--set db.settings.secrets.POSTGRES_USER=$POSTGRES_USER \
--set db.settings.secrets.PGPASSWORD=$PGPASSWORD \
--set db.settings.secrets.POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
-f ./eoapi/values.yaml \
-f ./eoapi/test-unittest-values.yaml \
eoapi \
./eoapi

- name: sleep for 10s seconds while services boot
shell: bash
run: sleep 20s
run: sleep 10s

- name: restart the services
run: |
# usually if a pod fails b/c the DB isn't up yet it will go into CrashLoopBackOff state, so bounce them
#kubectl get pod | grep '^vector-.*$' | cut -d' ' -f1 | xargs -I{} kubectl delete pod/{}
# usually if a pod fails b/c the DB isn't up yet it will go into CrashLoopBackOff state and then restart
# and then the service is fine but minikube doesn't seem to restart things for some reason, could be
# that the underlying CMD(s) don't fully exit so we need to restart the services here
kubectl rollout restart deploy/vector
#kubectl get pod | grep '^stac-.*$' | cut -d' ' -f1 | xargs -I{} kubectl delete pod/{}
kubectl rollout restart deploy/stac
#kubectl get pod | grep '^raster-.*$' | cut -d' ' -f1 | xargs -I{} kubectl delete pod/{}
kubectl rollout restart deploy/raster

sleep 10s
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# k8s-eoapi

---

<p align="center">
<a href="https://github.com/developmentseed/k8s-eoapi/actions?query=workflow%3Ahelm-tests" target="_blank">
<img src="https://github.com/developmentseed/k8s-eoapi/actions/workflows/helm-tests.yml/badge.svg" alt="Test">
Expand All @@ -9,7 +11,6 @@
</a>
</p>

---

## Getting Started

Expand Down
8 changes: 8 additions & 0 deletions docs/aws-eks.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ helm upgrade \
--namespace <the-same-namespace-where-your-services-will-be-deployed>
```

Depending on what NGINX functionality you need you might also want to configure `kind: ConfigMap` as [talked about on their docs](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/).
Below we enable gzip by patching `use-gzip` into the `ConfigMap`:

```python
$ kubectl get cm | grep ingress-nginx | cut -d' ' -f1 | xargs -I{} kubectl patch cm/{} --type merge -p '{"data":{"use-gzip":"true"}}'
$ kubectl get deploy | grep ingress-nginx | cut -d' ' -f1 | xargs -I{} kubectl rollout restart deploy/{}
```

Assert that things are set up correctly:

```python
Expand Down