Volume Mounts for Local Runs
Currently, runtime volumes defined in func.yaml are ignored when running functions locally with func run.
We should update pkg/docker/runner.go -> newHostConfig() to configure volumes in addition to the ports it currently defines.
- ConfigMap → Local
.func/run/configmaps/<name>directory - Secret → Local
.func/run/secrets/<name>directory - EmptyDir → Docker tmpfs or anonymous volume
- PersistentVolumeClaim → Named Docker volume or local directory
Additionally, we could consider adding a new volume type specifically for local development:
volumes:
- hostPath: /local/path
path: /container/path
Implementation Notes:
There should be warnings when defined resources are note available locally, but not fail.
Should disallow mapping of directories outside of .func for security (example risk: user downloads a malicious function, runs it locally, accessing sensitive areas of the FS and exfiltrating via the funciton source implementation)
Current Workarounds
- Use the "host" builder (loses container isolation)
- Run
func buildthen manuallydocker run -v local:container image - Deploy to a test cluster for volume testing
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
/assign
/unassign