mayadata-io / mayadata-io/d-operators

proposal(sts): placement of volumes from a single statefulset

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

placement policy proposal statefulset
Dominant language
Go
Stars
10
Forks
6
PR merge metrics
No merged PRs in 30d

Description

ProblemStatement: A statefulset can be deployed with multiple replicas. In addition, each replica can be configured to use one or more persistent volumes. While due care can be taken to spread the statefulset application replicas across zones or nodes, similar strategy needs to be followed for these replicas' backing volume(s). It will be good to ensure these volumes are spread out & are never placed on a single node or single zone.

Possible Solution: Specific statefulsets can be watched (via k8s controllers) & their corresponding volume claims can be tracked. The volume claims can further be filtered based on the storage class. Once required details are achieved, these information can be saved in a new custom resource. This should ensure storage provisioners to run through their volume placement decisions.

# This custom resource will select statefulset whose volume info need
# to tracked & saved
kind: StatefulsetVolumePolicy
spec:
   # select a StatefulSet based on following criterias
   select:
     matchLabels:
     matchAnnotations:
     matchFields:
   placement:
     # spread will spread the volumes across zones or across hosts or
     # will get placed based on corresponding application pods
     spread: # Zone, Host, Pod
     # topology can be used to further determine which zones, hosts, etc
     # these volumes should get placed
     topology:
       hosts:
       - host 2
       - host 3
kind: VolumeGroup
spec:
   refer:
      kind: StatefulSet
      apiVersion: apps/v1
      name: my-sts
      namespace: my-ns
  volumes:
  - pvcName:
    podName:
    podNodeName:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the repository's existing Kubernetes controller and metacontroller patterns, then compare them with StatefulSet, PVC, pod, node, and topology behavior. The proposed StatefulsetVolumePolicy and VolumeGroup resources need a concrete scope, reconciliation behavior, and acceptance criteria before implementation can be considered done.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.