OSSTeamEnterprise
File Operations
Control which files your local process reads and writes remotely
Last updated
Was this helpful?
Control which files your local process reads and writes remotely
By default, mirrord redirects most file access from your local process to the remote pod. When your code opens /etc/config/app.yaml, it reads the remote pod's copy. This means your local process sees the same configuration files, certificates, and data that the deployed application does.
Some paths, like language runtimes, package managers, and temp files, are always read locally. See the full default list for details.
mirrord supports three file system modes:
read (default)
Reads from remote, writes locally
You want remote config but don't want to risk writing to remote files
local
All file access stays local
You don't need any remote files
localwithoverrides
All file access local, except paths you specify
You need just a few specific remote files
{
"feature": {
"fs": {
"mode": "read"
}
}
}Use localwithoverrides when you only need a handful of remote files, for example a config file or TLS certificate:
{
"feature": {
"fs": {
"mode": "localwithoverrides",
"read_only": ["/etc/config/.*", "/var/secrets/.*"]
}
}
}Paths support regex patterns.
If your application writes to files that need to land on the remote filesystem (e.g. uploading to a shared volume), use read_write:
Be careful with remote writes. They modify the actual remote pod's filesystem.
If the default read mode pulls in remote files that conflict with your local setup (e.g. /tmp files, lock files), you can force them to stay local:
"My app reads config from a mounted ConfigMap" The default read mode handles this. Your local process will read the ConfigMap contents from the remote pod.
"My app writes logs to a file and I don't want them on the remote pod" Default read mode already writes locally. No change needed.
"I only need one remote config file, everything else should be local" Use localwithoverrides with the specific path.
For the full list of file operation settings, see the configuration reference. For a technical explanation of how file operations work under the hood, see the File Operations reference.
Last updated
Was this helpful?
Was this helpful?
{
"feature": {
"fs": {
"read_write": ["/mnt/shared/uploads/.*"]
}
}
}{
"feature": {
"fs": {
"local": ["/tmp/.*", ".*\\.lock"]
}
}
}
