From 86211e20fe67dafc371796161e7b5996cfb751a2 Mon Sep 17 00:00:00 2001 From: Yan <100032599+whykay-01@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:09:12 +0000 Subject: [PATCH] feat: added health endpoint for the deployment --- k8s/deployment.yaml | 4 ++-- service/routes.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 2c3e824..4024d33 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -46,7 +46,7 @@ spec: resources: limits: cpu: "0.50" - memory: "128Mi" + memory: "256Mi" requests: cpu: "0.25" - memory: "64Mi" + memory: "128Mi" diff --git a/service/routes.py b/service/routes.py index 8ccfbd5..07c7085 100644 --- a/service/routes.py +++ b/service/routes.py @@ -43,6 +43,20 @@ def index(): ) +###################################################################### +# HEALTH ENDPOINT FOR K3 CLUSTER +###################################################################### +@app.route("/health") +def health(): + """Health endpoint""" + return ( + jsonify( + message=status.HTTP_200_OK, + ), + status.HTTP_200_OK, + ) + + ###################################################################### # R E S T A P I E N D P O I N T S ######################################################################