diff --git a/enterprise/cli/provisionerdaemons.go b/enterprise/cli/provisionerdaemons.go index baca9fa4b3296..f75172e966417 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 856f18bd33d6e..b84b7d8c4e48c 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 e7ca572bf4575..39760332be082 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 85f25e16f5869..48162991f61eb 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 003d89626ba60..04197fca37468 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 85fa5fa1f1566..1c2d49d8c424c 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 74a7ffbed4675..b641ee0db37cb 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 e5e2fd760d711..e8f6ee3bd45dd 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 08fb37a8bdd70..ff628dd883929 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