diff --git a/deployments/sequencer/services/service.py b/deployments/sequencer/services/service.py index 35b59fc5d12..1d90739f094 100644 --- a/deployments/sequencer/services/service.py +++ b/deployments/sequencer/services/service.py @@ -1,9 +1,10 @@ -from typing import Optional, Dict +import json + +from typing import Optional, Dict, Union from constructs import Construct from cdk8s import Names -import json -from imports import k8s +from imports import k8s class Service(Construct): def __init__( @@ -14,8 +15,12 @@ def __init__( image: str, replicas: int = 1, port: Optional[int] = 80, - container_port: int = 8080, + container_port: int = 8082, config: Optional[Dict[str, str]] = None, + startup_probe_path: Optional[str] = "/", + readiness_probe_path: Optional[str] = "/", + liveness_probe_path: Optional[str] = "/" + ): super().__init__(scope, id) @@ -59,15 +64,25 @@ def __init__( ports=[ k8s.ContainerPort(container_port=container_port) ], + startup_probe=k8s.Probe( + http_get=k8s.HttpGetAction(port=k8s.IntOrString.from_string('http'), path=startup_probe_path), + period_seconds=10, failure_threshold=12, timeout_seconds=5 + ), + readiness_probe=k8s.Probe( + http_get=k8s.HttpGetAction(port=k8s.IntOrString.from_string('http'), path=readiness_probe_path), + period_seconds=10, failure_threshold=3, timeout_seconds=5 + ), + liveness_probe=k8s.Probe( + http_get=k8s.HttpGetAction(port=k8s.IntOrString.from_string('http'), path=liveness_probe_path), + period_seconds=5, failure_threshold=5, timeout_seconds=5 + ) ) ], volumes=( [ k8s.Volume( name=service_config.name, - config_map=k8s.ConfigMapVolumeSource( - name=service_config.name - ), + config_map=k8s.ConfigMapVolumeSource(name=service_config.name), ) ] if config is not None