JohnFreeman1212
JohnFreeman1212

Reputation: 145

How to add an ephemeral disk to kubernetes pod?

I need to create an ephemeral disk to get more storage for our jenkins pipeline. This is the try for the pod configuration in the .yaml-File (only one section, since the rest works). What is wrong here? I tried to follow this but must have made a mistake: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/

  containers:
    - name: cont
      volumeMounts:
      - mountPath: /extra-disk
        name: extra-disk
  volumes:
    - name: extra-disk
      ephemeral:
        volumeClaimTemplate:
          metadata:
            labels:
              type: cloudbees-ssd
          spec:
            accessModes: [ "ReadWriteOnce" ]
            storageClassName: "cloudbees-ssd"
            resources:
              requests:
                storage: 200Gi

Error message: persistentvolumeclaim "cont-xxx-extra-disk" not found.

Upvotes: 1

Views: 941

Answers (1)

Gabriel Robledo Ahumada
Gabriel Robledo Ahumada

Reputation: 1701

The Generic ephemeral volumes feature is stable starting in Kubernetes v1.23.

If you want to implement it on any prior version, you can stumble into these kinds of errors.

Upvotes: 1

Related Questions