Alias /health/liveliness as /health/liveness

The latter is the more common term in Kubernetes, so it's nice to support that.
This commit is contained in:
Marc Abramowitz 2024-07-18 14:29:32 -07:00 committed by Krrish Dholakia
parent 6f393be66b
commit 780a6293dc
2 changed files with 12 additions and 1 deletions

View file

@ -304,6 +304,7 @@ class LiteLLMRoutes(enum.Enum):
"/routes",
"/",
"/health/liveliness",
"/health/liveness",
"/health/readiness",
"/test",
"/config/yaml",

View file

@ -483,7 +483,12 @@ async def health_readiness():
@router.get(
"/health/liveliness",
"/health/liveliness", # Historical LiteLLM name; doesn't match k8s terminology but kept for backwards compatibility
tags=["health"],
dependencies=[Depends(user_api_key_auth)],
)
@router.get(
"/health/liveness", # Kubernetes has "liveness" probes (https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command)
tags=["health"],
dependencies=[Depends(user_api_key_auth)],
)
@ -516,6 +521,11 @@ async def health_readiness_options():
tags=["health"],
dependencies=[Depends(user_api_key_auth)],
)
@router.options(
"/health/liveness", # Kubernetes has "liveness" probes (https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command)
tags=["health"],
dependencies=[Depends(user_api_key_auth)],
)
async def health_liveliness_options():
"""
Options endpoint for health/liveliness check.