From 33b3039ec4ea4807af3fa36b04ae53372f7a77ed Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Wed, 28 Jun 2023 13:50:59 -0700 Subject: [PATCH 1/7] helm upgrade --- .github/workflows/helm-tests.yml | 47 ++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index 2660313c..49b50674 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -59,24 +59,37 @@ jobs: export POSTGRES_PASSWORD=password export GITSHA='A12345' - cd helm-chart/eoapi + cd helm-chart - 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") + helm upgrade \ + --namespace eoapi \ + --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.yml \ + -f ./eoapi/test-unittest-values.yaml \ + eoapi \ + ./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: | From 7e7f5cd975a79fc0a297986146e1c01dfbac3b57 Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Wed, 28 Jun 2023 13:56:17 -0700 Subject: [PATCH 2/7] upgrade again --- .github/workflows/helm-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index 49b50674..fb951bee 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -59,7 +59,7 @@ jobs: export POSTGRES_PASSWORD=password export GITSHA='A12345' - cd helm-chart + cd helm-chart/eoapi helm upgrade \ --namespace eoapi \ @@ -69,10 +69,10 @@ jobs: --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.yml \ - -f ./eoapi/test-unittest-values.yaml \ + -f values.yml \ + -f test-unittest-values.yaml \ eoapi \ - ./eoapi + . # MANIFEST=eoapi-manfests.yaml # echo "" > $MANIFEST From 40080d149d9fcb8391595ca42b80ba820cc4d7f6 Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Wed, 28 Jun 2023 14:05:35 -0700 Subject: [PATCH 3/7] yaml not yml --- .github/workflows/helm-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index fb951bee..1515998f 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -59,7 +59,7 @@ jobs: export POSTGRES_PASSWORD=password export GITSHA='A12345' - cd helm-chart/eoapi + cd helm-chart helm upgrade \ --namespace eoapi \ @@ -69,10 +69,10 @@ jobs: --set db.settings.secrets.POSTGRES_USER=$POSTGRES_USER \ --set db.settings.secrets.PGPASSWORD=$PGPASSWORD \ --set db.settings.secrets.POSTGRES_PASSWORD=$POSTGRES_PASSWORD \ - -f values.yml \ - -f test-unittest-values.yaml \ + -f ./eoapi/values.yaml \ + -f ./eoapi/test-unittest-values.yaml \ eoapi \ - . + ./eoapi # MANIFEST=eoapi-manfests.yaml # echo "" > $MANIFEST From 2a0a29ad3bdff670dea77d893333444e1b44f46a Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Wed, 28 Jun 2023 14:23:07 -0700 Subject: [PATCH 4/7] try helm install --- .github/workflows/helm-tests.yml | 2 +- docs/aws-eks.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index 1515998f..a4da5206 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -61,7 +61,7 @@ jobs: cd helm-chart - helm upgrade \ + helm install \ --namespace eoapi \ --create-namespace \ --set gitSha=$GITSHA \ diff --git a/docs/aws-eks.md b/docs/aws-eks.md index b548abd0..304e33af 100644 --- a/docs/aws-eks.md +++ b/docs/aws-eks.md @@ -222,6 +222,14 @@ helm upgrade \ --namespace ``` +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 From cb10c865f094787215c2f2a1128f4937c8db08db Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Wed, 28 Jun 2023 14:46:04 -0700 Subject: [PATCH 5/7] tweaks --- .github/workflows/helm-tests.yml | 24 +----------------------- README.md | 3 ++- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index a4da5206..065b18a0 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -51,7 +51,7 @@ 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 @@ -74,28 +74,6 @@ jobs: eoapi \ ./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 - - name: sleep for 20s seconds while services boot shell: bash run: sleep 20s diff --git a/README.md b/README.md index 0c429709..59311fad 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # k8s-eoapi +--- +

Test @@ -9,7 +11,6 @@

---- ## Getting Started From c49901102e8f9c3aaceb4eb70e9a37e4772e1777 Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Wed, 28 Jun 2023 14:53:40 -0700 Subject: [PATCH 6/7] use default namespace --- .github/workflows/helm-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index 065b18a0..6db26f7e 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -62,7 +62,7 @@ jobs: cd helm-chart helm install \ - --namespace eoapi \ + --namespace default \ --create-namespace \ --set gitSha=$GITSHA \ --set db.settings.secrets.PGUSER=$PGUSER \ @@ -74,9 +74,9 @@ jobs: eoapi \ ./eoapi - - name: sleep for 20s seconds while services boot + - name: sleep for 10s seconds while services boot shell: bash - run: sleep 20s + run: sleep 10s - name: restart the services run: | From 23db7fd847862baca0927cbc35b7d54a5c90fa95 Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Wed, 28 Jun 2023 15:02:36 -0700 Subject: [PATCH 7/7] try, try again --- .github/workflows/helm-tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index 6db26f7e..359d487b 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -80,12 +80,11 @@ jobs: - 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