Skip to content

POC: Force writable image volumes using overlay filesystem#15

Draft
antoine-gaillard wants to merge 3 commits into
v2.1.3-ddfrom
agaillard/image-volume-writable
Draft

POC: Force writable image volumes using overlay filesystem#15
antoine-gaillard wants to merge 3 commits into
v2.1.3-ddfrom
agaillard/image-volume-writable

Conversation

@antoine-gaillard
Copy link
Copy Markdown

This is a proof-of-concept that makes all image volumes writable by:

  • Removing the readonly restriction check
  • Creating an overlay filesystem with:
    • Lower layer: Original read-only image content
    • Upper/Work layers: Writable directories for modifications
  • Setting the mount as non-readonly for containers

The changes are isolated per container through separate upper/work directories.

NOTE: This is a temporary POC implementation. Proper support requires:

  • Kubernetes API changes to support writable image volumes
  • Kubelet changes to pass the readonly flag correctly
  • Removal of the hardcoded forcing of writable mounts

Changes made:

  • Skip readonly validation for image volumes
  • Create overlay filesystem for each image mount
  • Update cleanup logic to handle overlay directory structure
  • Force Readonly=false on mount spec for containers

This is a proof-of-concept that makes all image volumes writable by:
- Removing the readonly restriction check
- Creating an overlay filesystem with:
  - Lower layer: Original read-only image content
  - Upper/Work layers: Writable directories for modifications
- Setting the mount as non-readonly for containers

The changes are isolated per container through separate upper/work directories.

NOTE: This is a temporary POC implementation. Proper support requires:
- Kubernetes API changes to support writable image volumes
- Kubelet changes to pass the readonly flag correctly
- Removal of the hardcoded forcing of writable mounts

Changes made:
- Skip readonly validation for image volumes
- Create overlay filesystem for each image mount
- Update cleanup logic to handle overlay directory structure
- Force Readonly=false on mount spec for containers
- Fix snapshot key to use lowerDir consistently
- Add tmpfs mounting for upper/work directories (4x image size, 256MB-32GB)
- Create overlay subdirectories within tmpfs mounts
- Add tmpfs cleanup in removal logic
Working writable image volumes with in-memory overlay.
Add debug logging and fix snapshot preparation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant