tidb-operator
tidb-operator copied to clipboard
validate storageVolumes field and fail the tc update if new volumn is added
Feature Request
Is your feature request related to a problem? Please describe:
- create a tc without
tidb.storageVolumes
tidb:
baseImage: pingcap/tidb
replicas: 1
service:
type: ClusterIP
config: {}
# storageVolumes:
# - name: log
# storageSize: "2Gi"
# mountPath: "/var/log/tidblog"
- uncomment the
storageVolumespart and apply again(try to add storageVolumes) - tidb pod is terminated and no new pod created.
k describe sts
output:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulDelete 21m (x3 over 6d23h) statefulset-controller delete Pod uat-tidb-tidb-0 in StatefulSet uat-tidb-tidb successful
Warning FailedCreate 10m (x18 over 21m) statefulset-controller create Pod uat-tidb-tidb-0 in StatefulSet uat-tidb-tidb failed error: Pod "uat-tidb-tidb-0" is invalid: spec.containers[1].volumeMounts[4].name: Not found: "tidb-log"
[root@72 PingCAP-master]#
this is caused by StatefulSet.Spec.VolumeClaimTemplates can not be updated
Describe the feature you'd like:
validate the tc and failed to update if new volumn is added
Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy:
/assign