diff --git a/enterprise/cli/provisionerdaemons.go b/enterprise/cli/provisionerdaemons.go index baca9fa4b3..f75172e966 100644 --- a/enterprise/cli/provisionerdaemons.go +++ b/enterprise/cli/provisionerdaemons.go @@ -137,9 +137,7 @@ func (r *RootCmd) provisionerDaemonStart() *clibase.Cmd { cliui.Errorf(inv.Stderr, "Unexpected error, shutting down server: %s\n", exitErr) } - shutdown, shutdownCancel := context.WithTimeout(ctx, time.Minute) - defer shutdownCancel() - err = srv.Shutdown(shutdown) + err = srv.Shutdown(ctx) if err != nil { return xerrors.Errorf("shutdown: %w", err) } diff --git a/helm/provisioner/templates/_coder.tpl b/helm/provisioner/templates/_coder.tpl index 856f18bd33..b84b7d8c4e 100644 --- a/helm/provisioner/templates/_coder.tpl +++ b/helm/provisioner/templates/_coder.tpl @@ -11,6 +11,7 @@ Deployment to merge into the libcoder template spec: template: spec: + terminationGracePeriodSeconds: {{ .Values.provisionerDaemon.terminationGracePeriodSeconds }} containers: - {{ include "libcoder.containerspec" (list . "coder.containerspec") | indent 8}} diff --git a/helm/provisioner/tests/testdata/command.golden b/helm/provisioner/tests/testdata/command.golden index e7ca572bf4..39760332be 100644 --- a/helm/provisioner/tests/testdata/command.golden +++ b/helm/provisioner/tests/testdata/command.golden @@ -131,5 +131,5 @@ spec: volumeMounts: [] restartPolicy: Always serviceAccountName: coder-provisioner - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: 600 volumes: [] diff --git a/helm/provisioner/tests/testdata/command_args.golden b/helm/provisioner/tests/testdata/command_args.golden index 85f25e16f5..48162991f6 100644 --- a/helm/provisioner/tests/testdata/command_args.golden +++ b/helm/provisioner/tests/testdata/command_args.golden @@ -131,5 +131,5 @@ spec: volumeMounts: [] restartPolicy: Always serviceAccountName: coder-provisioner - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: 600 volumes: [] diff --git a/helm/provisioner/tests/testdata/default_values.golden b/helm/provisioner/tests/testdata/default_values.golden index 003d89626b..04197fca37 100644 --- a/helm/provisioner/tests/testdata/default_values.golden +++ b/helm/provisioner/tests/testdata/default_values.golden @@ -131,5 +131,5 @@ spec: volumeMounts: [] restartPolicy: Always serviceAccountName: coder-provisioner - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: 600 volumes: [] diff --git a/helm/provisioner/tests/testdata/labels_annotations.golden b/helm/provisioner/tests/testdata/labels_annotations.golden index 85fa5fa1f1..1c2d49d8c4 100644 --- a/helm/provisioner/tests/testdata/labels_annotations.golden +++ b/helm/provisioner/tests/testdata/labels_annotations.golden @@ -139,5 +139,5 @@ spec: volumeMounts: [] restartPolicy: Always serviceAccountName: coder-provisioner - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: 600 volumes: [] diff --git a/helm/provisioner/tests/testdata/provisionerd_psk.golden b/helm/provisioner/tests/testdata/provisionerd_psk.golden index 74a7ffbed4..b641ee0db3 100644 --- a/helm/provisioner/tests/testdata/provisionerd_psk.golden +++ b/helm/provisioner/tests/testdata/provisionerd_psk.golden @@ -133,5 +133,5 @@ spec: volumeMounts: [] restartPolicy: Always serviceAccountName: coder-provisioner - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: 600 volumes: [] diff --git a/helm/provisioner/tests/testdata/sa.golden b/helm/provisioner/tests/testdata/sa.golden index e5e2fd760d..e8f6ee3bd4 100644 --- a/helm/provisioner/tests/testdata/sa.golden +++ b/helm/provisioner/tests/testdata/sa.golden @@ -132,5 +132,5 @@ spec: volumeMounts: [] restartPolicy: Always serviceAccountName: coder-service-account - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: 600 volumes: [] diff --git a/helm/provisioner/values.yaml b/helm/provisioner/values.yaml index 08fb37a8bd..ff628dd883 100644 --- a/helm/provisioner/values.yaml +++ b/helm/provisioner/values.yaml @@ -202,3 +202,8 @@ provisionerDaemon: {} # location: usa # provider: kubernetes + + # provisionerDaemon.terminationGracePeriodSeconds -- Time in seconds that Kubernetes should wait before forcibly + # terminating the provisioner daemon. You should set this to be longer than your longest expected build time so that + # redeployments do not interrupt builds in progress. + terminationGracePeriodSeconds: 600