score-spec / spec

The Score Specification provides a developer-centric and platform-agnostic Workload specification to improve developer productivity and experience. It eliminates configuration inconsistencies between environments.

Home Page:https://score.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEATURE] `emptyDir` `Volume` support

mathieu-benoit opened this issue · comments

Detailed description

Using an emptyDir Volume via my Score manifest is not supported today.

Context

Here is my Score manifest:

apiVersion: score.dev/v1b1
metadata:
  name: nginx
containers:
  nginx:
    image: nginxinc/nginx-unprivileged:latest
    volumes:
    - source: ${resources.tmp}
      target: /tmp
resources:
  tmp:
    type: emptyDir

I can deploy it in Humanitec, but there I'm getting this error attached:
image

Possible implementation

The associated Humanitec manifest generated has:

        "externals": {
          "tmp": {
            "type": "emptyDir"
          }
        }

I can see that there is a difference if I add this emptyDir via the UI where this section is instead under:

        "volumes": {
          "tmp": {
            "type": "emptyDir"
          }
        }

Additional information

Score specification reference - Reserved resource type.

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

As a workaround and if using Humanitec, you can use the Humanitec Score extension to achieve this, see example below:

apiVersion: humanitec.org/v1b1
profile: humanitec/default-module
spec:
  containers:
    nginx-secured:
      volume_mounts:
        /tmp:
          id: volumes.tmp
          read_only: false
  volumes:
    tmp:
      type: emptyDir