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 backing the volume.

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:
  demo:
    image: registry/my-image:1.0.0
    volumes:
      - source: ${resources.my-volume}
        target: /mnt/my-volume
        readOnly: true

resources:
  my-volume:
    type: volume
Top