Skip to content

Commit

Permalink
Merge pull request #2345 from cliveseldon/2332_termination_grace_period
Browse files Browse the repository at this point in the history
Allow terminationGracePeriodSeconds to be overridden
  • Loading branch information
axsaucedo authored Sep 17, 2020
2 parents 69cb972 + ab2d866 commit b98d776
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions notebooks/resources/model_terminationgraceperiod.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions operator/controllers/seldondeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,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 {
Expand Down

0 comments on commit b98d776

Please sign in to comment.