terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

Support `ReadWriteOncePod` for persistent volumes.

Open joey-squid opened this issue 2 years ago • 10 comments

Description

Support ReadWriteOncePod for persistent volumes.

Potential Terraform Configuration

Part of a stateful set for running Zookeeper (based on https://kubernetes.io/docs/tutorials/stateful-application/zookeeper/)

    volume_claim_template {
      metadata {
        name = "zookeeper-data-dir"
      }
      spec {
        access_modes = ["ReadWriteOnce"]
        resources {
          requests = {
            storage = "20Gi"
          }
        }
      }
    }

References

https://kubernetes.io/blog/2021/09/13/read-write-once-pod-access-mode-alpha/

(I'm not sure if this feature has hit production yet, but it's been available in at least alpha for a year and a half.)

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

joey-squid avatar Feb 09 '23 00:02 joey-squid

This looks like a one-liner to me (add to the validation function in resource_kubernetes_persistent_volume.go:90), but I don't have an environment I can test it in.

joey-squid avatar Feb 09 '23 00:02 joey-squid

Hello! Thank you for opening this issue @joey-squid, based on the current state of ReadOnceWritePod on the feature gate list, we will not be adding it just yet due to it still being in alpha.

This is also mentioned in our FAQ, in order to prevent any breaking changes we refrain from using features that are not in the beta stage

BBBmau avatar Feb 15 '23 15:02 BBBmau

Makes sense and thanks. I didn't know about that list, and thought it was already past alpha for some reason. Would you like me to close out this issue or leave it open for when it does hit beta?

joey-squid avatar Feb 15 '23 17:02 joey-squid

We'll leave this issue open for now until it hits beta. Thank you again!

BBBmau avatar Feb 16 '23 19:02 BBBmau

Looks like it hit beta in April

pbecotte avatar Nov 22 '23 03:11 pbecotte

@pbecotte I just checked the feature gates and you're right. They've moved it into beta with the release of 1.27 back in april!

@joey-squid With you being the original author of this issue, you are more than welcome to open a PR to help contribute with this! We can help along the way if guidance is needed. You can refer to the contribution guidelines for more help.

BBBmau avatar Dec 29 '23 00:12 BBBmau

Hi all and happy new year!

My company isn't using Terraform for k8s anymore, so I don't see myself making this PR. As I mentioned earlier, it's probably a very simple change, but I'll leave it to people who would actually use (and therefore test) it.

On Thu, Dec 28, 2023 at 4:08 PM Mauricio Alvarez Leon < @.***> wrote:

@pbecotte https://github.com/pbecotte I just checked the feature gates and you're right. They've moved it into beta with the release of 1.27 back in april!

@joey-squid https://github.com/joey-squid With you being the original author of this issue, you are more than welcome to open a PR to help contribute with this! We can help along the way if guidance is needed. You can refer to the contribution guidelines https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_about/CONTRIBUTING.md for more help.

— Reply to this email directly, view it on GitHub https://github.com/hashicorp/terraform-provider-kubernetes/issues/1992#issuecomment-1871636146, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3ZVAVOLBU52V7TD5ZFJZ73YLYCYNAVCNFSM6AAAAAAUV5N3MCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZRGYZTMMJUGY . You are receiving this because you were mentioned.Message ID: @.*** com>

joey-squid avatar Jan 16 '24 17:01 joey-squid

k8s 1.29 (released December 13, 2023) has ReadWriteOncePod as GA.

It's at the top of their graduations to stable list.

I just tried to use it and was surprised it wasn't recognized. Google brought me here.

Infinoid avatar Feb 11 '24 01:02 Infinoid

Just bumping this, would be good to see this implemented. Is it on the radar/roadmap?

kylemclaren avatar May 04 '24 14:05 kylemclaren

Hey I can take this issue up

aayushsss1 avatar May 14 '24 05:05 aayushsss1