Skip to content

Adding volumes to StatefulSet after the initial creation #367

Description

@leochr

Kubernetes StatefulSet itself doesn't allow volumes to be added to StatefulSets after their initial creation.

Trying to add a volume, results in this error:
Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

The same limitation is encountered via operator.

  • create StatefulSet by setting:
spec:
  statefulSet: {}
  • try to add a volume to it
spec.
  statefulSet: 
    storage:
      size: 100Mi
      mountPath: /logs

Tasks:

  • understand the reasons behind StatefulSet not supporting
  • if it's not an anti-pattern to add volume afterwards, support adding it via operator. StatefulSet probably have to be deleted and recreated (meaning there will be some downtime)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions