Skip to content

Commit f886c28

Browse files
committed
[CC-33024] Remove the deprecated fields of CockroachDB operator
1 parent b8f6c02 commit f886c28

File tree

16 files changed

+808
-741
lines changed

16 files changed

+808
-741
lines changed

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

Lines changed: 67 additions & 72 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.
@@ -276,9 +268,6 @@ cockroachdb:
276268
# If not set, the default provisioner will be chosen (gp2 on AWS, standard on GKE).
277269
# storageClassName: ""
278270
#
279-
# podLabels captures additional labels to apply to CockroachDB pods.
280-
podLabels:
281-
app.kubernetes.io/component: cockroachdb
282271
# startFlags specify the flags that will be used for starting the cluster.
283272
# Any flag defined in here will take precedence over the first-class
284273
# fields responsible for setting the same flags.
@@ -290,25 +279,8 @@ cockroachdb:
290279
# # omit defines a set of flags which will be omitted from the start command.
291280
# omit:
292281
# - ""
293-
# env captures environment variables set on CockroachDB pods.
294-
env: []
295-
# - name: APP_NAME
296-
# value: "CRDB"
297-
# - name: POD_NAME
298-
# valueFrom:
299-
# fieldRef:
300-
# fieldPath: metadata.name
301282
# rollingRestartDelay specifies the delay between rolling restarts of CockroachDB pods.
302283
rollingRestartDelay: 30s
303-
# topologySpreadConstraints captures pod topology spread constraints.
304-
# It is recommended to spread CockroachDB pods across zones to ensure high availability.
305-
topologySpreadConstraints:
306-
# maxSkew defines the degree to which the pods can be unevenly distributed.
307-
- maxSkew: 1
308-
# topologyKey defines the key for topology spread.
309-
topologyKey: topology.kubernetes.io/zone
310-
# whenUnsatisfiable defines the behavior when constraints cannot be met.
311-
whenUnsatisfiable: DoNotSchedule
312284
# service captures the Kubernetes Service configurations for CockroachDB pods.
313285
service:
314286
# ports captures the service port definitions.
@@ -355,43 +327,6 @@ cockroachdb:
355327
ingressClassName: ""
356328
annotations: {}
357329
host: ""
358-
# podAnnotations captures annotations to apply to CockroachDB pods.
359-
podAnnotations: {}
360-
# terminationGracePeriod determines the time available to CockroachDB for graceful drain.
361-
# It follows the metav1.Duration format, e.g., "300s", "5m" or "1h".
362-
# terminationGracePeriod: "300s"
363-
# nodeSelector captures the node selector labels for scheduling pods.
364-
nodeSelector: {}
365-
# affinity captures scheduling affinity rules for CockroachDB pods.
366-
affinity:
367-
# nodeAffinity:
368-
# requiredDuringSchedulingIgnoredDuringExecution:
369-
# nodeSelectorTerms:
370-
# - matchExpressions:
371-
# - key: kubernetes.io/os
372-
# operator: In
373-
# values:
374-
# - linux
375-
# podAffinity:
376-
# requiredDuringSchedulingIgnoredDuringExecution:
377-
# - labelSelector:
378-
# matchExpressions:
379-
# - key: security
380-
# operator: In
381-
# values:
382-
# - S1
383-
# topologyKey: topology.kubernetes.io/zone
384-
# podAntiAffinity:
385-
# preferredDuringSchedulingIgnoredDuringExecution:
386-
# - weight: 100
387-
# podAffinityTerm:
388-
# labelSelector:
389-
# matchExpressions:
390-
# - key: security
391-
# operator: In
392-
# values:
393-
# - S2
394-
# topologyKey: topology.kubernetes.io/zone
395330
#
396331
# sideCars captures the configuration for sidecar containers.
397332
sideCars:
@@ -401,8 +336,6 @@ cockroachdb:
401336
containers: []
402337
# volumes captures additional volumes for CockroachDB pods.
403338
volumes: []
404-
# tolerations captures the tolerations for scheduling CockroachDB pods.
405-
tolerations: []
406339
# localityLabels captures labels used to determine node locality.
407340
# It is an ordered, comma-separated list of keys that which must be present as labels on the nodes.
408341
# 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.
@@ -457,18 +390,80 @@ cockroachdb:
457390
# podTemplate is an optional pod specification that overrides the default pod specification configured by the operator.
458391
# If specified, podTemplate is merged with the default pod specification, with settings in podTemplate taking precedence.
459392
# This can be used to add or update containers, volumes, and other settings of the CockroachDB pod.
460-
podTemplate: {}
393+
podTemplate:
461394
# # metadata captures the pod metadata for CockroachDB pods.
462-
# metadata: {}
395+
metadata:
396+
labels:
397+
app.kubernetes.io/component: cockroachdb
398+
annotations: {}
463399
# # spec captures the pod specification for CockroachDB pods.
464-
# spec:
400+
spec:
465401
# # initContainers captures the list of init containers for CockroachDB pods.
466402
# initContainers:
467403
# - name : cockroachdb-init
468404
# image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/init-container@sha256:c3e4ba851802a429c7f76c639a64b9152d206cebb31162c1760f05e98f7c4254
469405
# # containers captures the list of containers for CockroachDB pods.
470-
# containers:
471-
# - name: cockroachdb
406+
containers:
407+
- name: cockroachdb
408+
# env captures environment variables set on CockroachDB pods.
409+
env: []
410+
# - name: APP_NAME
411+
# value: "CRDB"
412+
# - name: POD_NAME
413+
# valueFrom:
414+
# fieldRef:
415+
# fieldPath: metadata.name
416+
resources: {}
417+
# image: cockroachdb/cockroach:v25.2.2
418+
# - name: cert-reloader
419+
# image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/inotifywait:87edf086db32734c7fa083a62d1055d664900840
420+
# topologySpreadConstraints captures pod topology spread constraints.
421+
# It is recommended to spread CockroachDB pods across zones to ensure high availability.
422+
topologySpreadConstraints:
423+
# maxSkew defines the degree to which the pods can be unevenly distributed.
424+
- maxSkew: 1
425+
# topologyKey defines the key for topology spread.
426+
topologyKey: topology.kubernetes.io/zone
427+
# whenUnsatisfiable defines the behavior when constraints cannot be met.
428+
whenUnsatisfiable: DoNotSchedule
429+
# terminationGracePeriodSeconds determines the time available to CockroachDB for graceful drain.
430+
# terminationGracePeriodSeconds: 300
431+
# tolerations captures the tolerations for pods of the self-signer job.
432+
# https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
433+
# tolerations: []
434+
# nodeSelector captures the node selector labels for scheduling pods.
435+
# nodeSelector: {}
436+
# affinity captures scheduling affinity rules for CockroachDB pods.
437+
# affinity:
438+
# nodeAffinity:
439+
# requiredDuringSchedulingIgnoredDuringExecution:
440+
# nodeSelectorTerms:
441+
# - matchExpressions:
442+
# - key: kubernetes.io/os
443+
# operator: In
444+
# values:
445+
# - linux
446+
# podAffinity:
447+
# requiredDuringSchedulingIgnoredDuringExecution:
448+
# - labelSelector:
449+
# matchExpressions:
450+
# - key: security
451+
# operator: In
452+
# values:
453+
# - S1
454+
# topologyKey: topology.kubernetes.io/zone
455+
# podAntiAffinity:
456+
# preferredDuringSchedulingIgnoredDuringExecution:
457+
# - weight: 100
458+
# podAffinityTerm:
459+
# labelSelector:
460+
# matchExpressions:
461+
# - key: security
462+
# operator: In
463+
# values:
464+
# - S2
465+
# topologyKey: topology.kubernetes.io/zone
466+
#
472467
# image: cockroachdb/cockroach:v25.2.2
473468
# - name: cert-reloader
474469
# image: us-docker.pkg.dev/cockroach-cloud-images/data-plane/inotifywait:87edf086db32734c7fa083a62d1055d664900840

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)