Score

Capability

Volumes

Define volumes and volume mounts for a Workload.

Volume mounts are declared in the volumes section of the Score file.

Volumes that are not provisioned through the Humanitec Resources System, e.g. emptyDir, are declared in the volumes section of the Score extension file. For mounting them, specify volumes.<name>, as the source in the volume mount in the Score file.

Volumes that are provisioned through the Resources system are not declared in the Score or Score extension file. For mounting them, specify their Resource ID, e.g. shared.nfs-share, as the source in the volume mount in the Score file.

Refer to the volumes and volume-mounts features for configuration details.


humanitec.score.yaml (view on GitHub) :

apiVersion: humanitec.org/v1b1

spec:
  # Volume declaration. Not required if the volume mount
  # references an externally declared volume,
  # i.e. one provisioned via the Platform Orchestrator
  # Resources system.
  volumes:
    tmp-pod:
      type: emptyDir
      source:
        sizeLimit: "1024Mi"


score.yaml (view on GitHub) :

apiVersion: score.dev/v1b1
metadata:
  name: my-workload

containers:
  demo:
    image: registry/my-image:1.0.0
    # Volume mount declaration referencing the volume from the Score extension.
    volumes:
      - source: "volumes.tmp-pod"
        target: /mnt/data
        path: "" # Shown for illustration purposes. Must be a relative path.
        readOnly: true
Top