Score
Capability
Volumes
Define volumes and volume mounts for a Workload.
Volume mounts are declared in the volumes
section of the Score file. There should be a resource of type volume
defined in your resource definitions,
see examples here
.
One trick is that the content of source
in the volume
section should only reference the name of the resource, not an output. For example: ${resources.my-volume}
.
score.yaml
(
view on GitHub
)
:
apiVersion: score.dev/v1b1
metadata:
name: my-workload
containers:
my-container:
image: .
volumes:
- source: ${resources.my-pvc}
target: /target/dir
- source: ${resources.my-ebs}
target: /ebs-target/dir
- source: ${resources.my-ephemeral-volume}
target: /tmp/dir
- source: ${resources.my-nfs}
target: /nfs-target/dir
resources:
my-pvc:
type: volume
my-ebs:
type: volume
class: ebs
my-ephemeral-volume:
type: volume
class: ephemeral
my-nfs:
type: volume
class: nfs