diff --git a/stable/cockroachdb/Chart.yaml b/stable/cockroachdb/Chart.yaml index bb5b0cc50d..de46b4894d 100755 --- a/stable/cockroachdb/Chart.yaml +++ b/stable/cockroachdb/Chart.yaml @@ -1,6 +1,6 @@ name: cockroachdb home: https://www.cockroachlabs.com -version: 1.2.4 +version: 1.2.5 appVersion: 2.0.5 description: CockroachDB is a scalable, survivable, strongly-consistent SQL database. icon: https://raw.githubusercontent.com/cockroachdb/cockroach/master/docs/media/cockroach_db.png diff --git a/stable/cockroachdb/README.md b/stable/cockroachdb/README.md index 10a535383a..a6e180a7e9 100644 --- a/stable/cockroachdb/README.md +++ b/stable/cockroachdb/README.md @@ -64,6 +64,8 @@ The following table lists the configurable parameters of the CockroachDB chart a | `CacheSize` | Size of CockroachDB's in-memory cache | `25%` | | `MaxSQLMemory` | Max memory to use processing SQL queries | `25%` | | `ClusterDomain` | Cluster's default DNS domain | `cluster.local` | +| `JoinExisting` | List of already-existing cockroach instances | `[]` | +| `Locality` | Locality attribute for this deployment | `""` | | `NetworkPolicy.Enabled` | Enable NetworkPolicy | `false` | | `NetworkPolicy.AllowExternal` | Don't require client label for connections | `true` | | `Service.Type` | Public service type | `ClusterIP` | diff --git a/stable/cockroachdb/templates/cockroachdb-statefulset.yaml b/stable/cockroachdb/templates/cockroachdb-statefulset.yaml index 1cc1fa14cd..03df4bcde8 100644 --- a/stable/cockroachdb/templates/cockroachdb-statefulset.yaml +++ b/stable/cockroachdb/templates/cockroachdb-statefulset.yaml @@ -274,6 +274,8 @@ spec: env: - name: STATEFULSET_NAME value: "{{ printf "%s-%s" .Release.Name .Values.Name | trunc 56 }}" + - name: STATEFULSET_FQDN + value: "{{ printf "%s-%s" .Release.Name .Values.Name | trunc 56 }}.{{ .Release.Namespace }}.svc.{{ .Values.ClusterDomain }}" - name: COCKROACH_CHANNEL value: kubernetes-helm volumeMounts: @@ -288,7 +290,7 @@ spec: - "-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 -f) --http-host 0.0.0.0 --http-port {{ .Values.InternalHttpPort }} --port {{ .Values.InternalGrpcPort }} --cache {{ .Values.CacheSize }} --max-sql-memory {{ .Values.MaxSQLMemory }} --join ${STATEFULSET_NAME}-0.${STATEFULSET_NAME}:{{ .Values.InternalGrpcPort }},${STATEFULSET_NAME}-1.${STATEFULSET_NAME}:{{ .Values.InternalGrpcPort }},${STATEFULSET_NAME}-2.${STATEFULSET_NAME}:{{ .Values.InternalGrpcPort }}" + - "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 }}" # No pre-stop hook is required, a SIGTERM plus some time is all that's # needed for graceful shutdown of a node. terminationGracePeriodSeconds: 60 diff --git a/stable/cockroachdb/values.yaml b/stable/cockroachdb/values.yaml index 24b5c1c71c..7762870ebf 100644 --- a/stable/cockroachdb/values.yaml +++ b/stable/cockroachdb/values.yaml @@ -62,3 +62,9 @@ Secure: # The name of the service account to use. # If not set and create is true, a name is generated. Name: + +# If you are deploying a second cockroach instance that should join a first, use the below list to join to the existing instance. +# Each item in the array should be a FQDN (and port if needed) resolvable by the new pods. +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: ""