Skip to content

Commit

Permalink
Allow terminationGracePeriodSeconds to be configured via helm values (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
prafull01 authored Sep 20, 2024
1 parent 7696781 commit 950a699
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down Expand Up @@ -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 | `""` |
Expand Down
6 changes: 6 additions & 0 deletions build/templates/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions cockroachdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down Expand Up @@ -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 | `""` |
Expand Down
2 changes: 1 addition & 1 deletion cockroachdb/templates/job.init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion cockroachdb/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
6 changes: 6 additions & 0 deletions cockroachdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 950a699

Please sign in to comment.