Skip to content

Commit 7403e57

Browse files
committed
[CC-33024] Remove the deprecated fields of CockroachDB operator
1 parent c8e9ad4 commit 7403e57

File tree

16 files changed

+208
-245
lines changed

16 files changed

+208
-245
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [cockroachdb-parent-25.3.3-preview+1] 2025-10-29
6+
- Remove the deprecated fields and start using the podTemplate fields. Following fields are deprecated:
7+
- cockroachdb.crdbcluster.resources
8+
- cockroachdb.crdbcluster.podLabels
9+
- cockroachdb.crdbcluster.env
10+
- cockroachdb.crdbcluster.topologySpreadConstraints
11+
- cockroachdb.crdbcluster.podAnnotations
12+
- cockroachdb.crdbcluster.nodeSelector
13+
- cockroachdb.crdbcluster.affinity
14+
- cockroachdb.crdbcluster.tolerations
15+
- Add WAL failover custom path support in CockroachDB operator.
16+
- Add virtual cluster support in CockroachDB operator
17+
518
## [cockroachdb-parent-25.3.0-preview] - 2025-08-26
619
### Added
720
- `loggingConfigVars` field for supporting multiple environment configuration variables in the `loggingConfigMap`.

build/templates/cockroachdb-parent/charts/cockroachdb/values.yaml

Lines changed: 78 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,6 @@ cockroachdb:
168168
clusterSettings: ~
169169
# timestamp captures the annotation timestamp used for rolling restarts.
170170
timestamp: "2021-10-18T00:00:00Z"
171-
# resources captures the resource requests and limits for CockroachDB pods.
172-
resources: ~
173-
# limits:
174-
# cpu: 4000m
175-
# memory: 16Gi
176-
# requests:
177-
# cpu: 4000m
178-
# memory: 16Gi
179171
# dataStore captures the disk configuration for CockroachDB storage.
180172
dataStore:
181173
# volumeClaimTemplate captures the PVC template for storage.
@@ -282,16 +274,13 @@ cockroachdb:
282274
# storageClassName: ""
283275
#
284276
# path is the absolute mount path inside the CockroachDB container to use for WAL failover side disk.
285-
# Examples:
277+
# Examples:
286278
# - /cockroach/cockroach-failover
287279
# - /cockroach/custom/path
288280
# IMPORTANT: Set it only for fresh deployments. Changing it on upgrades might cause issues with the deployment.
289281
#
290282
# path: "/cockroach/cockroach-failover"
291283
#
292-
# podLabels captures additional labels to apply to CockroachDB pods.
293-
podLabels:
294-
app.kubernetes.io/component: cockroachdb
295284
# startFlags specify the flags that will be used for starting the cluster.
296285
# Any flag defined in here will take precedence over the first-class
297286
# fields responsible for setting the same flags.
@@ -303,25 +292,8 @@ cockroachdb:
303292
# # omit defines a set of flags which will be omitted from the start command.
304293
# omit:
305294
# - ""
306-
# env captures environment variables set on CockroachDB pods.
307-
env: []
308-
# - name: APP_NAME
309-
# value: "CRDB"
310-
# - name: POD_NAME
311-
# valueFrom:
312-
# fieldRef:
313-
# fieldPath: metadata.name
314295
# rollingRestartDelay specifies the delay between rolling restarts of CockroachDB pods.
315296
rollingRestartDelay: 30s
316-
# topologySpreadConstraints captures pod topology spread constraints.
317-
# It is recommended to spread CockroachDB pods across zones to ensure high availability.
318-
topologySpreadConstraints:
319-
# maxSkew defines the degree to which the pods can be unevenly distributed.
320-
- maxSkew: 1
321-
# topologyKey defines the key for topology spread.
322-
topologyKey: topology.kubernetes.io/zone
323-
# whenUnsatisfiable defines the behavior when constraints cannot be met.
324-
whenUnsatisfiable: DoNotSchedule
325297
# service captures the Kubernetes Service configurations for CockroachDB pods.
326298
service:
327299
# ports captures the service port definitions.
@@ -368,43 +340,6 @@ cockroachdb:
368340
ingressClassName: ""
369341
annotations: {}
370342
host: ""
371-
# podAnnotations captures annotations to apply to CockroachDB pods.
372-
podAnnotations: {}
373-
# terminationGracePeriod determines the time available to CockroachDB for graceful drain.
374-
# It follows the metav1.Duration format, e.g., "300s", "5m" or "1h".
375-
# terminationGracePeriod: "300s"
376-
# nodeSelector captures the node selector labels for scheduling pods.
377-
nodeSelector: {}
378-
# affinity captures scheduling affinity rules for CockroachDB pods.
379-
affinity:
380-
# nodeAffinity:
381-
# requiredDuringSchedulingIgnoredDuringExecution:
382-
# nodeSelectorTerms:
383-
# - matchExpressions:
384-
# - key: kubernetes.io/os
385-
# operator: In
386-
# values:
387-
# - linux
388-
# podAffinity:
389-
# requiredDuringSchedulingIgnoredDuringExecution:
390-
# - labelSelector:
391-
# matchExpressions:
392-
# - key: security
393-
# operator: In
394-
# values:
395-
# - S1
396-
# topologyKey: topology.kubernetes.io/zone
397-
# podAntiAffinity:
398-
# preferredDuringSchedulingIgnoredDuringExecution:
399-
# - weight: 100
400-
# podAffinityTerm:
401-
# labelSelector:
402-
# matchExpressions:
403-
# - key: security
404-
# operator: In
405-
# values:
406-
# - S2
407-
# topologyKey: topology.kubernetes.io/zone
408343
#
409344
# sideCars captures the configuration for sidecar containers.
410345
sideCars:
@@ -414,8 +349,6 @@ cockroachdb:
414349
containers: []
415350
# volumes captures additional volumes for CockroachDB pods.
416351
volumes: []
417-
# tolerations captures the tolerations for scheduling CockroachDB pods.
418-
tolerations: []
419352
# localityLabels captures labels used to determine node locality.
420353
# It is an ordered, comma-separated list of keys that which must be present as labels on the nodes.
421354
# For region and zone to be part of the locality, the labels (topology.kubernetes.io/region, topology.kubernetes.io/region) must be set on the nodes.
@@ -470,23 +403,83 @@ cockroachdb:
470403
# podTemplate is an optional pod specification that overrides the default pod specification configured by the operator.
471404
# If specified, podTemplate is merged with the default pod specification, with settings in podTemplate taking precedence.
472405
# This can be used to add or update containers, volumes, and other settings of the CockroachDB pod.
473-
podTemplate: {}
474-
# # metadata captures the pod metadata for CockroachDB pods.
475-
# metadata: {}
476-
# # spec captures the pod specification for CockroachDB pods.
477-
# spec:
478-
# # initContainers captures the list of init containers for CockroachDB pods.
479-
# initContainers:
480-
# - name : cockroachdb-init
481-
# image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/init-container@sha256:c3e4ba851802a429c7f76c639a64b9152d206cebb31162c1760f05e98f7c4254
482-
# # containers captures the list of containers for CockroachDB pods.
483-
# containers:
484-
# - name: cockroachdb
485-
# image: cockroachdb/cockroach:v25.2.2
486-
# - name: cert-reloader
487-
# image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/inotifywait:87edf086db32734c7fa083a62d1055d664900840
488-
# # imagePullSecrets captures the secrets for fetching images from private registries.
489-
# imagePullSecrets: []
406+
podTemplate:
407+
# metadata captures the pod metadata for CockroachDB pods.
408+
metadata:
409+
labels:
410+
app.kubernetes.io/component: cockroachdb
411+
annotations: {}
412+
# spec captures the pod specification for CockroachDB pods.
413+
spec:
414+
# imagePullSecrets captures the secrets for fetching images from private registries.
415+
# imagePullSecrets: []
416+
# initContainers captures the list of init containers for CockroachDB pods.
417+
# initContainers:
418+
# - name : cockroachdb-init
419+
# image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/init-container@sha256:c3e4ba851802a429c7f76c639a64b9152d206cebb31162c1760f05e98f7c4254
420+
# containers captures the list of containers for CockroachDB pods.
421+
containers:
422+
- name: cockroachdb
423+
# env captures environment variables set on CockroachDB pods.
424+
env: []
425+
# - name: APP_NAME
426+
# value: "CRDB"
427+
# - name: POD_NAME
428+
# valueFrom:
429+
# fieldRef:
430+
# fieldPath: metadata.name
431+
resources: {}
432+
# image: cockroachdb/cockroach:v25.2.2
433+
# - name: cert-reloader
434+
# image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/inotifywait:87edf086db32734c7fa083a62d1055d664900840
435+
436+
# topologySpreadConstraints captures pod topology spread constraints.
437+
# It is recommended to spread CockroachDB pods across zones to ensure high availability.
438+
topologySpreadConstraints:
439+
# maxSkew defines the degree to which the pods can be unevenly distributed.
440+
- maxSkew: 1
441+
# topologyKey defines the key for topology spread.
442+
topologyKey: topology.kubernetes.io/zone
443+
# whenUnsatisfiable defines the behavior when constraints cannot be met.
444+
whenUnsatisfiable: DoNotSchedule
445+
# terminationGracePeriodSeconds determines the time available to CockroachDB for graceful drain.
446+
# terminationGracePeriodSeconds: 300
447+
# tolerations captures the tolerations for pods of the self-signer job.
448+
# https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
449+
# tolerations: []
450+
# nodeSelector captures the node selector labels for scheduling pods.
451+
# nodeSelector: {}
452+
# affinity captures scheduling affinity rules for CockroachDB pods.
453+
# affinity:
454+
# nodeAffinity:
455+
# requiredDuringSchedulingIgnoredDuringExecution:
456+
# nodeSelectorTerms:
457+
# - matchExpressions:
458+
# - key: kubernetes.io/os
459+
# operator: In
460+
# values:
461+
# - linux
462+
# podAffinity:
463+
# requiredDuringSchedulingIgnoredDuringExecution:
464+
# - labelSelector:
465+
# matchExpressions:
466+
# - key: security
467+
# operator: In
468+
# values:
469+
# - S1
470+
# topologyKey: topology.kubernetes.io/zone
471+
# podAntiAffinity:
472+
# preferredDuringSchedulingIgnoredDuringExecution:
473+
# - weight: 100
474+
# podAffinityTerm:
475+
# labelSelector:
476+
# matchExpressions:
477+
# - key: security
478+
# operator: In
479+
# values:
480+
# - S2
481+
# topologyKey: topology.kubernetes.io/zone
482+
#
490483

491484
# persistentVolumeClaimRetentionPolicy is used to Retain or Delete the PVCs when the node is deleted.
492485
# If not specified, the PVCs will be deleted when the node is deleted.

cockroachdb-parent/Chart.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
dependencies:
22
- name: operator
33
repository: file://charts/operator
4-
version: 25.3.4-preview
4+
version: 25.3.4-preview+1
55
- name: cockroachdb
66
repository: file://charts/cockroachdb
7-
version: 25.3.4-preview
8-
digest: sha256:3183216d170059cfb2f456d2bfacf8f4a5cd72cb0da9669e52545ac038111180
9-
generated: "2025-10-30T16:40:55.519890932Z"
7+
version: 25.3.4-preview+1
8+
digest: sha256:d0a6019097a776a1a0957da0d00639856a5d16a61b826fec25d184f5cfedcfc0
9+
generated: "2025-10-31T00:56:21.004226+05:30"

cockroachdb-parent/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ apiVersion: v2
33
name: cockroachdb-parent
44
description: A parent Helm chart for CockroachDB and its operator using helm-spray
55
type: application
6-
version: 25.3.4-preview
6+
version: 25.3.4-preview+1
77
appVersion: 25.3.4
88
dependencies:
99
- name: operator
10-
version: 25.3.4-preview
10+
version: 25.3.4-preview+1
1111
condition: operator.enabled
1212
repository: "file://charts/operator"
1313
- name: cockroachdb
14-
version: 25.3.4-preview
14+
version: 25.3.4-preview+1
1515
condition: cockroachdb.enabled
1616
repository: "file://charts/cockroachdb"

cockroachdb-parent/charts/cockroachdb/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
name: cockroachdb
44
home: https://www.cockroachlabs.com
5-
version: 25.3.4-preview
5+
version: 25.3.4-preview+1
66
appVersion: 25.3.4
77
description: CockroachDB is a scalable, survivable, strongly-consistent SQL database.
88
icon: https://raw.githubusercontent.com/cockroachdb/cockroach/master/docs/media/cockroach_db.png

cockroachdb-parent/charts/cockroachdb/templates/crdb.yaml

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
namespace: {{ .Release.Namespace }}
1010
labels:
1111
{{- include "cluster.labels" . | nindent 4 }}
12-
{{- with .Values.cockroachdb.crdbCluster.podLabels }}
12+
{{- with .Values.cockroachdb.crdbCluster.podTemplate.metadata.labels }}
1313
{{- toYaml . | nindent 4 }}
1414
{{- end }}
1515
{{- with .Values.k8s.labels }}
@@ -25,9 +25,6 @@ spec:
2525
{{- with .Values.cockroachdb.crdbCluster.regions }}
2626
regions: {{- toYaml . | nindent 4 }}
2727
{{- end }}
28-
features:
29-
- reconcile
30-
- reconcile-beta
3128
rollingRestartDelay: {{ .Values.cockroachdb.crdbCluster.rollingRestartDelay }}
3229
template:
3330
spec:
@@ -59,48 +56,12 @@ spec:
5956
{{- with .Values.cockroachdb.crdbCluster.walFailoverSpec }}
6057
walFailoverSpec: {{- toYaml . | nindent 8 }}
6158
{{- end }}
62-
env:
63-
- name: GODEBUG
64-
value: {{ include "godebugList" . }}
65-
{{- with .Values.cockroachdb.crdbCluster.env }}
66-
{{- toYaml . | nindent 8 }}
67-
{{- end }}
68-
{{- with .Values.cockroachdb.crdbCluster.topologySpreadConstraints }}
69-
topologySpreadConstraints: {{- toYaml . | nindent 8 }}
70-
{{- end }}
71-
{{- if .Values.cockroachdb.crdbCluster.terminationGracePeriod }}
72-
terminationGracePeriod: {{ .Values.cockroachdb.crdbCluster.terminationGracePeriod }}
73-
{{- end }}
74-
podLabels:
75-
app.kubernetes.io/name: {{ template "cockroachdb.name" . }}
76-
app.kubernetes.io/instance: {{ .Release.Name | quote }}
77-
{{- with .Values.cockroachdb.crdbCluster.podLabels }}
78-
{{- toYaml . | nindent 8 }}
79-
{{- end }}
80-
podAnnotations:
81-
helm.sh/restartedAt: {{ .Values.cockroachdb.crdbCluster.timestamp | quote }}
82-
{{- with .Values.cockroachdb.crdbCluster.podAnnotations }}
83-
{{- toYaml . | nindent 8 }}
84-
{{- end }}
85-
{{- with .Values.cockroachdb.crdbCluster.resources }}
86-
resourceRequirements: {{- toYaml . | nindent 8 }}
87-
{{- end }}
8859
{{- with .Values.cockroachdb.crdbCluster.localityLabels }}
8960
localityLabels: {{- toYaml . | nindent 8 }}
9061
{{- end }}
9162
{{- with .Values.cockroachdb.crdbCluster.localityMappings }}
9263
localityMappings: {{- toYaml . | nindent 8 }}
9364
{{- end }}
94-
{{- with .Values.cockroachdb.crdbCluster.tolerations }}
95-
tolerations: {{- toYaml . | nindent 8 }}
96-
{{- end }}
97-
{{- with .Values.cockroachdb.crdbCluster.nodeSelector }}
98-
nodeSelector: {{- toYaml . | nindent 8 }}
99-
{{- end }}
100-
{{- with .Values.cockroachdb.crdbCluster.affinity }}
101-
affinity: {{- toYaml . | nindent 8 }}
102-
{{- end }}
103-
serviceAccountName: {{ include "cockroachdb.serviceAccount.name" . }}
10465
{{- if .Values.cockroachdb.crdbCluster.loggingConfigMapName }}
10566
loggingConfigMapName: {{ .Values.cockroachdb.crdbCluster.loggingConfigMapName }}
10667
{{- end }}
@@ -123,7 +84,23 @@ spec:
12384
startFlags: {{- toYaml . | nindent 8 }}
12485
{{- end }}
12586
{{- with .Values.cockroachdb.crdbCluster.podTemplate }}
126-
podTemplate: {{- toYaml . | nindent 8 }}
87+
podTemplate:
88+
metadata:
89+
labels:
90+
app.kubernetes.io/name: {{ template "cockroachdb.name" $ }}
91+
app.kubernetes.io/instance: {{ $.Release.Name | quote }}
92+
{{- with .metadata.labels }}
93+
{{- toYaml . | nindent 12 }}
94+
{{- end }}
95+
annotations:
96+
helm.sh/restartedAt: {{ $.Values.cockroachdb.crdbCluster.timestamp | quote }}
97+
{{- with .metadata.annotations }}
98+
{{- toYaml . | nindent 12 }}
99+
{{- end }}
100+
spec:
101+
{{- $spec := deepCopy .spec }}
102+
{{- $_ := set $spec "serviceAccountName" (include "cockroachdb.serviceAccount.name" $) }}
103+
{{- toYaml $spec | nindent 12 }}
127104
{{- end }}
128105
{{- with .Values.cockroachdb.crdbCluster.persistentVolumeClaimRetentionPolicy }}
129106
persistentVolumeClaimRetentionPolicy: {{- toYaml . | nindent 8 }}

cockroachdb-parent/charts/cockroachdb/templates/service.public.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
selector:
3535
app.kubernetes.io/name: {{ template "cockroachdb.name" . }}
3636
app.kubernetes.io/instance: {{ .Release.Name | quote }}
37-
{{- with .Values.cockroachdb.crdbCluster.podLabels }}
37+
{{- with .Values.cockroachdb.crdbCluster.podTemplate.metadata.labels }}
3838
{{- toYaml . | nindent 4 }}
3939
{{- end }}
4040
# Cockroach Cloud operator doesn't provide a way to change the sql,grpc and http ports for the pods. Hence, making these

0 commit comments

Comments
 (0)