Skip to content

Commit

Permalink
[stable/cockroachdb] Additional parameters for cockroachdb (helm#11747)
Browse files Browse the repository at this point in the history
* Add ExtraArgs and ExtraSecretMounts for additional configurability.

Signed-off-by: Niklas Voss <[email protected]>

* Bump version.

Signed-off-by: Niklas Voss <[email protected]>

* Updated README to include new values.

Signed-off-by: Niklas Voss <[email protected]>

* Removed blank line to avoid linting errors.

Signed-off-by: Niklas Voss <[email protected]>
  • Loading branch information
trevex authored and k8s-ci-robot committed Feb 28, 2019
1 parent 0fbf398 commit fbc9f1d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable/cockroachdb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cockroachdb
home: https://www.cockroachlabs.com
version: 2.0.11
version: 2.1.0
appVersion: 2.1.5
description: CockroachDB is a scalable, survivable, strongly-consistent SQL database.
icon: https://raw.githubusercontent.com/cockroachdb/cockroach/master/docs/media/cockroach_db.png
Expand Down
2 changes: 2 additions & 0 deletions stable/cockroachdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ The following table lists the configurable parameters of the CockroachDB chart a
| `Secure.ServiceAccount.Name` | Name of RBAC service account to use | `""` |
| `JoinExisting` | List of already-existing cockroach instances | `[]` |
| `Locality` | Locality attribute for this deployment | `""` |
| `ExtraArgs` | Additional command-line arguments | `[]` |
| `ExtraSecretMounts` | Additional secrets to mount at cluster members | `[]` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Expand Down
12 changes: 11 additions & 1 deletion stable/cockroachdb/templates/cockroachdb-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,18 @@ spec:
{{- if .Values.Secure.Enabled }}
- name: certs
mountPath: /cockroach/cockroach-certs
{{- end }}
{{- range .Values.ExtraSecretMounts }}
- name: extra-secret-{{ . }}
mountPath: /etc/cockroach/secrets/{{ . }}
readOnly: true
{{- end }}
command:
- "/bin/bash"
- "-ecx"
# The use of qualified `hostname -f` is crucial:
# Other nodes aren't able to look up the unqualified hostname.
- "exec /cockroach/cockroach start --logtostderr {{ if .Values.Secure.Enabled }}--certs-dir /cockroach/cockroach-certs{{ else }}--insecure{{ end }} --advertise-host $(hostname).${STATEFULSET_FQDN} --http-host 0.0.0.0 --http-port {{ .Values.InternalHttpPort }} --port {{ .Values.InternalGrpcPort }} --cache {{ .Values.CacheSize }} --max-sql-memory {{ .Values.MaxSQLMemory }} {{ if .Values.Locality }}--locality={{.Values.Locality }}{{ end }} --join {{ if .Values.JoinExisting }}{{ join "," .Values.JoinExisting }}{{ else }}${STATEFULSET_NAME}-0.${STATEFULSET_FQDN}:{{ .Values.InternalGrpcPort }},${STATEFULSET_NAME}-1.${STATEFULSET_FQDN}:{{ .Values.InternalGrpcPort }},${STATEFULSET_NAME}-2.${STATEFULSET_FQDN}:{{ .Values.InternalGrpcPort }}{{ end }}"
- "exec /cockroach/cockroach start --logtostderr {{ if .Values.Secure.Enabled }}--certs-dir /cockroach/cockroach-certs{{ else }}--insecure{{ end }} --advertise-host $(hostname).${STATEFULSET_FQDN} --http-host 0.0.0.0 --http-port {{ .Values.InternalHttpPort }} --port {{ .Values.InternalGrpcPort }} --cache {{ .Values.CacheSize }} --max-sql-memory {{ .Values.MaxSQLMemory }} {{ if .Values.Locality }}--locality={{.Values.Locality }}{{ end }} --join {{ if .Values.JoinExisting }}{{ join "," .Values.JoinExisting }}{{ else }}${STATEFULSET_NAME}-0.${STATEFULSET_FQDN}:{{ .Values.InternalGrpcPort }},${STATEFULSET_NAME}-1.${STATEFULSET_FQDN}:{{ .Values.InternalGrpcPort }},${STATEFULSET_NAME}-2.${STATEFULSET_FQDN}:{{ .Values.InternalGrpcPort }}{{ end }}{{ range .Values.ExtraArgs }} {{ . }}{{ end }}"
# No pre-stop hook is required, a SIGTERM plus some time is all that's
# needed for graceful shutdown of a node.
terminationGracePeriodSeconds: 60
Expand All @@ -306,6 +311,11 @@ spec:
{{- if .Values.Secure.Enabled }}
- name: certs
emptyDir: {}
{{- end }}
{{- range .Values.ExtraSecretMounts }}
- name: extra-secret-{{ . }}
secret:
secretName: {{ . }}
{{- end }}
podManagementPolicy: {{ .Values.PodManagementPolicy }}
updateStrategy:
Expand Down
4 changes: 4 additions & 0 deletions stable/cockroachdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ Secure:
JoinExisting: []
# Set a locality (e.g. "region=us-central1,datacenter=us-centra1-a") if you're doing multi-cluster so data is distributed properly
Locality: ""
# Additional command-line arguments you want to pass to the `cockroach start` commands
ExtraArgs: []
# ExtraSecretMounts is a list of names from secrets in the same namespace as the cockroachdb cluster, which shall be mounted into /etc/cockroach/secrets/ for every cluster member.
ExtraSecretMounts: []

0 comments on commit fbc9f1d

Please sign in to comment.