File tree Expand file tree Collapse file tree 9 files changed +36
-14
lines changed Expand file tree Collapse file tree 9 files changed +36
-14
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ ingest:
3636 @command -v bash > /dev/null 2>&1 || { echo " bash is required but not installed" ; exit 1; }
3737 @./ingest.sh || { echo " Ingestion failed." ; exit 1; }
3838
39+ tests :
40+ @echo " Running tests."
41+ @command -v helm > /dev/null 2>&1 || { echo " helm is required but not installed" ; exit 1; }
42+ @helm unittest helm-chart/eoapi -f ' tests/*.yaml' -v helm-chart/eoapi/test-helm-values.yaml
43+
3944help :
4045 @echo " Makefile commands:"
4146 @echo " make deploy - Install eoAPI on a cluster kubectl is connected to."
Original file line number Diff line number Diff line change @@ -159,11 +159,23 @@ so we use this helper function to check autoscaling rules
159159{ {- define " eoapi.validateAutoscaleRules" -} }
160160{ {- if and .Values.ingress.enabled (ne .Values.ingress.className " nginx" ) } }
161161{ {/* " requestRate" cannot be enabled for any service if not " nginx" so give feedback and fail */} }
162- { {- if (or (and .Values.raster.autoscaling.enabled (eq .Values.raster.autoscaling.type " requestRate" )) (and .Values.stac.autoscaling.enabled (eq .Values.stac.autoscaling.type " requestRate" )) (and .Values.vector.autoscaling.enabled (eq .Values.vector.autoscaling.type " requestRate" )) ) } }
162+ { {- $requestRateEnabled := false } }
163+ { {- range .Values.apiServices } }
164+ { {- if and (index $.Values . " autoscaling" " enabled" ) (eq (index $.Values . " autoscaling" " type" ) " requestRate" ) } }
165+ { {- $requestRateEnabled = true } }
166+ { {- end } }
167+ { {- end } }
168+ { {- if $requestRateEnabled } }
163169{ {- fail " When using an 'ingress.className' other than 'nginx' you cannot enable autoscaling by 'requestRate' at this time b/c it's solely an nginx metric" } }
164170{ {- end } }
165171{ {/* " both" cannot be enabled for any service if not " nginx" so give feedback and fail */} }
166- { {- if (or (and .Values.raster.autoscaling.enabled (eq .Values.raster.autoscaling.type " both" )) (and .Values.stac.autoscaling.enabled (eq .Values.stac.autoscaling.type " both" )) (and .Values.vector.autoscaling.enabled (eq .Values.vector.autoscaling.type " both" )) ) } }
172+ { {- $bothEnabled := false } }
173+ { {- range .Values.apiServices } }
174+ { {- if and (index $.Values . " autoscaling" " enabled" ) (eq (index $.Values . " autoscaling" " type" ) " both" ) } }
175+ { {- $bothEnabled = true } }
176+ { {- end } }
177+ { {- end } }
178+ { {- if $bothEnabled } }
167179{ {- fail " When using an 'ingress.className' other than 'nginx' you cannot enable autoscaling by 'both' at this time b/c 'requestRate' is solely an nginx metric" } }
168180{ {- end } }
169181{ {- end } }
Original file line number Diff line number Diff line change 11{{- range $serviceName, $v := .Values -}}
2- {{- if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) }}
2+ {{- if has $serviceName $.Values.apiServices }}
33{{- if index $v "enabled" }}
44apiVersion : v1
55kind : ConfigMap
1212---
1313{{/* END: if index $v "enabled" */}}
1414{{- end }}
15- {{/* END: if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) */}}
15+ {{/* END: if has $serviceName $.Values.apiServices */}}
1616{{- end }}
1717{{/* END: range $serviceName, $v := .Values*/}}
1818{{- end }}
Original file line number Diff line number Diff line change 11{{ include "eoapi.validateTempDB" . }}
22{{- range $serviceName, $v := .Values -}}
3- {{- if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) }}
3+ {{- if has $serviceName $.Values.apiServices }}
44{{- if index $v "enabled" }}
55apiVersion : apps/v1
66kind : Deployment
8282---
8383{{/* END: if index $v "enabled" */}}
8484{{- end }}
85- {{/* END: if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) */}}
85+ {{/* END: if has $serviceName $.Values.apiServices */}}
8686{{- end }}
8787{{/* END: range $serviceName, $v := .Values*/}}
8888{{- end }}
Original file line number Diff line number Diff line change 11{{- include "eoapi.validateAutoscaleRules" . -}}
22{{- range $serviceName, $v := .Values -}}
3- {{- if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) }}
3+ {{- if has $serviceName $.Values.apiServices }}
44{{- if index $v "autoscaling" "enabled" }}
55apiVersion : autoscaling/v2
66kind : HorizontalPodAutoscaler
4444---
4545{{/* END: if index $v "autoscaling" "enabled" */}}
4646{{- end }}
47- {{/* END: if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) */}}
47+ {{/* END: if has $serviceName $.Values.apiServices */}}
4848{{- end }}
4949{{/* END: range $serviceName, $v := .Values*/}}
5050{{- end }}
Original file line number Diff line number Diff line change 3131 - http :
3232 paths :
3333 {{- range $serviceName, $v := .Values }}
34- {{- if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) }}
34+ {{- if has $serviceName $.Values.apiServices }}
3535 {{- if (and (index $v "enabled") (not $.Values.testing)) }}
3636 - pathType : Prefix
3737 path : " /{{ $serviceName }}(/|$)(.*)"
4949 port :
5050 number : {{ $.Values.service.port }}
5151 {{- end }}{{/* END: if index $v "enabled" */}}
52- {{- end }}{{/* END: if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) */}}
52+ {{- end }}{{/* END: if has $serviceName $.Values.apiServices */}}
5353 {{- end }}{{/* END: range $serviceName, $v := .Values*/}}
5454 {{- if (and (not $.Values.testing) (.Values.docServer.enabled)) }}
5555 - pathType : Prefix
Original file line number Diff line number Diff line change 4141 - http :
4242 paths :
4343 {{- range $serviceName, $v := .Values }}
44- {{- if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) }}
44+ {{- if has $serviceName $.Values.apiServices }}
4545 {{- if (and (index $v "enabled") (not $.Values.testing)) }}
4646 - pathType : Prefix
4747 path : " /{{ $serviceName }}"
5959 port :
6060 number : {{ $.Values.service.port }}
6161 {{- end }}{{/* END: if index $v "enabled" */}}
62- {{- end }}{{/* END: if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) */}}
62+ {{- end }}{{/* END: if has $serviceName $.Values.apiServices */}}
6363 {{- end }}{{/* END: range $serviceName, $v := .Values*/}}
6464 {{- if (and (not $.Values.testing) (.Values.docServer.enabled)) }}
6565 - pathType : Prefix
Original file line number Diff line number Diff line change 11{{- range $serviceName, $v := .Values -}}
2- {{- if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) }}
2+ {{- if has $serviceName $.Values.apiServices }}
33{{- if index $v "enabled" }}
44apiVersion : v1
55kind : Service
2828---
2929{{/* END: if index $v "enabled" */}}
3030{{- end }}
31- {{/* END: if (or (eq $serviceName "raster") (eq $serviceName "stac") (eq $serviceName "vector")) */}}
31+ {{/* END: if has $serviceName $.Values.externalServices */}}
3232{{- end }}
3333{{/* END: range $serviceName, $v := .Values*/}}
3434{{- end }}
Original file line number Diff line number Diff line change @@ -170,6 +170,11 @@ pgstacBootstrap:
170170# #####################
171171# API SERVICES
172172# #####################
173+ apiServices :
174+ - raster
175+ - stac
176+ - vector
177+
173178raster :
174179 enabled : true
175180 autoscaling :
You can’t perform that action at this time.
0 commit comments