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

unable to add .spec.csi data to volumeclaimtemplates prevents use with StatefulSets #42

Closed
RevREB opened this issue May 1, 2019 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@RevREB
Copy link

RevREB commented May 1, 2019

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 1, 2019
@leakingtapan
Copy link
Contributor

AFAIK volumeclaimTemplates is used for creating multiple claims for provisioning new storage backends. I assume you are looking for reuse the same EFS filesystem for multiple pods in stateful set?

I tested it and it works. See the following spec as an example:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: efs-pv
spec:
  capacity:
    storage: 5Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: efs-sc
  csi:
    driver: efs.csi.aws.com
    volumeHandle: fs-4af69aab
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: efs-claim
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: efs-sc
  resources:
    requests:
      storage: 5Gi
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: efs-app-sts
spec:
  selector:
    matchLabels:
      app: test-efs # has to match .spec.template.metadata.labels
  serviceName: efs-app
  replicas: 3 # by default is 1
  template:
    metadata:
      labels:
        app: test-efs # has to match .spec.selector.matchLabels
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: linux
        image: amazonlinux:2 
        command: ["/bin/sh"]
        args: ["-c", "while true; do echo $(date -u) >> /efs-data/out.txt; sleep 5; done"]
        volumeMounts:
        - name: efs-storage
          mountPath: /efs-data
      volumes:
      - name: efs-storage
        persistentVolumeClaim:
          claimName: efs-claim

@leakingtapan
Copy link
Contributor

/close

@k8s-ci-robot
Copy link
Contributor

@leakingtapan: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

jsafrane pushed a commit to jsafrane/aws-efs-csi-driver that referenced this issue Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants