Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow terminationGracePeriodSeconds to be overridden #2345

Merged
merged 4 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
axsaucedo marked this conversation as resolved.
Show resolved Hide resolved
deploy.Spec.Template.Spec.TerminationGracePeriodSeconds = seldonPodSpec.Spec.TerminationGracePeriodSeconds
}

volFound := false
for _, vol := range deploy.Spec.Template.Spec.Volumes {
Expand Down