tidb-operator icon indicating copy to clipboard operation
tidb-operator copied to clipboard

validate storageVolumes field and fail the tc update if new volumn is added

Open july2993 opened this issue 4 years ago • 1 comments

Feature Request

Is your feature request related to a problem? Please describe:

  1. 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"
  1. uncomment the storageVolumes part and apply again(try to add storageVolumes)
  2. 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:

july2993 avatar Apr 27 '21 09:04 july2993

/assign

mianhk avatar Dec 29 '21 07:12 mianhk