- 
                Notifications
    
You must be signed in to change notification settings  - Fork 41
 
          feat(stateful-set): allow configuring volumeClaimTemplates
          #6382
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
  
    feat(stateful-set): allow configuring volumeClaimTemplates
  
  #6382
              Conversation
4f352bb    to
    3461368      
    Compare
  
    volumeClaimTemplates to kplus.StatefulSetvolumeClaimTemplates
      | * | ||
| * This name should match the name of a volume mount in one of the containers. | ||
| */ | ||
| readonly name: string; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we accept a Volume here instead? or a VolumeMount?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would let it as it is. You could still use the volume as a variable and use name: volume.name, I would not use it like this.
I could also think about something like:
VolumeClaimTemplatesSomeSuffix.fromVolume(volume, {
  storage: Size.gibibytes(20),
  accessModes: [kplus.PersistentVolumeAccessMode.READ_WRITE_ONCE_POD],
  storageClassName: 'standard',
})But to be honest my absolute favourite would be something like:
new kplus.StatefulSet(chart, 'StatefulSet', {
  containers: [
    {
      image: 'foobar',
      portNumber: 80,
      volumeMounts: [
        {
          volume: Volume.fromClaimTemplate({
            name: "data",
            storage: Size.gibibytes(20),
            accessModes: [kplus.PersistentVolumeAccessMode.READ_WRITE_ONCE_POD],
            storageClassName: 'standard',
          }),
          path: '/mnt/data',
        },
      ],
    },
  ],
})There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like Volume.fromClaimTemplate - probably a bit more involved to implement. Don't want to block on it so i'm approving this one. Feel free to add it in a subsequent PR though as an enhancement.
002c2aa    to
    c245003      
    Compare
  
    Signed-off-by: Ben Keil <[email protected]>
Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18441834896 ------ *Automatically created by projen via the "upgrade-dev-dependencies-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18460692313 ------ *Automatically created by projen via the "upgrade-dev-dependencies-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18470006676 ------ *Automatically created by projen via the "upgrade-configuration-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18491339374 ------ *Automatically created by projen via the "upgrade-dev-dependencies-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18500936773 ------ *Automatically created by projen via the "upgrade-configuration-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18523663856 ------ *Automatically created by projen via the "upgrade-dev-dependencies-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18528151867 ------ *Automatically created by projen via the "upgrade-compiler-dependencies-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18533358066 ------ *Automatically created by projen via the "upgrade-configuration-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18556119076 ------ *Automatically created by projen via the "upgrade-dev-dependencies-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18560556728 ------ *Automatically created by projen via the "upgrade-compiler-dependencies-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Signed-off-by: Ben Keil <[email protected]>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdk8s-team/cdk8s-plus/actions/runs/18565712529 ------ *Automatically created by projen via the "upgrade-configuration-k8s-33-main" workflow* Signed-off-by: Ben Keil <[email protected]>
Signed-off-by: Ben Keil <[email protected]>
c245003    to
    e3bf4bb      
    Compare
  
    | 
           @benkeil looks good, you got some build failures though.  | 
    
Signed-off-by: Ben Keil <[email protected]>
| 
           @benkeil new failures :)  | 
    
Signed-off-by: Ben Keil <[email protected]>
Signed-off-by: Ben Keil <[email protected]>
| 
           wait until it runs in my fork  | 
    
| 
           ok, build was successful  | 
    
Fixes cdk8s-team/cdk8s#2183 (cherry picked from commit d9ccf66)
Fixes cdk8s-team/cdk8s#2183 (cherry picked from commit d9ccf66)
Fixes cdk8s-team/cdk8s#2183 (cherry picked from commit d9ccf66)
          💚 All backports created successfully
 Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details  | 
    
Fixes cdk8s-team/cdk8s#2183 (cherry picked from commit d9ccf66)
          💚 All backports created successfully
 Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details  | 
    
…#6382) (#6419) # Backport This will backport the following commits from `k8s-33/main` to `k8s-31/main`: - [feat(stateful-set): allow configuring `volumeClaimTemplates` (#6382)](#6382) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
…#6382) (#6420) # Backport This will backport the following commits from `k8s-33/main` to `k8s-32/main`: - [feat(stateful-set): allow configuring `volumeClaimTemplates` (#6382)](#6382) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
Fixes cdk8s-team/cdk8s#2183