Skip to content

Declarative provisioning of node-local directories for sandbox HostPath mounts #121

Open

Description

@rcyw

Use case

An application running inside a sandbox may write SDK/runtime logs directly to files under a fixed container path, such as /app/logs. Operators need to bind a dedicated node-visible directory into that sandbox so a separately managed collector can read those files later. Similar requirements apply to exported artifacts and other explicitly shared node-local data.

The sandbox target path and the node-side source path are separate configuration choices. Creating a directory in a client or controller container does not prepare it on execution nodes. Without node-side preparation, sandbox mount setup can fail because the source directory is absent. This is a deployment precondition; it does not by itself establish a sandbox runtime defect.

Existing capability

The core Helm chart already provides node.initContainers and storage settings, and the node DaemonSet template exposes the home-disk volume at /home/akernel. Its backing storage can be a host directory or a generic ephemeral PVC.

An operator-supplied init container appears sufficient to prepare a dedicated subdirectory in this volume today. However, consumers would benefit from a supported configuration example and an explicit contract for ownership, startup, persistence, and cleanup. Please evaluate whether documenting and validating the existing extension point is sufficient, or whether a first-class declarative directory configuration belongs in the chart.

This proposal concerns deployment-time preparation. Mount authorization remains a separate requirement tracked in #110; provisioning a directory must not grant callers access to it. The public SDK on main currently exposes read-only OCI/S3 mounts, so this proposal does not assume a generally available public HostPath API.

Proposed scope

Support operator-declared directories on eligible execution nodes, with:

  • Explicit backing storage, source directory, UID/GID, and mode. For example, a dedicated directory under /home/akernel/shared/ could back an application's /app/logs; neither path should become a mandatory AKernel default.
  • Idempotent preparation before workloads depend on the directory, including after node Pod replacement. Define how existing directories and permission mismatches are handled, and surface preparation failures clearly. Avoid unconditional recursive ownership changes to existing application data.
  • A documented distinction between host-backed storage and generic ephemeral PVCs. State what survives sandbox deletion, node Pod replacement, and underlying node or volume loss; node-local storage does not imply durability across node loss.
  • Explicit retention and cleanup ownership. Sandbox deletion should not unexpectedly remove operator-owned data; operators or application integrations remain responsible for their selected retention policy.
  • Dedicated, appropriately isolated directories rather than exposing the entire node storage root to each sandbox. Directory creation must come from trusted deployment configuration, not arbitrary untrusted sandbox requests. Access must respect the server-side authorization boundary in Enforce server-side authorization for Local/HostPath mounts #110.
  • A documented checkpoint/restore contract for external mounts: identify whether these files are excluded from snapshots and verify the intended retention and continued-write behavior on supported runtimes. Collector offsets and delivery guarantees remain the collector's responsibility.

Acceptance criteria

  • Publish a supported Helm values example, or a dedicated configuration if needed, that provisions the declared directory on every eligible node before use.
  • Validate rendering and startup behavior, including an existing directory, incompatible permissions, and an unavailable backing volume.
  • Through an authorized mount integration, verify that sandbox file writes reach the intended backing directory and have the configured ownership/access behavior.
  • Verify sandbox cleanup and node Pod replacement against the documented retention contract, including the differences between host storage and ephemeral PVCs.
  • Document a separate checkpoint/restore validation for supported external mounts, without claiming exactly-once log delivery.
  • Preserve default behavior when directory provisioning is not configured.

Installing a particular log collector or configuring a vendor-specific ingestion service is outside this proposal. The goal is to establish the storage prerequisite so those integrations can be added independently.

Related: #110 (HostPath authorization) and #114 (controlled read-only host mounts). This proposal focuses on deployment provisioning and writable application-file storage requirements.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions