From a48549a731b3158c0b9855795fd69022c45eaf2a Mon Sep 17 00:00:00 2001 From: Clive Cox Date: Fri, 28 Aug 2020 16:45:26 +0100 Subject: [PATCH 1/2] Allow terminationGracePeriodSeconds to be overridden --- operator/controllers/seldondeployment_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/operator/controllers/seldondeployment_controller.go b/operator/controllers/seldondeployment_controller.go index d676742e03..1415b62d65 100644 --- a/operator/controllers/seldondeployment_controller.go +++ b/operator/controllers/seldondeployment_controller.go @@ -889,8 +889,13 @@ func createDeploymentWithoutEngine(depName string, seldonId string, seldonPodSpe if deploy.Spec.Template.Spec.SchedulerName == "" { deploy.Spec.Template.Spec.SchedulerName = "default-scheduler" } + + // Set TerminationGracePeriodSeconds var terminationGracePeriod int64 = 20 deploy.Spec.Template.Spec.TerminationGracePeriodSeconds = &terminationGracePeriod + if seldonPodSpec != nil && seldonPodSpec.Spec.TerminationGracePeriodSeconds != nil { + deploy.Spec.Template.Spec.TerminationGracePeriodSeconds = seldonPodSpec.Spec.TerminationGracePeriodSeconds + } volFound := false for _, vol := range deploy.Spec.Template.Spec.Volumes { From 6c11a13fbd3033bba88d577f7139324ab8faf933 Mon Sep 17 00:00:00 2001 From: Clive Cox Date: Fri, 28 Aug 2020 17:00:45 +0100 Subject: [PATCH 2/2] Add example model termination grace period --- .../model_terminationgraceperiod.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 notebooks/resources/model_terminationgraceperiod.yaml diff --git a/notebooks/resources/model_terminationgraceperiod.yaml b/notebooks/resources/model_terminationgraceperiod.yaml new file mode 100644 index 0000000000..288f90682b --- /dev/null +++ b/notebooks/resources/model_terminationgraceperiod.yaml @@ -0,0 +1,21 @@ +apiVersion: machinelearning.seldon.io/v1 +kind: SeldonDeployment +metadata: + name: seldon-model +spec: + name: test-deployment + predictors: + - componentSpecs: + - spec: + containers: + - image: seldonio/mock_classifier_rest:1.3 + name: classifier + terminationGracePeriodSeconds: 1 + graph: + children: [] + endpoint: + type: REST + name: classifier + type: MODEL + name: example + replicas: 1