diff --git a/helm-chart/eoapi/tests/config_tests.yaml b/helm-chart/eoapi/tests/config_tests.yaml index aba0e02c..e403ed3b 100644 --- a/helm-chart/eoapi/tests/config_tests.yaml +++ b/helm-chart/eoapi/tests/config_tests.yaml @@ -7,6 +7,7 @@ tests: raster.enabled: false stac.enabled: false vector.enabled: true + multidim.enabled: false asserts: - isKind: of: ConfigMap @@ -21,6 +22,7 @@ tests: raster.enabled: true stac.enabled: false vector.enabled: false + multidim.enabled: false asserts: - isKind: of: ConfigMap @@ -35,6 +37,7 @@ tests: raster.enabled: false stac.enabled: true vector.enabled: false + multidim.enabled: false asserts: - isKind: of: ConfigMap @@ -44,3 +47,18 @@ tests: - equal: path: data.WEB_CONCURRENCY value: "5" + - it: "multidim configmap defaults" + set: + raster.enabled: false + stac.enabled: false + vector.enabled: false + multidim.enabled: true + asserts: + - isKind: + of: ConfigMap + - matchRegex: + path: metadata.name + pattern: ^multidim-envvar-configmap-RELEASE-NAME$ + - equal: + path: data.GDAL_HTTP_MULTIPLEX + value: "YES" diff --git a/helm-chart/eoapi/tests/deploy_tests.yaml b/helm-chart/eoapi/tests/deploy_tests.yaml index 4865789a..41323441 100644 --- a/helm-chart/eoapi/tests/deploy_tests.yaml +++ b/helm-chart/eoapi/tests/deploy_tests.yaml @@ -7,6 +7,7 @@ tests: raster.enabled: false stac.enabled: false vector.enabled: true + multidim.enabled: false asserts: - isKind: of: Deployment @@ -36,6 +37,7 @@ tests: raster.enabled: true stac.enabled: false vector.enabled: false + multidim.enabled: false asserts: - isKind: of: Deployment @@ -65,6 +67,7 @@ tests: raster.enabled: false stac.enabled: true vector.enabled: false + multidim.enabled: false asserts: - isKind: of: Deployment @@ -89,3 +92,33 @@ tests: - equal: path: metadata.labels.gitsha value: "ABC123" + - it: "multidim deploy defaults" + set: + raster.enabled: false + stac.enabled: false + vector.enabled: false + multidim.enabled: true + asserts: + - isKind: + of: Deployment + - matchRegex: + path: metadata.name + pattern: ^multidim-RELEASE-NAME$ + - equal: + path: spec.strategy.type + value: "RollingUpdate" + - equal: + path: spec.template.spec.containers[0].resources.limits.cpu + value: "768m" + - equal: + path: spec.template.spec.containers[0].resources.requests.cpu + value: "256m" + - equal: + path: spec.template.spec.containers[0].resources.limits.memory + value: "4096Mi" + - equal: + path: spec.template.spec.containers[0].resources.requests.memory + value: "3072Mi" + - equal: + path: metadata.labels.gitsha + value: "ABC123" diff --git a/helm-chart/eoapi/tests/ingress_tests_nginx.yaml b/helm-chart/eoapi/tests/ingress_tests_nginx.yaml index bee00d0d..22276b30 100644 --- a/helm-chart/eoapi/tests/ingress_tests_nginx.yaml +++ b/helm-chart/eoapi/tests/ingress_tests_nginx.yaml @@ -8,6 +8,7 @@ tests: raster.enabled: false stac.enabled: false vector.enabled: true + multidim.enabled: false asserts: - isKind: of: Ingress @@ -30,6 +31,7 @@ tests: raster.enabled: true stac.enabled: false vector.enabled: false + multidim.enabled: false asserts: - isKind: of: Ingress @@ -52,6 +54,7 @@ tests: raster.enabled: false stac.enabled: true vector.enabled: false + multidim.enabled: false asserts: - isKind: of: Ingress @@ -68,3 +71,26 @@ tests: - equal: path: spec.ingressClassName value: "nginx" + - it: "multidim ingress defaults" + set: + ingress.className: "nginx" + raster.enabled: false + stac.enabled: false + vector.enabled: false + multidim.enabled: true + asserts: + - isKind: + of: Ingress + - matchRegex: + path: spec.rules[0].http.paths[0].path + pattern: ^/multidim\(\/\|\$\)\(\.\*\)$ + - equal: + path: metadata.annotations + value: + nginx.ingress.kubernetes.io/enable-access-log: "true" + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/enable-cors: "true" + - equal: + path: spec.ingressClassName + value: "nginx" diff --git a/helm-chart/eoapi/values.yaml b/helm-chart/eoapi/values.yaml index 7cc6d5a7..b0fe70f8 100644 --- a/helm-chart/eoapi/values.yaml +++ b/helm-chart/eoapi/values.yaml @@ -172,6 +172,7 @@ pgstacBootstrap: ###################### apiServices: - raster + - multidim - stac - vector @@ -236,6 +237,67 @@ raster: # https://www.uvicorn.org/settings/#production WEB_CONCURRENCY: "5" +multidim: + enabled: false # disabled by default + autoscaling: + # NOTE: to have autoscaling working you'll need to install the `eoapi-support` chart + # see ../../../docs/autoscaling.md for more information + enabled: false + minReplicas: 1 + maxReplicas: 10 + # `type`: "cpu" || "requestRate" || "both" + type: "requestRate" + behaviour: + scaleDown: + stabilizationWindowSeconds: 60 + scaleUp: + stabilizationWindowSeconds: 0 + targets: + # matches `type` value above unless `type: "both"` is selected + cpu: 75 + # 'm' units here represents generic milli (one-thousandth) unit instead of 'decimal' + # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#quantities + # so when the average unit among these pods is /1000 then scale + # you can watch the actual/target in real time using `kubectl get hpa/` + requestRate: 100000m + image: + name: ghcr.io/developmentseed/titiler-md-demo + tag: 0ea56bfa44457b92e804fd4c0c2192019c002965 + command: + - "uvicorn" + - "titiler.pgstac.main:app" + - "--host=$(HOST)" + - "--port=$(PORT)" + settings: + # https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + resources: + limits: + cpu: "768m" + memory: "4096Mi" + requests: + cpu: "256m" + memory: "3072Mi" + envVars: + ############## + # titiler + ############## + GDAL_CACHEMAX: "200" # 200 mb + GDAL_DISABLE_READDIR_ON_OPEN: "EMPTY_DIR" + GDAL_INGESTED_BYTES_AT_OPEN: "32768" + GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: "YES" + GDAL_HTTP_MULTIPLEX: "YES" + GDAL_HTTP_VERSION: "2" + PYTHONWARNINGS: "ignore" + VSI_CACHE: "TRUE" + VSI_CACHE_SIZE: "5000000" # 5 MB (per file-handle) + ############## + # uvicorn + ############## + HOST: "0.0.0.0" + PORT: "8080" + # https://www.uvicorn.org/settings/#production + WEB_CONCURRENCY: "5" + stac: enabled: true autoscaling: