Skip to content
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

StatefulSet's PodSpec should allow specifying volumeDevices #2572

Closed
jirislav opened this issue Aug 15, 2024 · 1 comment · Fixed by #2573
Closed

StatefulSet's PodSpec should allow specifying volumeDevices #2572

jirislav opened this issue Aug 15, 2024 · 1 comment · Fixed by #2573

Comments

@jirislav
Copy link
Contributor

Description

Since the schema of StatefulSet uses PodSpec under the hood, we should allow all the features of PodSpec to be used within the StatefulSet. But the support of volumeDevices is missing.

Potential Terraform Configuration

resource "kubernetes_stateful_set_v1" "ss-test" {

  metadata {
    name = "ss-test"
  }

  spec {
    replicas = 1

    selector {
      match_labels = {
        app = "ss-test"
      }
    }

    template {
      metadata {
        labels = {
          app = "ss-test"
        }
      }

      spec {
        container {
          name  = "ss-test"

          volume_mount {
            name       = "ss-test"
            mount_path = "/work-dir"
          }

          volume_device { # This is not supported, but should be
            name        = "ss-device-test"
            device_path = "/dev/xvda"
          }
        }
      }
    }

    volume_claim_template {
      metadata {
        name = "ss-test"
      }

      spec {
        access_modes = ["ReadWriteOnce"]
        resources {
          requests = {
            storage = "1Gi"
          }
        }
      }
    }

    volume_claim_template {
      metadata {
        name = "ss-device-test"
      }

      spec {
        access_modes = ["ReadWriteOnce"]
        volume_mode  = "Block"
        resources {
          requests = {
            storage = "1Gi"
          }
        }
      }
    }
  }
}

References

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
jirislav added a commit to jirislav/terraform-provider-kubernetes that referenced this issue Aug 15, 2024
jirislav added a commit to jirislav/terraform-provider-kubernetes that referenced this issue Aug 15, 2024
jirislav added a commit to jirislav/terraform-provider-kubernetes that referenced this issue Aug 16, 2024
@jirislav
Copy link
Contributor Author

jirislav commented Aug 16, 2024

Even though I have found it to be missing in StatefulSet, the PR #2573 implements it to all the resources that use PodSpec, namely:

  • StatefulSet
  • DaemonSet
  • Deployment
  • ReplicationController
  • CronJob
  • Job
  • Pod

@appilon appilon removed their assignment Aug 16, 2024
jirislav added a commit to jirislav/terraform-provider-kubernetes that referenced this issue Aug 22, 2024
jirislav added a commit to jirislav/terraform-provider-kubernetes that referenced this issue Sep 16, 2024
BBBmau added a commit that referenced this issue Sep 20, 2024
* Add VolumeDevices to PodSpec (#2572)

* Update changelog to include schema_container

---------

Co-authored-by: Mauricio Alvarez Leon <65101411+BBBmau@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants