Skip to content

Commit 41433cd

Browse files
authored
feat: add terminationGracePeriodSeconds to provisioner chart (#9048)
* feat: add terminationGracePeriodSeconds to provisioner chart Signed-off-by: Spike Curtis <spike@coder.com> * Remove hardcoded 1 minute graceful timeout Signed-off-by: Spike Curtis <spike@coder.com> --------- Signed-off-by: Spike Curtis <spike@coder.com>
1 parent e893ab2 commit 41433cd

File tree

9 files changed

+13
-9
lines changed

9 files changed

+13
-9
lines changed

enterprise/cli/provisionerdaemons.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ func (r *RootCmd) provisionerDaemonStart() *clibase.Cmd {
137137
cliui.Errorf(inv.Stderr, "Unexpected error, shutting down server: %s\n", exitErr)
138138
}
139139

140-
shutdown, shutdownCancel := context.WithTimeout(ctx, time.Minute)
141-
defer shutdownCancel()
142-
err = srv.Shutdown(shutdown)
140+
err = srv.Shutdown(ctx)
143141
if err != nil {
144142
return xerrors.Errorf("shutdown: %w", err)
145143
}

helm/provisioner/templates/_coder.tpl

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Deployment to merge into the libcoder template
1111
spec:
1212
template:
1313
spec:
14+
terminationGracePeriodSeconds: {{ .Values.provisionerDaemon.terminationGracePeriodSeconds }}
1415
containers:
1516
-
1617
{{ include "libcoder.containerspec" (list . "coder.containerspec") | indent 8}}

helm/provisioner/tests/testdata/command.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,5 @@ spec:
131131
volumeMounts: []
132132
restartPolicy: Always
133133
serviceAccountName: coder-provisioner
134-
terminationGracePeriodSeconds: 60
134+
terminationGracePeriodSeconds: 600
135135
volumes: []

helm/provisioner/tests/testdata/command_args.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,5 @@ spec:
131131
volumeMounts: []
132132
restartPolicy: Always
133133
serviceAccountName: coder-provisioner
134-
terminationGracePeriodSeconds: 60
134+
terminationGracePeriodSeconds: 600
135135
volumes: []

helm/provisioner/tests/testdata/default_values.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,5 @@ spec:
131131
volumeMounts: []
132132
restartPolicy: Always
133133
serviceAccountName: coder-provisioner
134-
terminationGracePeriodSeconds: 60
134+
terminationGracePeriodSeconds: 600
135135
volumes: []

helm/provisioner/tests/testdata/labels_annotations.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,5 @@ spec:
139139
volumeMounts: []
140140
restartPolicy: Always
141141
serviceAccountName: coder-provisioner
142-
terminationGracePeriodSeconds: 60
142+
terminationGracePeriodSeconds: 600
143143
volumes: []

helm/provisioner/tests/testdata/provisionerd_psk.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,5 @@ spec:
133133
volumeMounts: []
134134
restartPolicy: Always
135135
serviceAccountName: coder-provisioner
136-
terminationGracePeriodSeconds: 60
136+
terminationGracePeriodSeconds: 600
137137
volumes: []

helm/provisioner/tests/testdata/sa.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,5 @@ spec:
132132
volumeMounts: []
133133
restartPolicy: Always
134134
serviceAccountName: coder-service-account
135-
terminationGracePeriodSeconds: 60
135+
terminationGracePeriodSeconds: 600
136136
volumes: []

helm/provisioner/values.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,8 @@ provisionerDaemon:
202202
{}
203203
# location: usa
204204
# provider: kubernetes
205+
206+
# provisionerDaemon.terminationGracePeriodSeconds -- Time in seconds that Kubernetes should wait before forcibly
207+
# terminating the provisioner daemon. You should set this to be longer than your longest expected build time so that
208+
# redeployments do not interrupt builds in progress.
209+
terminationGracePeriodSeconds: 600

0 commit comments

Comments
 (0)