From 64c93d12a019a0d5e6392131a136e5ae0bc7eb03 Mon Sep 17 00:00:00 2001 From: Takwa Date: Wed, 22 May 2024 12:14:13 +0100 Subject: [PATCH] Add startup probe to tw setup --- install-bundler/bundler/install.sh | 2 +- .../bundler/templates/statefulset.yaml | 8 +++ .../bundler/values.production.yaml | 57 +++++++++++++++++++ .../{values.yaml => values.staging.yaml} | 4 ++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 install-bundler/bundler/values.production.yaml rename install-bundler/bundler/{values.yaml => values.staging.yaml} (93%) diff --git a/install-bundler/bundler/install.sh b/install-bundler/bundler/install.sh index e09cadaf..7cf7e3f3 100755 --- a/install-bundler/bundler/install.sh +++ b/install-bundler/bundler/install.sh @@ -169,7 +169,7 @@ for array_name in $array_names; do helm upgrade --install "${HELM_RELEASE}-${CHAIN_ID}" "$DIR/." \ --wait \ --timeout 600s \ - --values "$DIR/values.yaml" \ + --values "$DIR/values.$environment.yaml" \ --namespace "$NAMESPACE" \ --set nameOverride="$NAME" \ --set env="$ENV" \ diff --git a/install-bundler/bundler/templates/statefulset.yaml b/install-bundler/bundler/templates/statefulset.yaml index f10eb891..36dae13d 100644 --- a/install-bundler/bundler/templates/statefulset.yaml +++ b/install-bundler/bundler/templates/statefulset.yaml @@ -134,6 +134,14 @@ spec: failureThreshold: 40 periodSeconds: 10 + startupProbe: + httpGet: + path: /admin/startup + port: {{ .Values.port }} + failureThreshold: {{ .Values.startupProbe.failureThreshold }} + successThreshold: 1 + periodSeconds: 10 + livenessProbe: httpGet: path: /health diff --git a/install-bundler/bundler/values.production.yaml b/install-bundler/bundler/values.production.yaml new file mode 100644 index 00000000..05c1ef2e --- /dev/null +++ b/install-bundler/bundler/values.production.yaml @@ -0,0 +1,57 @@ +namespace: "" +env: "test" +hpa: + minReplicas: 2 + maxReplicas: 3 + average_http_requests_hpa: 20 + average_cpu_hpa: 80 + +port: "3000" +targetPort: "3000" +replicaCount: 2 +resources: + requests: + memory: "2500Mi" + cpu: "2500m" + limits: + memory: "2500Mi" + cpu: "2500m" + +# wait for 120 * 10s to fail +startupProbe: + failureThreshold: 120 + +# secret: +# projectID: biconomy-test +# key: bundlers +# config: +# name: config.json.enc + +# passphrase: +# key: passphrase +# name: CONFIG_PASSPHRASE +# version: latest + +# datadog configs +affinity_tolerations: + enable: false + +datadog: + enable: true + # gke_cluster_type: standard OR autopilot + gke_cluster_type: autopilot + # https://github.com/DataDog/dd-trace-js/releases + dd_js_lib_version: v4.18.0 + env: "testing2" + service: "sdk-relayer-service" + version: "v3.15.0" + configs: + DD_TRACE_DEBUG: "true" + DD_TRACE_STARTUP_LOGS: "false" + DD_PROFILING_ENABLED: "true" + DD_LOGS_INJECTION: "false" + DD_RUNTIME_METRICS_ENABLED: "true" + + logs: + enabled: false + containerCollectAll: false diff --git a/install-bundler/bundler/values.yaml b/install-bundler/bundler/values.staging.yaml similarity index 93% rename from install-bundler/bundler/values.yaml rename to install-bundler/bundler/values.staging.yaml index 974afd4e..4e80b0c9 100644 --- a/install-bundler/bundler/values.yaml +++ b/install-bundler/bundler/values.staging.yaml @@ -17,6 +17,10 @@ resources: memory: "2500Mi" cpu: "2500m" +# wait for 60 * 10s to fail +startupProbe: + failureThreshold: 60 + # secret: # projectID: biconomy-test # key: bundlers