diff --git a/build/templates/README.md b/build/templates/README.md index efec02e4..c914f87b 100644 --- a/build/templates/README.md +++ b/build/templates/README.md @@ -343,6 +343,7 @@ For details see the [`values.yaml`](values.yaml) file. | `statefulset.resources` | Resource requests and limits for StatefulSet Pods | `{}` | | `statefulset.customLivenessProbe` | Custom Liveness probe | `{}` | | `statefulset.customReadinessProbe` | Custom Rediness probe | `{}` | +| `statefulset.terminationGracePeriodSeconds` | Termination grace period for CRDB statefulset pods | `300` | | `service.ports.grpc.external.port` | CockroachDB primary serving port in Services | `26257` | | `service.ports.grpc.external.name` | CockroachDB primary serving port name in Services | `grpc` | | `service.ports.grpc.internal.port` | CockroachDB inter-communication port in Services | `26257` | @@ -382,6 +383,7 @@ For details see the [`values.yaml`](values.yaml) file. | `init.nodeSelector` | Node labels for init Job Pod assignment | `{}` | | `init.tolerations` | Node taints to tolerate by init Job Pod | `[]` | | `init.resources` | Resource requests and limits for the `cluster-init` container | `{}` | +| `init.terminationGracePeriodSeconds` | Termination grace period for CRDB init job | `300` | | `tls.enabled` | Whether to run securely using TLS certificates | `no` | | `tls.serviceAccount.create` | Whether to create a new RBAC service account | `yes` | | `tls.serviceAccount.name` | Name of RBAC service account to use | `""` | diff --git a/build/templates/values.yaml b/build/templates/values.yaml index 069662ed..4d2d16a2 100644 --- a/build/templates/values.yaml +++ b/build/templates/values.yaml @@ -247,6 +247,9 @@ statefulset: # cpu: 100m # memory: 512Mi + # terminationGracePeriodSeconds is the duration in seconds the Pod needs to terminate gracefully. + terminationGracePeriodSeconds: 300 + # Custom Liveness probe # https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-http-request customLivenessProbe: {} @@ -421,6 +424,9 @@ init: # cpu: "10m" # memory: "128Mi" + # terminationGracePeriodSeconds is the duration in seconds the Pod needs to terminate gracefully. + terminationGracePeriodSeconds: 300 + securityContext: enabled: true diff --git a/cockroachdb/README.md b/cockroachdb/README.md index 4a16e47c..b17ce2d3 100644 --- a/cockroachdb/README.md +++ b/cockroachdb/README.md @@ -344,6 +344,7 @@ For details see the [`values.yaml`](values.yaml) file. | `statefulset.resources` | Resource requests and limits for StatefulSet Pods | `{}` | | `statefulset.customLivenessProbe` | Custom Liveness probe | `{}` | | `statefulset.customReadinessProbe` | Custom Rediness probe | `{}` | +| `statefulset.terminationGracePeriodSeconds` | Termination grace period for CRDB statefulset pods | `300` | | `service.ports.grpc.external.port` | CockroachDB primary serving port in Services | `26257` | | `service.ports.grpc.external.name` | CockroachDB primary serving port name in Services | `grpc` | | `service.ports.grpc.internal.port` | CockroachDB inter-communication port in Services | `26257` | @@ -383,6 +384,7 @@ For details see the [`values.yaml`](values.yaml) file. | `init.nodeSelector` | Node labels for init Job Pod assignment | `{}` | | `init.tolerations` | Node taints to tolerate by init Job Pod | `[]` | | `init.resources` | Resource requests and limits for the `cluster-init` container | `{}` | +| `init.terminationGracePeriodSeconds` | Termination grace period for CRDB init job | `300` | | `tls.enabled` | Whether to run securely using TLS certificates | `no` | | `tls.serviceAccount.create` | Whether to create a new RBAC service account | `yes` | | `tls.serviceAccount.name` | Name of RBAC service account to use | `""` | diff --git a/cockroachdb/templates/job.init.yaml b/cockroachdb/templates/job.init.yaml index e6ec412a..dbc1eaa1 100644 --- a/cockroachdb/templates/job.init.yaml +++ b/cockroachdb/templates/job.init.yaml @@ -49,7 +49,7 @@ spec: {{- end }} {{- end }} restartPolicy: OnFailure - terminationGracePeriodSeconds: 300 + terminationGracePeriodSeconds: {{ .Values.init.terminationGracePeriodSeconds }} {{- if or .Values.image.credentials (and .Values.tls.enabled .Values.tls.selfSigner.image.credentials (not .Values.tls.certs.provided) (not .Values.tls.certs.certManager)) }} imagePullSecrets: {{- if .Values.image.credentials }} diff --git a/cockroachdb/templates/statefulset.yaml b/cockroachdb/templates/statefulset.yaml index a627c351..190d931a 100644 --- a/cockroachdb/templates/statefulset.yaml +++ b/cockroachdb/templates/statefulset.yaml @@ -148,7 +148,7 @@ spec: {{- end }} # No pre-stop hook is required, a SIGTERM plus some time is all that's # needed for graceful shutdown of a node. - terminationGracePeriodSeconds: 300 + terminationGracePeriodSeconds: {{ .Values.init.terminationGracePeriodSeconds }} containers: - name: db image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/cockroachdb/values.yaml b/cockroachdb/values.yaml index 44f79d41..92a3d833 100644 --- a/cockroachdb/values.yaml +++ b/cockroachdb/values.yaml @@ -248,6 +248,9 @@ statefulset: # cpu: 100m # memory: 512Mi + # terminationGracePeriodSeconds is the duration in seconds the Pod needs to terminate gracefully. + terminationGracePeriodSeconds: 300 + # Custom Liveness probe # https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-http-request customLivenessProbe: {} @@ -422,6 +425,9 @@ init: # cpu: "10m" # memory: "128Mi" + # terminationGracePeriodSeconds is the duration in seconds the Pod needs to terminate gracefully. + terminationGracePeriodSeconds: 300 + securityContext: enabled: true