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

Create kubernetes_persistent_volume_claim from snapshot #2608

Open
divomen opened this issue Oct 24, 2024 · 2 comments
Open

Create kubernetes_persistent_volume_claim from snapshot #2608

divomen opened this issue Oct 24, 2024 · 2 comments

Comments

@divomen
Copy link

divomen commented Oct 24, 2024

Description

Currently kubernetes_persistent_volume_claim does not allow to specify data source.
This prevents us from using terraform to automate volume backups.

Potential Terraform Configuration

resource "kubernetes_persistent_volume_claim" "default" {
  metadata {
    name = "my-pvc-clone"
  }
  spec {
    access_modes = ["ReadWriteOnce"]
    resources {
      requests = {
        storage = "1Gi"
      }
    }
    data_source {
      persistent_volume_claim {
        claim_name = "my-pvc-original"
      }
    }
  }
}

Сorresponding kubectl manifest

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc-clone
spec:
  dataSource:
    kind: PersistentVolumeClaim
    name: my-pvc-original
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

@BBBmau
Copy link
Contributor

BBBmau commented Oct 25, 2024

Looks like this was opened previously but wasn't worked on due to needing to support older k8s versions at the time. This isn't an issue now as it's been stable since v1.20

related issue: #1232

@JaylonmcShan03
Copy link
Contributor

@BBBmau I can take this on for Q4 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants