Altinity / clickhouse-operator

Altinity Kubernetes Operator for ClickHouse creates, configures and manages ClickHouse clusters running on Kubernetes
https://altinity.com
Apache License 2.0
1.82k stars 449 forks source link

Does AWS PVC storage support online expansion without restarting the container? #946

Open chhan-coupang opened 2 years ago

chhan-coupang commented 2 years ago

AWS can re-scale EBS volumes, without shutting down the container upfront. So can we provide a way to control allowing for example Storage resources to modify the PVC directly without rebuilding the container?

For reference, vitess-operator handles it like this:

  updateStrategy:
    external:
      allowResourceChanges:
      - storage
    type: External

link: https://github.com/planetscale/vitess-operator/blob/main/docs/api.md#planetscale.com/v2.ExternalVitessClusterUpdateStrategyOptions

Thank you so much! Please let me know if you have any suggestions or concerns.

Slach commented 2 years ago

Currently, it is hard to implements for us

clickhouse-operator itself manage only Kind: StatefulSet resources and calculate settings and pvc settings hash and store it in labels inside statefulset.template.metadata, it requires re-create StatefulSet when we change volumeClaimTemplate

to leverage this downtime, we provide additional logic for remove replica from chi level and cluster level kind: Service resources endpoints and from <remote_servers>

chhan-coupang commented 2 years ago

Thanks Reply! I filed a PR #947 please check.

If this PR is lucky enough to be merged, do I need to add an option like Restart to control whether the feature is enabled or not e.g:

allowResourceChanges:
  type: array/string
  description: "Allow the specified resource to be updated directly and skip the restart of the container/statefulset"
  enum:
    - ""
    - "Storage"