From 6a671112f0a4e625a4cddd5913c5efa4e2795f5d Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 27 Oct 2021 15:15:48 +0100 Subject: [PATCH] templates: hook up simple probes and default limits Use fetching the OpenAPI spec as a simple readiness/liveness, as there is not much else we can/need to verify. Set the default CPU and memory limits in accordance with AppSRE requirements. Signed-off-by: Tom Gundersen --- templates/composer.yml | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/templates/composer.yml b/templates/composer.yml index 75aed9d20..7c5d548e3 100644 --- a/templates/composer.yml +++ b/templates/composer.yml @@ -39,6 +39,31 @@ objects: containers: - image: "${IMAGE_NAME}:${IMAGE_TAG}" name: composer + livenessProbe: + failureThreshold: 3 + httpGet: + path: ${LIVENESS_URI} + port: ${{COMPOSER_API_PORT}} + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + readinessProbe: + failureThreshold: 3 + httpGet: + path: ${READINESS_URI} + port: ${{COMPOSER_API_PORT}} + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + resources: + requests: + cpu: "${CPU_REQUEST}" + memory: "${MEMORY_REQUEST}" + limits: + cpu: "${CPU_LIMIT}" + memory: "${MEMORY_LIMIT}" env: - name: PGHOST valueFrom: @@ -218,3 +243,21 @@ parameters: name: WORKER_API_PORT required: true value: "8700" + - name: LIVENESS_URI + description: URI to query for the liveness check + value: "/openapi" + - name: READINESS_URI + description: URI to query for the readiness check + value: "/openapi" + - name: CPU_REQUEST + description: CPU request per container + value: "200m" + - name: CPU_LIMIT + description: CPU limit per container + value: "1" + - name: MEMORY_REQUEST + description: Memory request per container + value: "256Mi" + - name: MEMORY_LIMIT + description: Memory limit per container + value: "512Mi"