cockroachdb / docs

CockroachDB user documentation
https://cockroachlabs.com/docs
Creative Commons Attribution 4.0 International
187 stars 453 forks source link

Kubernetes tutorials: Make cluster start commands CRDB version-specific #7728

Open dbist opened 4 years ago

dbist commented 4 years ago

Artem Ervits (dbist) commented:

Re: Orchestrate CockroachDB in a Single Kubernetes Cluster

Issue Description

specifically in V19.2.9 and possibly below versions, following the procedure as advertised will install CockroachDB 20.1.3 or higher depending on the version of the current helm chart. To pin v19.2.9 version of the procedure to install the correct version of Cockroach, helm install command must include --set image.tag=v19.2.9 explicitly.

Suggested Resolution

change helm install command to helm install my-release --values my-values.yaml cockroachdb/cockroachdb --set image.tag=v19.2.9. This is also applicable to v19.1 versions, what worked for me was command helm install my-release --values my-values.yaml cockroachdb/cockroachdb --set image.tag=v19.1.11.

additionally, before client-secure.yaml file is applied to the cluster, it is imperative to edit that file with image tag matching the version of the cluster being deployed. The current file has v20.1.3. Editing the file and changing the image to image: cockroachdb/cockroach:v19.2.9 for v19.2 and image: cockroachdb/cockroach:v19.1.11 for 19.1.

I understand it breaks compatibility with hard-coded versions for previous releases but without that, there's no reason to version this procedure as it only works with the latest version of CockroachDB.

Jira Issue: DOC-589

jseldess commented 4 years ago

Good catch, @dbist. I don't think any of our k8s start instructions are version-specific, neither for helm nor for statefulset. The upgrade instructions, on the other hand, seem to handle version properly. For example, the helm instructions for upgrading to 19.1 are:

helm upgrade \
my-release \
cockroachdb/cockroachdb \
--set ImageTag=v19.1.0 \
--reuse-values

And the stateful set command for upgrading to 19.1 are:

kubectl patch statefulset cockroachdb --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"cockroachdb/cockroach:v19.1.0"}]'

I'm not sure why the version is 19.1.0 as I think we're auto-populating that based on doc configs. I think they should be 19.1.11 at this moment. In any case, we need to be explicit like that for cluster startup as well.

cc @taroface