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

Can not create a persistent volume claim with a storage class annotation #368

Closed
tdmalone opened this issue Mar 22, 2019 · 1 comment
Closed

Comments

@tdmalone
Copy link
Contributor

tdmalone commented Mar 22, 2019

Terraform Version

Terraform v0.11.13
+ provider.aws v1.60.0
+ provider.external v1.0.0
+ provider.http v1.0.1
+ provider.kubernetes v1.5.2
+ provider.null v2.1.0
+ provider.template v2.1.0

Affected Resource(s)

  • kubernetes_persistent_volume_claim

Terraform Configuration Files

(from https://github.com/kubernetes-incubator/external-storage/tree/master/aws/efs, converted to Terraform)

resource "kubernetes_persistent_volume_claim" "efs" {
  metadata {
    name = "efs"

    annotations = {
      "volume.beta.kubernetes.io/storage-class" = "${kubernetes_storage_class.aws_efs.metadata.0.name}"
    }
  }

  spec {
    access_modes = ["ReadWriteMany"]

    resources {
      request {
        storage = "1Mi"
      }
    }
  }
}

Expected Behavior

Volume claim resource should have been created.

Actual Behavior

Error: kubernetes_persistent_volume_claim.efs: metadata.0.annotations: "volume.beta.kubernetes.io/storage-class" is internal Kubernetes annotation

Steps to Reproduce

  1. Add the above configuration
  2. Run terraform apply

References

@tdmalone
Copy link
Contributor Author

Oops it appears volume.beta.kubernetes.io/storage-class has been deprecated anyway:
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class

The new way to reference this is the spec.storage_class_name attribute.

@ghost ghost locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant