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

Expose status.capacity.storage kubernetes_persistent_volume_claim(_v1)

Open mindw opened this issue 10 months ago • 1 comments

Description

Some CSI implementations provision volume sizes which are different from the requested storage. For example OKE (Oracle Kubernetes Engine) rounds up the requested storage to 50Gi (as documented in https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengcreatingpersistentvolumeclaim_topic-Provisioning_PVCs_on_BV.htm) It would be useful to detect this condition for various purposes cost calculations, volume resizing decisions and so on).

Potential Terraform Configuration

data "kubernetes_persistent_volume_claim_v1" "self" {
  metadata {
    namespace = "monitoring"
    name      = "victoria-materics-single-server-0"    
  }
}

output "vm_volume_size" {
  value = data.kubernetes_persistent_volume_claim_v1.self.status_capacity_storage
}

References

None

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

mindw avatar Feb 01 '25 10:02 mindw