Skip to content

Commit a0b0082

Browse files
committed
Add ability to change UpdateStrategy for StatefulSets
1 parent 040d489 commit a0b0082

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

charts/cartridge/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: v2
33
name: cartridge
44
description: Tarantool Cartridge application template.
55
type: application
6-
version: 1.0.0-rc1
6+
version: 1.0.0-rc2
77
appVersion: 2.7.6
88
kubeVersion: ">=1.16-0"
99
icon: https://static.tarantool.io/pub/220829-1248-ae7bca7/tarantool/images/logo-tarantool-full.svg

charts/cartridge/templates/roles.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ spec:
6363
{{- include "volumes.extraVolumeClaimTemplates" (dict "context" $ "volumeClaimTemplates" $.Values.tarantool.extraVolumeClaimTemplates) | indent 4 }}
6464
{{- end }}
6565
{{- end }}
66+
{{- $updateStrategy := (.updateStrategy | default $.Values.tarantool.updateStrategy) }}
67+
updateStrategy:
68+
type: {{ $updateStrategy.type | default $.Values.tarantool.updateStrategy.type }}
69+
rollingUpdate: {{ ($updateStrategy.rollingUpdate | default $.Values.tarantool.updateStrategy.rollingUpdate) | toYaml | nindent 8 }}
6670
podTemplate:
6771
metadata:
6872
labels:

charts/cartridge/values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ tarantool:
164164
stateboard:
165165
uri: ""
166166
password: ""
167+
# Update strategy
168+
updateStrategy:
169+
# Update strategy type
170+
# see: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
171+
type: OnDelete
172+
# Rolling Updates
173+
# see https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates
174+
rollingUpdate: {}
167175
# Roles config
168176
# Role is a resources that represent group of replicaset with custom config and set of vshard roles
169177
roles:
@@ -214,6 +222,14 @@ tarantool:
214222
resources:
215223
requests:
216224
storage: 1Gi
225+
# Update strategy
226+
updateStrategy:
227+
# Update strategy type
228+
# see: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
229+
type: OnDelete
230+
# Rolling Updates
231+
# see https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates
232+
rollingUpdate: {}
217233
# Override for tarantool.image, allows to use custom image for role
218234
image: {}
219235
# Override for tarantool.minReadySeconds

charts/tarantool-operator/crds/apiextensions.k8s.io_v1_customresourcedefinition_roles.tarantool.io.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6631,6 +6631,22 @@ spec:
66316631
default: 1
66326632
format: int32
66336633
type: integer
6634+
updateStrategy:
6635+
properties:
6636+
rollingUpdate:
6637+
properties:
6638+
maxUnavailable:
6639+
anyOf:
6640+
- type: integer
6641+
- type: string
6642+
x-kubernetes-int-or-string: true
6643+
partition:
6644+
format: int32
6645+
type: integer
6646+
type: object
6647+
type:
6648+
type: string
6649+
type: object
66346650
volumeClaimTemplates:
66356651
items:
66366652
properties:
@@ -6790,6 +6806,8 @@ spec:
67906806
type: object
67916807
type: object
67926808
type: array
6809+
required:
6810+
- updateStrategy
67936811
type: object
67946812
replicasets:
67956813
default: 1

0 commit comments

Comments
 (0)