Type object
File match *.mirrord.json *.mirrord.toml *.mirrord.yaml *.mirrord.yml
Schema URL https://catalog.lintel.tools/schemas/schemastore/mirrord-config/latest.json
Source https://raw.githubusercontent.com/metalbear-co/mirrord/main/mirrord-schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

mirrord allows for a high degree of customization when it comes to which features you want to enable, and how they should function.

All of the configuration fields have a default value, so a minimal configuration would be no configuration at all.

The configuration supports templating using the Tera template engine. Currently we don't provide additional values to the context, if you have anything you want us to provide please let us know.

To use a configuration file in the CLI, use the -f <CONFIG_PATH> flag. Or if using VSCode Extension or JetBrains plugin, simply create a .mirrord/mirrord.json file or use the UI.

Examples

To help you get started, here are examples of a basic configuration file, and a complete configuration file containing all fields.

Basic config.json {#root-basic}

{
  "target": "pod/bear-pod",
  "feature": {
    "env": true,
    "fs": "read",
    "network": true
  }
}

Basic config.json with templating {#root-basic-templating}

{
  "target": "{{ get_env(name="TARGET", default="pod/fallback") }}",
  "feature": {
    "env": true,
    "fs": "read",
    "network": true
  }
}

Complete config.json {#root-complete}

Don't use this example as a starting point, it's just here to show you all the available options.

{
  "accept_invalid_certificates": false,
  "skip_processes": "ide-debugger",
  "target": {
    "path": "pod/bear-pod",
    "namespace": "default"
  },
  "connect_tcp": null,
  "agent": {
    "log_level": "info",
    "json_log": false,
    "labels": { "user": "meow" },
    "annotations": { "cats.io/inject": "enabled" },
    "namespace": "default",
    "image": "ghcr.io/metalbear-co/mirrord:latest",
    "image_pull_policy": "IfNotPresent",
    "image_pull_secrets": [ { "secret-key": "secret" } ],
    "ttl": 30,
    "ephemeral": false,
    "communication_timeout": 30,
    "startup_timeout": 360,
    "flush_connections": true,
    "metrics": "0.0.0.0:9000",
  },
  "feature": {
    "env": {
      "include": "DATABASE_USER;PUBLIC_ENV",
      "exclude": "DATABASE_PASSWORD;SECRET_ENV",
      "override": {
        "DATABASE_CONNECTION": "db://localhost:7777/my-db",
        "LOCAL_BEAR": "panda"
      },
      "mapping": {
        ".+_TIMEOUT": "1000"
      }
    },
    "fs": {
      "mode": "write",
      "read_write": ".+\\.json" ,
      "read_only": [ ".+\\.yaml", ".+important-file\\.txt" ],
      "local": [ ".+\\.js", ".+\\.mjs" ]
    },
    "network": {
      "incoming": {
        "mode": "steal",
        "http_filter": {
          "header_filter": "^baggage: .*mirrord-session={{ key }}.*$"
        },
        "port_mapping": [[ 7777, 8888 ]],
        "ignore_localhost": false,
        "ignore_ports": [9999, 10000]
      },
      "outgoing": {
        "tcp": true,
        "udp": true,
        "filter": {
          "local": ["tcp://1.1.1.0/24:1337", "1.1.5.0/24", "google.com", ":53"]
        },
        "ignore_localhost": false,
        "unix_streams": "bear.+"
      },
      "dns": {
        "enabled": true,
        "filter": {
          "local": ["1.1.1.0/24:1337", "1.1.5.0/24", "google.com"]
        }
      }
    },
    "copy_target": {
      "scale_down": false
    }
  },
  "operator": true,
  "kubeconfig": "~/.kube/config",
  "sip_binaries": "bash",
  "telemetry": true,
  "kube_context": "my-cluster"
}

Options {#root-options}

Properties

accept_invalid_certificates boolean | null

Controls whether or not mirrord accepts invalid TLS certificates (e.g. self-signed certificates).

If not provided, mirrord will use value from the kubeconfig.

agent AgentFileConfig | null
api boolean | null

Enables the local session monitor API server.

When enabled, mirrord exposes a Unix socket at ~/.mirrord/sessions/<session-id>.sock with HTTP endpoints for observing session activity in real time.

Defaults to true.

baggage string | null

OpenTelemetry (OTel) / W3C baggage propagator. This is used in HTTP requests sent to the operator to manually set values in the trace span, which can help when processing traces. See OTel docs

Only relevant for use with the operator. For more details, read the docs on monitoring.

ci CiFileConfig | null
container ContainerFileConfig | null
experimental ExperimentalFileConfig | null
external_proxy ExternalProxyFileConfig | null
feature FeatureFileConfig | null
internal_proxy InternalProxyFileConfig | null
key EnvKeyFileConfig | null

An identifier for a mirrord session.

This key can be referenced in your configuration using the {{ key }} template variable. The recommended use is to propagate it in W3C baggage or tracestate, then filter on mirrord-session={{ key }} in feature.network.incoming.http_filter.

Priority (highest to lowest):

  1. CLI argument: mirrord exec --key my-key
  2. Config file: { "key": "my-key" }
  3. Fallback: A unique key is randomly generated if neither option is provided
{
  "key": "my-session-key",
  "feature": {
    "network": {
      "incoming": {
        "http_filter": {
          "header_filter": "^baggage: .*mirrord-session={{ key }}.*$"
        }
      }
    }
  }
}
kube_context string | null

Kube context to use from the kubeconfig file. Will use current context if not specified.

{
  "kube_context": "mycluster"
}
kubeconfig string | null

Path to a kubeconfig file, if not specified, will use KUBECONFIG, or ~/.kube/config, or the in-cluster config.

{
  "kubeconfig": "~/bear/kube-config"
}
operator boolean | null

Whether mirrord should use the operator. If not set, mirrord will first attempt to use the operator, but continue without it in case of failure.

profile string | null

Name of the mirrord profile to use.

To select a cluster-wide profile

{
  "profile": "my-profile-name"
}

To select a namespaced profile

{
  "profile": "my-namespace/my-profile-name"
}
sip_binaries VecOrSingle | null

Binaries to patch (macOS SIP).

Use this when mirrord isn't loaded to protected binaries that weren't automatically patched.

Runs endswith on the binary path (so bash would apply to any binary ending with bash while /usr/bin/bash would apply only for that binary).

{
  "sip_binaries": ["bash", "python"]
}
skip_build_tools boolean | null

Allows mirrord to skip build tools. Useful when running command lines that build and run the application in a single command.

Defaults to true.

Build-Tools: ["as", "cc", "ld", "go", "air", "asm", "cc1", "cgo", "dlv", "gcc", "git", "link", "math", "cargo", "hpack", "rustc", "compile", "collect2", "cargo-watch", "debugserver"]

skip_extra_build_tools VecOrSingle | null

Allows mirrord to skip the specified build tools. Useful when running command lines that build and run the application in a single command.

Must also enable skip_build_tools for this to take an effect.

It's similar to skip_processes, except that here it also skips SIP patching.

Accepts a single value, or an array of values.

{
 "skip_extra_build_tools": ["bash", "node"]
}
skip_processes VecOrSingle | null

Allows mirrord to skip unwanted processes.

Useful when process A spawns process B, and the user wants mirrord to operate only on process B. Accepts a single value, or an array of values.

{
 "skip_processes": ["bash", "node"]
}
skip_sip VecOrSingle | null

Allows mirrord to skip patching (macOS SIP) unwanted processes.

When patching is skipped, mirrord will no longer be able to load into the process and its child processes.

Defaults to { "skip_sip": "git" }

When specified, the given value will replace the default list rather than being added to.

startup_retry StartupRetryFileConfig | null
target TargetFileConfig | null
telemetry boolean | null

Controls whether or not mirrord sends telemetry data to MetalBear cloud. Telemetry sent doesn't contain personal identifiers or any data that should be considered sensitive. It is used to improve the product. For more information

traceparent string | null

OpenTelemetry (OTel) / W3C trace context. This is used in HTTP requests sent to the operator to manually set the parent trace of the entry point, which can help when processing traces. See OTel docs

Only relevant for use with the operator. For more details, read the docs on monitoring.

use_proxy boolean | null

When disabled, mirrord will remove HTTP[S]_PROXY env variables before doing any network requests. This is useful when the system sets a proxy but you don't want mirrord to use it. This also applies to the mirrord process (as it just removes the env). If the remote pod sets this env, the mirrord process will still use it.

Definitions

AdvancedFsUserConfig object

Allows the user to specify the default behavior for file operations:

  1. "read" or true - Read from the remote file system (default)
  2. "write" - Read/Write from the remote file system.
  3. "local" or false - Read from the local file system.
  4. "localwithoverrides" - perform fs operation locally, unless the path matches a pre-defined or user-specified exception.

Note: by default, some paths are read locally or remotely, regardless of the selected FS mode. This is described in further detail below.

Besides the default behavior, the user can specify behavior for specific regex patterns. Case insensitive.

  1. "read_write" - List of patterns that should be read/write remotely.
  2. "read_only" - List of patterns that should be read only remotely.
  3. "local" - List of patterns that should be read locally.
  4. "not_found" - List of patterns that should never be read nor written. These files should be treated as non-existent.
  5. "mapping" - Map of patterns and their corresponding replacers. The replacement happens before any specific behavior as defined above or mode (uses Regex::replace)

The logic for choosing the behavior is as follows:

  1. Check against "mapping" if path needs to be replaced, if matched then continue to next step with new path after replacements otherwise continue as usual.

  2. Check if one of the patterns match the file path, do the corresponding action. There's no specified order if two lists match the same path, we will use the first one (and we do not guarantee what is first).

    Warning: Specifying the same path in two lists is unsupported and can lead to undefined behaviour.

  3. There are pre-defined exceptions to the set FS mode.

  4. Paths that match the pre-defined patterns for Linux/MacOS or for Windows are read locally by default.

  5. Paths that match the pre-defined patterns for Linux/MacOS or for Windows are read remotely by default when the mode is localwithoverrides.

  6. Paths that match the pre-defined patterns for Linux/MacOS or for Windows under the running user's home directory will not be found by the application when the mode is not local.

In order to override that default setting for a path, or a pattern, include it the appropriate pattern set from above. E.g. in order to read files under /etc/ remotely even though it is covered by the set of pre-defined patterns that are read locally by default, add "^/etc/." to the read_only set.

  1. If none of the above match, use the default behavior (mode).

For more information, check the file operations technical reference.

{
  "feature": {
    "fs": {
      "mode": "write",
      "read_write": ".+\\.json" ,
      "read_only": [ ".+\\.yaml", ".+important-file\\.txt" ],
      "local": [ ".+\\.js", ".+\\.mjs" ],
      "not_found": [ "\\.config/gcloud" ]
    }
  }
}
local VecOrSingle | null

Specify file path patterns that if matched will be opened locally.

mapping Record<string, string>

Specify map of patterns that if matched will replace the path according to specification.

Capture groups are allowed.

Example:

{
  "^/home/(?<user>\\S+)/dev/tomcat": "/etc/tomcat"
  "^/home/(?<user>\\S+)/dev/config/(?<app>\\S+)": "/mnt/configs/${user}-$app"
}

Will do the next replacements for any io operation

/home/johndoe/dev/tomcat/context.xml => /etc/tomcat/context.xml /home/johndoe/dev/config/api/app.conf => /mnt/configs/johndoe-api/app.conf

  • Relative paths: this feature (currently) does not apply mappings to relative paths, e.g. ../dev.
mode FsModeConfig | null
not_found VecOrSingle | null

Specify file path patterns that if matched will be treated as non-existent.

read_only VecOrSingle | null

Specify file path patterns that if matched will be read from the remote. if file matching the pattern is opened for writing or read/write it will be opened locally.

read_write VecOrSingle | null

Specify file path patterns that if matched will be read and written to the remote.

readonly_file_buffer integer | null

Sets buffer size for read-only remote files in bytes. By default, the value is 128000 bytes, or 128 kB.

Setting the value to 0 disables file buffering. Otherwise, read-only remote files will be read in chunks and buffered locally. This improves performance when the user application reads data in small portions.

format=uint64min=0
AgentFileConfig object

Configuration for the mirrord-agent pod that is spawned in the Kubernetes cluster.

Note: this configuration is ignored when using the mirrord Operator. Agent configuration is done by the cluster admin.

We provide sane defaults for this option, so you don't have to set up anything here.

{
  "agent": {
    "log_level": "info",
    "json_log": false,
    "namespace": "default",
    "image": "ghcr.io/metalbear-co/mirrord:latest",
    "image_pull_policy": "IfNotPresent",
    "image_pull_secrets": [ { "secret-key": "secret" } ],
    "ttl": 30,
    "ephemeral": false,
    "communication_timeout": 30,
    "startup_timeout": 360,
    "flush_connections": false,
    "exclude_from_mesh": false
    "inject_headers": false,
    "max_body_buffer_size": 65535,
    "max_body_buffer_timeout": 1000
  }
}
annotations Record<string, string>

Allows setting up custom annotations for the agent Job and Pod.

{
  "agent": {
    "annotations": {
      "cats.io/inject": "enabled"
      "prometheus.io/scrape": "true",
      "prometheus.io/port": "9000"
    }
  }
}
check_out_of_pods boolean | null

Determine if to check whether there is room for agent job in target node. (Not applicable when using ephemeral containers feature)

Can be disabled if the check takes too long and you are sure there is enough resources on each node

clean_iptables_on_start boolean | null

Clean leftover iptables rules and start the new agent instead of erroring out when there are existing mirrord rules in the target's iptables.

communication_timeout integer | null

Controls how long the agent lives when there are no connections.

Each connection has its own heartbeat mechanism, so even if the local application has no messages, the agent stays alive until there are no more heartbeat messages.

format=uint16min=0max=65535
disable_mesh_sidecar_injection boolean | null

Add relevant labels and annotations to agent pods/jobs to prevent service mesh sidecar injections. Defaults to true.

Only affects istio, linkerd, kuma.

disabled_capabilities array | null

If nothing is disabled here, agent uses:

  1. NET_ADMIN,
  2. SYS_PTRACE,
  3. SYS_ADMIN.

Has no effect when using the targetless mode, as targetless agent containers have no capabilities.

dns FileAgentDnsConfig | null
ephemeral boolean | null

Runs the agent as an ephemeral container.

Not compatible with targetless runs.

Defaults to false.

exclude_from_mesh boolean | null

When running the agent as an ephemeral container, use this option to exclude the agent's port from the service mesh sidecar proxy.

flush_connections boolean | null

Flushes existing connections when starting to steal, might fix issues where connections aren't stolen (due to being already established)

Defaults to true.

image AgentImageFileConfig | null

Name of the agent's docker image.

Useful when a custom build of mirrord-agent is required, or when using an internal registry.

Defaults to the latest stable image "ghcr.io/metalbear-co/mirrord:latest".

{
  "agent": {
    "image": "internal.repo/images/mirrord:latest"
  }
}

Complete setup:

{
  "agent": {
    "image": {
      "registry": "internal.repo/images/mirrord",
      "tag": "latest"
    }
  }
}

Can also be controlled via MIRRORD_AGENT_IMAGE, MIRRORD_AGENT_IMAGE_REGISTRY, and MIRRORD_AGENT_IMAGE_TAG. MIRRORD_AGENT_IMAGE takes precedence, followed by config values for registry/tag, then environment variables for registry/tag.

image_pull_policy string | null

Controls when a new agent image is downloaded.

Supports "IfNotPresent", "Always", "Never", or any valid kubernetes image pull policy

Defaults to "IfNotPresent"

image_pull_secrets array | null

List of secrets the agent pod has access to.

Takes an array of entries with the format { name: <secret-name> }.

Read more here.

{
  "agent": {
    "image_pull_secrets": [
      { "name": "secret-key-1" },
      { "name": "secret-key-2" }
    ]
  }
}
inject_headers boolean | null

Sets whether Mirrord-Agent headers are injected into HTTP responses that went through the agent.

Possible values for the header:

  • passed-through: set when the request was not sent to the local app (perhaps because it didn't match the filters)

  • forwarded-to-client: set when the request was sent to the local app

jaq_time_limit integer | null

Time limit for running jaq queries, in milliseconds. Defaults to 500ms.

format=uint64min=0
json_log boolean | null

Controls whether the agent produces logs in a human-friendly format, or json.

{
  "agent": {
    "json_log": true
  }
}
labels Record<string, string>

Allows setting up custom labels for the agent Job and Pod.

{
  "agent": {
    "labels": { "user": "meow", "state": "asleep" }
  }
}
log_level string | null

Log level for the agent.

Supports "trace", "debug", "info", "warn", "error", or any string that would work with RUST_LOG.

{
  "agent": {
    "log_level": "mirrord=debug,warn"
  }
}
max_body_buffer_size integer | null

Maximum size, in bytes, of HTTP request body buffers. Used for temporarily storing bodies of incoming HTTP requests to run body filters. HTTP body filters will not match any requests with bodies larger than this.

format=uint32min=0
max_body_buffer_timeout integer | null

Maximum timeout, in milliseconds, for receiving HTTP request bodies. HTTP body filters will not match any requests whose bodies do not arrive within this timeout.

format=uint32min=0
metrics string | null

Enables prometheus metrics for the agent pod.

You might need to add annotations to the agent pod depending on how prometheus is configured to scrape for metrics.

{
  "agent": {
    "metrics": "0.0.0.0:9000"
  }
}
namespace string | null

Namespace where the agent shall live.

Note: ignored in targetless runs or when the agent is run as an ephemeral container.

Defaults to the current kubernetes namespace.

nftables boolean | null

Determines which iptables backend will be used for traffic redirection.

If set to true, the agent will use iptables-nft. If set to false, the agent will use iptables-legacy. If not set, the agent will try to detect the correct backend at runtime.

node_selector Record<string, string>

Allows setting up custom node selector for the agent Pod. Applies only to targetless runs, as targeted agent always runs on the same node as its target container.

{
  "agent": {
    "node_selector": { "kubernetes.io/hostname": "node1" }
  }
}
priority_class string | null

Specifies the priority class to assign to the agent pod.

{
  "agent": {
    "priority_class": "my-priority-class-name"
  }
}

In some cases, the agent pod may fail to schedule due to node resource constraints. Setting a priority class allows you to explicitly assign an existing priority class from your cluster to the agent pod, increasing its priority relative to other workloads.

privileged boolean | null

Run the mirror agent as privileged container. Defaults to false.

Might be needed in strict environments such as Bottlerocket.

Has no effect when using the targetless mode, as targetless agent containers are never privileged.

Set pod resource requirements. (not with ephemeral agents) Default is

{
  "agent": {
    "resources": {
      "requests":
      {
        "cpu": "1m",
        "memory": "1Mi"
      },
      "limits":
      {
        "cpu": "100m",
        "memory": "100Mi"
      }
    }
  }
}
security_context SecurityContext | null

Agent pod security context (not with ephemeral agents). Support seccomp profile and app armor profile.

service_account string | null

Allows setting up custom Service Account for the agent Job and Pod.

{
  "agent": {
    "service_account": "my-service-account"
  }
}
startup_timeout integer | null

Controls how long to wait for the agent to finish initialization.

If initialization takes longer than this value, mirrord exits.

Defaults to 60.

format=uint64min=0
tolerations array | null

Set pod tolerations. (not with ephemeral agents).

Defaults to operator: Exists.

{
  "agent": {
    "tolerations": [
        {
          "key": "meow", "operator": "Exists", "effect": "NoSchedule"
        }
    ]
  }
}

Set to an empty array to have no tolerations at all

ttl integer | null

Controls how long the agent pod persists for after the agent exits (in seconds).

Can be useful for collecting logs.

Defaults to 1.

format=uint16min=0max=65535
AgentImageFileConfig string | null | object

Allows us to support the dual configuration for the agent image.

Whatever values missing are replaced with our defaults.

AgentPullSecret object

Specifies a secret reference for the agent pod.

name string required

Name of the secret.

AppleVariablesConfig object
BodyFilter object

Currently only JSON body filtering is supported.

BranchItemCopyConfig object

Shared copy config for individual items (tables, collections, etc.). All database engines use this same struct for per-item copy configuration.

filter string | null
CiFileConfig object

Configuration for mirrord for CI.

{
  "ci": {
    "output_dir": "/tmp/mirrord/",
  }
}
output_dir string | null

Path to a directory where mirrord ci will flush application's stdout and stderr.

Defaults to /tmp/mirrord/.

ConcurrentSteal string | string | string

(Operator Only): Allows overriding port locks

Can be set to either "continue" or "override".

  • "continue": Continue with normal execution
  • "override": If port lock detected then override it with new lock and force close the original locking connection.
ConnectionParamsConfig object

Connection parameters specified as individual environment variable names. The type field is optional - when omitted, the operator auto-detects whether the variable comes from env or envFrom on the target pod.

params object required

Individual database connection parameter sources. At least one parameter must be specified. Each parameter is either a plain string (env var name) or an object with secret and key.

5 nested properties
database ParamSource | null
host ParamSource | null
password ParamSource | null
port ParamSource | null
user ParamSource | null
type ConnectionSourceType | null
ConnectionParamsVars object

Individual database connection parameter sources. At least one parameter must be specified. Each parameter is either a plain string (env var name) or an object with secret and key.

database ParamSource | null
host ParamSource | null
password ParamSource | null
port ParamSource | null
user ParamSource | null
ConnectionSourceType string

The type of environment variable source for connection params.

ContainerFileConfig object

Unstable: mirrord container command specific config.

cli_extra_args array | null

Any extra args to use when creating the sidecar mirrord-cli container.

This is useful when you want to use portforwarding, passing -p local:container won't work for main command but adding them here will work

{
  "container": {
    "cli_extra_args": ["-p", "local:container"]
  }
}
cli_image string | null

Tag of the mirrord-cli image you want to use.

Defaults to "ghcr.io/metalbear-co/mirrord-cli:<cli version>".

cli_image_lib_path string | null

Path of the mirrord-layer lib inside the specified mirrord-cli image.

cli_prevent_cleanup boolean | null

Don't add --rm to sidecar command to prevent cleanup.

cli_tls_path string | null

When usingmirrord container with external_proxy TLS enabled (is enabled by default), you can specify the path where the certificate .pem file will be created, in the cli container.

Defaults to "/opt/mirrord/tls/mirrord-tls.pem".

override_host_ip string | null

Allows to override the IP address for the internal proxy to use when connecting to the host machine from within the container.

{
  "container": {
    "override_host_ip": "172.17.0.1" // usual resolution of value from `host.docker.internal`
  }
}

This should be useful if your host machine is exposed with a different IP address than the one bound as host.

  • If you're running inside WSL, and encountering problems, try setting external_proxy.host_ip to 0.0.0.0, and this to the internal container runtime address (for docker, this would be what host.docker.internal resolved to, which by default is 192.168.65.254). You can find this ip by resolving it from inside a running container, e.g. docker run --rm -it {image-with-nslookup} nslookup host.docker.internal
format=ip
platform string | null

Platform specification for the target container (e.g., "linux/amd64", "linux/arm64").

When specified, the target container will run with this platform, while the internal proxy container will still run on the native platform and contain both architectures (x64/arm64). The LD_PRELOAD will automatically use the correct architecture.

{
  "container": {
    "platform": "linux/amd64"
  }
}
ContainerRuntime string | string | string

Container runtimes supported by mirrord.

CopyTargetFileConfig boolean | object

Allows the user to target a pod created dynamically from the original target. The new pod inherits most of the original target's specification, e.g. labels.

See the copy target reference for more details.

Minimal copy_target config {#copy_target-minimal}

{
  "feature": {
    "copy_target": true
  }
}

Advanced copy_target config {#copy_target-advanced}

{
  "feature": {
    "copy_target": {
      "enabled": true,
      "scale_down": true,
      "exclude_containers": ["my-container"],
      "exclude_init_containers": ["my-init-container"]
    }
  }
}
CronJobTarget object
cron_job string required
container string | null
DatabaseBranchConfig object | object | object | object | object

Configuration for a database branch.

Example:

{
  "id": "my-branch-db",
  "name": "my-database-name",
  "ttl_secs": 120,
  "type": "mysql",
  "version": "8.0",
  "connection": {
    "url": {
      "type": "env",
      "variable": "DB_CONNECTION_URL"
    }
  }
}
DatabaseBranchesConfig DatabaseBranchConfig[]

A list of configurations for database branches.

Using a connection URL:

{
  "feature": {
    "db_branches": [
      {
        "type": "mysql",
        "connection": {
          "url": { "type": "env", "variable": "DB_CONNECTION_URL" }
        }
      }
    ]
  }
}

Using individual connection params:

{
  "feature": {
    "db_branches": [
      {
        "type": "mysql",
        "connection": {
          "type": "env",
          "params": { "host": "DB_HOST", "port": "DB_PORT", "database": "DB_NAME" }
        }
      }
    ]
  }
}
DbBranchingConnectionSource object | object | ConnectionParamsConfig

Different ways of connecting to the source database.

Accepts three formats:

Legacy URL (backward compatible):

{ "url": { "type": "env", "variable": "DB_CONNECTION_URL" } }

Flat URL:

{ "type": "env", "url": "DB_CONNECTION_URL" }

Individual connection params:

{ "type": "env", "params": { "host": "DB_HOST", "port": "DB_PORT", "user": "DB_USER", "password": "DB_PASSWORD", "database": "DB_NAME" } }

Individual connection params with password from a Kubernetes Secret:

{ "type": "env", "params": { "host": "DB_HOST", "password": { "secret": "my-secret", "key": "password" }, "database": "DB_NAME" } }
DbBranchingConnectionSourceKind object | object | object

Different ways to source the connection options.

Support:

  • env in the target's pod spec.
  • envFrom in the target's pod spec.
  • secret read directly from a Kubernetes Secret.
DeploymentTarget object

Mirror the deployment specified by [DeploymentTarget::deployment].

deployment string required

Deployment to mirror.

container string | null
DnsFileConfig object

Resolve DNS via the remote pod.

Defaults to true.

Mind that:

  • DNS resolving can be done in multiple ways. Some frameworks use getaddrinfo/gethostbyname functions, while others communicate directly with the DNS server at port 53 and perform a sort of manual resolution. Just enabling the dns feature in mirrord might not be enough. If you see an address resolution error, try enabling the fs feature, and setting read_only: ["/etc/resolv.conf"].
  • DNS filter currently works only with frameworks that use getaddrinfo/gethostbyname functions.
enabled boolean | null
filter DnsFilterConfig | null

Unstable: the precise syntax of this config is subject to change.

DnsFilterConfig object | object

List of addresses/ports/subnets that should be resolved through either the remote pod or local app, depending how you set this up with either remote or local.

You may use this option to specify when DNS resolution is done from the remote pod (which is the default behavior when you enable remote DNS), or from the local app (default when you have remote DNS disabled).

Takes a list of values, such as:

  • Only queries for hostname my-service-in-cluster will go through the remote pod.
{
  "remote": ["my-service-in-cluster"]
}
  • Only queries for addresses in subnet 1.1.1.0/24 with service port 1337 will go through the remote pod.
{
  "remote": ["1.1.1.0/24:1337"]
}
  • Only queries for hostname google.com with service port 1337 or 7331 will go through the remote pod.
{
  "remote": ["google.com:1337", "google.com:7331"]
}
  • Only queries for localhost with service port 1337 will go through the local app.
{
  "local": ["localhost:1337"]
}
  • Only queries with service port 1337 or 7331 will go through the local app.
{
  "local": [":1337", ":7331"]
}

Valid values follow this pattern: [name|address|subnet/mask][:port].

EnvFileConfig object

Allows the user to set or override the local process' environment variables with the ones from the remote pod.

Can be set to one of the options:

  1. false - Disables the feature, won't have remote environment variables.
  2. true - Enables the feature, will obtain remote environment variables.
  3. object - see below (means true + additional configuration).

Which environment variables to load from the remote pod are controlled by setting either include or exclude.

See the environment variables reference for more details.

{
  "feature": {
    "env": {
      "include": "DATABASE_USER;PUBLIC_ENV;MY_APP_*",
      "exclude": "DATABASE_PASSWORD;SECRET_ENV",
      "override": {
        "DATABASE_CONNECTION": "db://localhost:7777/my-db",
        "LOCAL_BEAR": "panda"
      },
      "mapping": {
        ".+_TIMEOUT": "1000"
      }
    }
  }
}
env_file string | null

Allows for passing environment variables from an env file.

These variables will override environment fetched from the remote target.

exclude VecOrSingle | null

Include the remote environment variables in the local process that are NOT specified by this option. Variable names can be matched using * and ? where ? matches exactly one occurrence of any character and * matches arbitrary many (including zero) occurrences of any character.

Some of the variables that are excluded by default: PATH, HOME, HOMEPATH, CLASSPATH, JAVA_EXE, JAVA_HOME, PYTHONPATH.

Can be passed as a list or as a semicolon-delimited string (e.g. "VAR;OTHER_VAR").

include VecOrSingle | null

Include only these remote environment variables in the local process. Variable names can be matched using * and ? where ? matches exactly one occurrence of any character and * matches arbitrary many (including zero) occurrences of any character.

Can be passed as a list or as a semicolon-delimited string (e.g. "VAR;OTHER_VAR").

Some environment variables are excluded by default (PATH for example), including these requires specifying them with include

load_from_process boolean | null

Allows for changing the way mirrord loads remote environment variables. If set, the variables are fetched after the user application is started.

This setting is meant to resolve issues when using mirrord via the IntelliJ plugin on WSL and the remote environment contains a lot of variables.

mapping Record<string, string>

Specify map of patterns that if matched will replace the value according to specification.

Capture groups are allowed.

Example:

{
  ".+_TIMEOUT": "10000"
  "LOG_.+_VERBOSITY": "debug"
  "(\w+)_(\d+)": "magic-value"
}

Will do the next replacements for environment variables that match:

  • CONNECTION_TIMEOUT: 500 => CONNECTION_TIMEOUT: 10000

  • LOG_FILE_VERBOSITY: info => LOG_FILE_VERBOSITY: debug

  • DATA_1234: common-value => DATA_1234: magic-value

override Record<string, string>

Allows setting or overriding environment variables (locally) with a custom value.

For example, if the remote pod has an environment variable REGION=1, but this is an undesirable value, it's possible to use override to set REGION=2 (locally) instead.

Environment specified here will also override variables passed via the env file.

unset VecOrSingle | null

Allows unsetting environment variables in the executed process.

This is useful for when some system/user-defined environment like AWS_PROFILE make the application behave as if it's running locally, instead of using the remote settings. The unsetting happens from extension (if possible)/CLI and when process initializes. In some cases, such as Go the env might not be able to be modified from the process itself. This is case insensitive, meaning if you'd put AWS_PROFILE it'd unset both AWS_PROFILE and Aws_Profile and other variations.

EnvKeyFileConfig string | null

File configuration for the session key.

In the config file, the key is simply an optional string. The resolution happens in [MirrordConfig::generate_config].

ExperimentalFileConfig object

mirrord Experimental features. This shouldn't be used unless someone from MetalBear/mirrord tells you to.

applev AppleVariablesConfig | null

Configuration for inspecting and modifying apple variables. macOS only.

browser_extension_config boolean | null

mirrord will open a URL for initiating mirrord browser extension to automatically inject HTTP header that matches the HTTP filter configured in feature.network.incoming.http_filter.header_filter.

disable_reuseaddr boolean | null

Disables the SO_REUSEADDR socket option on sockets that mirrord steals/mirrors. On macOS the application can use the same address many times but then we don't steal it correctly. This probably should be on by default but we want to gradually roll it out. https://github.com/metalbear-co/mirrord/issues/2819 This option applies only on macOS.

dlopen_cgo boolean | null

Useful when the user's application loads a c-shared golang library dynamically.

Defaults to false.

dns_permission_error_fatal boolean | null

Whether to terminate the session when a permission denied error occurs during DNS resolution. This error often means that the Kubernetes cluster is hardened, and the mirrord-agent is not fully functional without agent.privileged enabled.

Defaults to true

DEPRECATED, WILL BE REMOVED

enable_exec_hooks_linux boolean | null

Enables exec hooks on Linux. Enable Linux hooks can fix issues when the application shares sockets with child commands (e.g Python web servers with reload), but the feature is not stable and may cause other issues.

force_hook_connect boolean | null

Forces hooking all instances of the connect function. In very niche cases the connect function has multiple exports and this flag makes us hook all of the instances. https://linear.app/metalbear/issue/MBE-1385/mirrord-container-curl-doesnt-work-for-php-curl

Defaults to true

DEPRECATED, WILL BE REMOVED

hide_ipv6_interfaces boolean | null

Enables getifaddrs hook that removes IPv6 interfaces from the list returned by libc.

hook_rename boolean | null

Enables hooking the rename function.

Useful if you need file remapping and your application uses rename, i.e. php-fpm, twig, to create and rename temporary files.

DEPRECATED, WILL BE REMOVED

idle_local_http_connection_timeout integer | null

Sets a timeout for idle local HTTP connections (in milliseconds).

HTTP requests stolen with a filter are delivered to the local application from a HTTP connection made from the local machine. Once a request is delivered, the connection is cached for some time, so that it can be reused to deliver the next request.

This timeout determines for how long such connections are cached.

Set to 0 to disable caching local HTTP connections (connections will be dropped as soon as the request is delivered).

Defaults to 3000ms.

format=uint64min=0
ignore_system_proxy_config boolean | null

Disables any system wide proxy configuration for affecting the running application.

latency LatencyFileConfig | null

Configuration for adding artificial latency to outgoing network operations.

non_blocking_tcp_connect boolean | null

Enables better support for outgoing connections using non-blocking TCP sockets. For technical reasons, enabling this will cause getsockname to always return a localhost address.

Defaults to true in OSS. Defaults to false in mfT.

sip_log_destination string | null

Writes basic fork-safe SIP patching logs to a destination file. Useful for seeing the state of SIP when stdout may be affected by another process.

sip_utils boolean | null

Extract pre-built SIP utility binaries into ~/.mirrord/binaries on macOS and uses them in place of SIP-patching the originals. This shouldn't be used unless someone from MetalBear/mirrord tells you to.

Defaults to true in OSS. Defaults to false in mfT.

trust_any_certificate boolean | null

Enables trusting any certificate on macOS, useful for https://github.com/golang/go/issues/51991#issuecomment-2059588252

use_dev_null boolean | null

Uses /dev/null for creating local fake files (should be better than using /tmp)

ExternalProxyFileConfig object

Configuration for the external proxy mirrord spawns when using the mirrord container command. This proxy is used to allow the internal proxy running in sidecar to connect to the mirrord agent.

If you get ConnectionRefused errors, increasing the timeouts a bit might solve the issue.

{
  "external_proxy": {
    "start_idle_timeout": 30,
    "idle_timeout": 5
  }
}
host_ip string | null

Specify a custom host ip addr to listen on.

This address must be accessible from within the container. If not specified, mirrord will try and resolve a local address to use.

  • If you're running inside WSL, and encountering problems, try setting this to 0.0.0.0, and container.override_host_ip to the internal container runtime address (for docker, this would be what host.docker.internal resolved to, which by default is 192.168.65.254).
format=ip
idle_timeout integer | null

How much time to wait while we don't have any active connections before exiting.

Common cases would be running a chain of processes that skip using the layer and don't connect to the proxy.

{
  "external_proxy": {
    "idle_timeout": 30
  }
}
format=uint64min=0
json_log boolean | null

Whether the proxy should output logs in JSON format. If false, logs are output in human-readable format.

Defaults to true.

log_destination string | null

Set the log destination for the external proxy.

  1. If the provided path ends with a separator (/ on UNIX, \ on Windows), it will be treated as a path to directory where the log file should be created.
  2. Otherwise, if the path exists, mirrord will check if it's a directory or not.
  3. Otherwise, it will be treated as a path to the log file.

mirrord will auto create all parent directories.

Defaults to a randomized path inside the temporary directory.

log_level string | null

Set the log level for the external proxy.

The value should follow the RUST_LOG convention (i.e mirrord=trace).

Defaults to mirrord=info,warn.

start_idle_timeout integer | null

How much time to wait for the first connection to the external proxy in seconds.

Common cases would be running with dlv or any other debugger, which sets a breakpoint on process execution, delaying the layer startup and connection to the external proxy.

{
  "external_proxy": {
    "start_idle_timeout": 60
  }
}
format=uint64min=0
tls_enable boolean | null

Whether to use TLS or a plain TCP when accepting a connection from the internal proxy sidecar.

FeatureFileConfig object

Controls mirrord features.

See the technical reference, Technical Reference to learn more about what each feature does.

The env, fs and network options have support for a shortened version, that you can see here.

{
  "feature": {
    "env": {
      "include": "DATABASE_USER;PUBLIC_ENV",
      "exclude": "DATABASE_PASSWORD;SECRET_ENV",
      "override": {
        "DATABASE_CONNECTION": "db://localhost:7777/my-db",
        "LOCAL_BEAR": "panda"
      }
    },
    "fs": {
      "mode": "write",
      "read_write": ".+\\.json" ,
      "read_only": [ ".+\\.yaml", ".+important-file\\.txt" ],
      "local": [ ".+\\.js", ".+\\.mjs" ]
    },
    "network": {
      "incoming": {
        "mode": "steal",
        "http_filter": {
          "header_filter": "^baggage: .*mirrord-session={{ key }}.*$"
        },
        "port_mapping": [[ 7777, 8888 ]],
        "ignore_localhost": false,
        "ignore_ports": [9999, 10000]
      },
      "outgoing": {
        "tcp": true,
        "udp": true,
        "filter": {
          "local": ["tcp://1.1.1.0/24:1337", "1.1.5.0/24", "google.com", ":53"]
        },
        "ignore_localhost": false,
        "unix_streams": "bear.+"
      },
      "dns": false
    },
    "copy_target": false,
    "hostname": true
  }
}
copy_target CopyTargetFileConfig | null

Creates a new copy of the target. mirrord will use this copy instead of the original target (e.g. intercept network traffic). This feature requires a mirrord operator.

This feature is not compatible with rollout targets and running without a target (targetless mode).

db_branches DatabaseBranchesConfig | null

Configuration for the database branching feature.

env ToggleableConfig | null
fs ToggleableConfig2 | null
hostname boolean | null

Should mirrord return the hostname of the target pod when calling gethostname

magic MagicFileConfig | null

Sensible defaults that improve the experience for most users. Each flag can be disabled individually if it conflicts with your setup.

network ToggleableConfig3 | null
preview PreviewFileConfig | null

Configuration for preview environments.

split_queues SplitQueuesConfig | null

Define filters to split queues by, and make your local application consume only messages that match those filters. If you don't specify any filter for a queue that is however declared in the MirrordWorkloadQueueRegistry of the target you're using, a match-nothing filter will be used, and your local application will not receive any messages from that queue.

FileAgentDnsConfig object

Configuration options for how the agent performs DNS resolution.

attempts integer | null

Specifies the number of DNS resolution attempts the agent will make before failing. Setting this too high may cause the internal proxy to time out and exit.

format=uint32min=0
timeout integer | null

Specifies how long (in seconds) the agent will wait for a DNS response before timing out. If not specified the agent uses a default value of 1 second. Setting this too high may cause the internal proxy to time out and exit.

format=uint32min=0
FsModeConfig string | string | string | string

Configuration for enabling read-only or read-write file operations.

These options are overridden by user specified overrides and mirrord default overrides.

If you set "localwithoverrides" then some files can be read/write remotely based on our default/user specified. Default option for general file configuration.

The accepted values are: "local", "localwithoverrides", "read", or "write".

FsUserConfig FsModeConfig | AdvancedFsUserConfig

Changes file operations behavior based on user configuration.

See the file operations reference for more details, and fs advanced for more information on how to fully setup mirrord file operations.

Minimal fs config {#fs-minimal}

{
  "feature": {
    "fs": "read"
  }
}

Advanced fs config {#fs-advanced}

{
  "feature": {
    "fs": {
      "mode": "write",
      "read_write": ".+\\.json" ,
      "read_only": [ ".+\\.yaml", ".+important-file\\.txt" ],
      "local": [ ".+\\.js", ".+\\.mjs" ]
    }
  }
}
HttpFilterFileConfig object

Filter configuration for the HTTP traffic stealer feature.

Allows the user to set a filter (regex) for the HTTP headers, so that the stealer traffic feature only captures HTTP requests that match the specified filter, forwarding unmatched requests to their original destinations.

Only does something when feature.network.incoming.mode is set as "steal", ignored otherwise.

The recommended way to filter a single developer session is to propagate a W3C baggage or tracestate entry such as mirrord-session={{ key }} from the caller, and match that value here. This works well across proxies, service meshes, and tracing-aware clients.

For example, to filter on a baggage header:

{
  "header_filter": "^baggage: .*mirrord-session={{ key }}.*$"
}

Setting that filter will make mirrord only steal requests whose baggage header contains mirrord-session={{ key }}.

If your traffic already propagates tracestate, you can filter on it the same way:

{
  "header_filter": "^tracestate: .*mirrord-session={{ key }}.*$"
}

For example, to filter based on path:

{
  "path_filter": "^/api/"
}

Setting this filter will make mirrord only steal requests to URIs starting with "/api/".

This can be useful for filtering out Kubernetes liveness, readiness and startup probes. For example, for avoiding stealing any probe sent by kubernetes, you can set this filter:

{
  "header_filter": "^User-Agent: (?!kube-probe)"
}

Setting this filter will make mirrord only steal requests that do have a user agent that does not begin with "kube-probe".

Similarly, you can exclude certain paths using a negative look-ahead:

{
  "path_filter": "^(?!/health/)"
}

Setting this filter will make mirrord only steal requests to URIs that do not start with "/health/".

With all_of and any_of, you can use multiple HTTP filters at the same time.

If you want to steal HTTP requests that match every pattern specified, use all_of. For example, this filter steals only POST requests to endpoint /api/my-endpoint whose baggage header contains mirrord-session={{ key }}.

{
  "all_of": [
    { "header": "^baggage: .*mirrord-session={{ key }}.*$" },
    { "path": "^/api/my-endpoint$" },
    { "method": "POST" }
  ]
}

If you want to steal HTTP requests that match any of the patterns specified, use any_of. For example, this filter steals HTTP requests to /api/my-endpoint, or requests whose baggage header contains mirrord-session={{ key }}.

{
 "any_of": [
   { "header": "^baggage: .*mirrord-session={{ key }}.*$" },
   { "path": "^/api/my-endpoint$" }
 ]
}
all_of array | null

An array of HTTP filters.

Each inner filter specifies a header, path, method, body, or jq filter. Requests must match all of the filters to be stolen.

Cannot be an empty list.

Example:

{
  "all_of": [
    { "header": "^baggage: .*mirrord-session={{ key }}.*$" },
    { "path": "^/api/v1/my-endpoint$" },
    { "method": "POST" }
  ]
}
any_of array | null

An array of HTTP filters.

Each inner filter specifies a header, path, method, body, or jq filter. Requests must match at least one of the filters to be stolen.

Cannot be an empty list.

Example:

{
  "any_of": [
    { "header": "^baggage: .*mirrord-session={{ key }}.*$" },
    { "header": "^tracestate: .*mirrord-session={{ key }}.*$" },
    { "path": "^/api/v1/my-endpoint$" }
  ]
}
body_filter BodyFilter | null

Matches the request based on the contents of its body.

header_filter string | null

Supports regexes validated by the fancy-regex crate.

The HTTP traffic feature converts the HTTP headers to HeaderKey: HeaderValue, case-insensitive.

The recommended pattern is to match a W3C baggage or tracestate entry such as mirrord-session={{ key }}.

header_filter_jq string | null

Supports jq expressions, matches when the expression returns true. The expression is evaluated on each present header in the request, in HeaderKey: HeaderValue format.

method_filter string | null

Supports standard HTTP methods, and non-standard HTTP methods.

Case-insensitive. If the request method matches the filter, the request is stolen.

path_filter string | null

Supports regexes validated by the fancy-regex crate.

Case-insensitive. Tries to find match in the path (without query) and path+query. If any of the two matches, the request is stolen.

ports VecOrSingle2 | null

Activate the HTTP traffic filter only for these ports. When absent, filtering will be done for all ports.

IamAuthConfig object | object

IAM authentication for the source database. Use this when your source database (AWS RDS, GCP Cloud SQL) requires IAM authentication instead of password-based authentication.

Environment variable sources follow the same pattern as connection.url:

  • { "type": "env", "variable": "VAR_NAME" } - direct env var from pod spec
  • { "type": "env_from", "variable": "VAR_NAME" } - from configMapRef/secretRef
IncomingAdvancedFileConfig object

Advanced user configuration for network incoming traffic.

http_filter ToggleableConfig5 | null

Sets up the HTTP traffic filter (currently, only useful when incoming: steal).

See filter for details.

https_delivery LocalTlsDelivery | null

DEPRECATED: use tls_delivery instead.

ignore_localhost boolean | null
ignore_ports array | null

Ports to ignore when mirroring/stealing traffic. Useful if you want specific ports to be used locally only.

Mutually exclusive with ports.

listen_ports array | null

Mapping for local ports to actually used local ports. When application listens on a port while steal/mirror is active we fallback to random ports to avoid port conflicts. Using this configuration will always use the specified port. If this configuration doesn't exist, mirrord will try to listen on the original port and if it fails it will assign a random port

This is useful when you want to access ports exposed by your service locally For example, if you have a service that listens on port 80 and you want to access it, you probably can't listen on 80 without sudo, so you can use [[80, 4480]] then access it on 4480 while getting traffic from remote 80. The value of port_mapping doesn't affect this.

mode IncomingMode | null

Allows selecting between mirroring or stealing traffic.

See mode for details.

on_concurrent_steal ConcurrentSteal | null

(Operator Only): if value of override will force close any other connections on requested target

port_mapping array | null

Mapping for local ports to remote ports.

This is useful when you want to mirror/steal a port to a different port on the remote machine. For example, your local process listens on port 9333 and the container listens on port 80. You'd use [[9333, 80]]

ports array | null

List of ports to mirror/steal traffic from. Other ports will remain local.

Mutually exclusive with ignore_ports.

tls_delivery LocalTlsDelivery | null

(Operator Only): configures how mirrord delivers stolen TLS traffic to the local application.

IncomingFileConfig IncomingMode | null | IncomingAdvancedFileConfig

Controls the incoming TCP traffic feature.

See the incoming reference for more details.

Incoming traffic supports 2 modes of operation:

  1. Mirror (default): Sniffs the TCP data from a port, and forwards a copy to the interested listeners;

  2. Steal: Captures the TCP data from a port, and forwards it to the local process, see steal;

Minimal incoming config

{
  "feature": {
    "network": {
      "incoming": "steal"
    }
  }
}

Advanced incoming config

{
  "feature": {
    "network": {
      "incoming": {
        "mode": "steal",
        "http_filter": {
          "header_filter": "^baggage: .*mirrord-session={{ key }}.*$"
        },
        "port_mapping": [[ 7777, 8888 ]],
        "ignore_localhost": false,
        "ignore_ports": [9999, 10000],
        "listen_ports": [[80, 8111]]
      }
    }
  }
}
IncomingMode string | string | string

Allows selecting between mirroring or stealing traffic.

Can be set to either "mirror" (default), "steal" or "off".

  • "mirror": Sniffs on TCP port, and send a copy of the data to listeners.
  • "off": Disables the incoming network feature.
  • "steal": Supports 2 modes of operation:
  1. Port traffic stealing: Steals all TCP data from a port, which is selected whenever the user listens in a TCP socket (enabling the feature is enough to make this work, no additional configuration is needed);

  2. HTTP traffic stealing: Steals only HTTP traffic, mirrord tries to detect if the incoming data on a port is HTTP (in a best-effort kind of way, not guaranteed to be HTTP), and steals the traffic on the port if it is HTTP;

InnerFilter object | object | object | BodyFilter | object
InternalProxyFileConfig object

Configuration for the internal proxy mirrord spawns for each local mirrord session that local layers use to connect to the remote agent

This is seldom used, but if you get ConnectionRefused errors, you might want to increase the timeouts a bit.

{
  "internal_proxy": {
    "start_idle_timeout": 30,
    "idle_timeout": 5
  }
}
idle_timeout integer | null

How much time to wait while we don't have any active connections before exiting.

Common cases would be running a chain of processes that skip using the layer and don't connect to the proxy.

{
  "internal_proxy": {
    "idle_timeout": 30
  }
}
format=uint64min=0
json_log boolean | null

Whether the proxy should output logs in JSON format. If false, logs are output in human-readable format.

Defaults to true.

log_destination string | null

Set the log destination for the internal proxy.

  1. If the provided path ends with a separator (/ on UNIX, \ on Windows), it will be treated as a path to directory where the log file should be created.
  2. Otherwise, if the path exists, mirrord will check if it's a directory or not.
  3. Otherwise, it will be treated as a path to the log file.

mirrord will auto create all parent directories.

Defaults to a randomized path inside the temporary directory.

log_level string | null

Set the log level for the internal proxy.

The value should follow the RUST_LOG convention (i.e mirrord=trace).

Defaults to mirrord=info,warn.

process_logging_interval integer | null

How often to log information about connected processes in seconds.

This feature logs details about processes that are currently connected to the internal proxy, including their PID, process name, command line, and connection status.

{
  "internal_proxy": {
    "process_logging_interval": 60
  }
}
format=uint64min=0
socket_timeout integer | null

Sometimes the cpu is too busy with other tasks and the internal proxy sockets end up timing out. It's set at a ridiculous high value to prevent this from happening when a user hits a breakpoint while debugging, and stays stopped for a while, which sometimes results in mirrord not working when they resume.

{
  "internal_proxy": {
    "socket_timeout": 31536000
  }
}
format=uint64min=0
start_idle_timeout integer | null

How much time to wait for the first connection to the proxy in seconds.

Common cases would be running with dlv or any other debugger, which sets a breakpoint on process execution, delaying the layer startup and connection to proxy.

{
  "internal_proxy": {
    "start_idle_timeout": 60
  }
}
format=uint64min=0
JobTarget object
job string required
container string | null
LatencyFileConfig object

Configuration for adding artificial latency to outgoing network operations. Useful for testing application behavior under network delay conditions.

receive_delay integer | null

Delay in milliseconds for outgoing receive operations (Agent → Layer).

Defaults to 0 (no delay).

format=uint64min=0
transmit_delay integer | null

Delay in milliseconds for outgoing send operations (Layer → Agent).

Defaults to 0 (no delay).

format=uint64min=0
LocalTlsDelivery object

Stolen TLS traffic can be delivered to the local application either as TLS or as plain TCP. Note that stealing TLS traffic requires mirrord Operator support.

To have the stolen TLS traffic delivered with plain TCP, use:

{
  "protocol": "tcp"
}

To have the traffic delivered with TLS, use:

{
  "protocol": "tls"
}

By default, the local mirrord TLS client will trust any certificate presented by the local application's TLS server. To override this behavior, you can either:

  1. Specify a list of paths to trust roots. These paths can lead either to PEM files or PEM file directories. Each found certificate will be used as a trust anchor.
  2. Specify a path to the cartificate chain used by the server.

Example with trust roots:

{
  "protocol": "tls",
  "trust_roots": ["/path/to/cert.pem", "/path/to/cert/dir"]
}

Example with certificate chain:

{
  "protocol": "tls",
  "server_cert": "/path/to/cert.pem"
}

To make a TLS connection to the local application's server, mirrord's TLS client needs a server name. You can supply it manually like this:

{
  "protocol": "tls",
  "server_name": "my.test.server.name"
}

If you don't supply the server name:

  1. If server_cert is given, and the found end-entity certificate contains a valid server name, this server name will be used;
  2. Otherwise, if the original client supplied an SNI extension, the server name from that extension will be used;
  3. Otherwise, if the stolen request's URL contains a valid server name, that server name will be used;
  4. Otherwise, localhost will be used.
protocol string | string required
server_cert string | null

Path to a PEM file containing the certificate chain used by the local application's TLS server.

This file must contain at least one certificate. It can contain entries of other types, e.g private keys, which are ignored.

server_name string | null

Server name to use when making a connection.

Must be a valid DNS name or an IP address.

trust_roots array | null

Paths to PEM files and directories with PEM files containing allowed root certificates.

Directories are not traversed recursively.

Each certificate found in the files is treated as an allowed root. The files can contain entries of other types, e.g private keys, which are ignored.

MagicFileConfig object

Sensible default behaviors that help most users. Disable individual flags only if they conflict with your setup.

{
  "feature": {
    "magic": {
      "aws": true
    }
  }
}
aws boolean | null

The AWS CLI prefers local credentials (e.g. ~/.aws, AWS_PROFILE) over the remote pod's identity (IAM role, instance profile, IRSA). When those local credentials are present, the pod's own identity is never used, which is rarely what you want in a mirrord session.

When enabled, mirrord makes local AWS configuration unavailable to the process by:

  • Unsetting AWS_PROFILE and related AWS environment variables.
  • Mapping ~/.aws to a temporary directory, so the AWS CLI cannot read local credentials and also has a writable location for its credential cache (avoiding errors on cache writes).

This allows the remote pod's IAM role / instance profile to be used as intended.

Disable this only if you intentionally need local AWS credentials inside the local mirrord' process.

Defaults to true.

MongodbBranchConfig object

When configuring a branch for MongoDB, set type to mongodb.

connection object | object | ConnectionParamsConfig required

Different ways of connecting to the source database.

Accepts three formats:

Legacy URL (backward compatible):

{ "url": { "type": "env", "variable": "DB_CONNECTION_URL" } }

Flat URL:

{ "type": "env", "url": "DB_CONNECTION_URL" }

Individual connection params:

{ "type": "env", "params": { "host": "DB_HOST", "port": "DB_PORT", "user": "DB_USER", "password": "DB_PASSWORD", "database": "DB_NAME" } }

Individual connection params with password from a Kubernetes Secret:

{ "type": "env", "params": { "host": "DB_HOST", "password": { "secret": "my-secret", "key": "password" }, "database": "DB_NAME" } }
copy object | object

Users can choose from the following copy mode to bootstrap their MongoDB branch database:

  • Empty

    Creates an empty database. If the source DB connection options are found from the chosen target, mirrord operator extracts the database name and create an empty DB. Otherwise, mirrord operator looks for the name field from the branch DB config object. This option is useful for users that run DB migrations themselves before starting the application.

  • All

    Copies both schema and data of all collections. Supports optional collection filters to copy only specific collections or filter documents within collections.

creation_timeout_secs integer

The timeout in seconds to wait for a database branch to become ready after creation. Defaults to 60 seconds. Adjust this value based on your database size and cluster performance.

Default: 60
format=uint64min=0
id string | null

Users can choose to specify a unique id. This is useful for reusing or sharing the same database branch among Kubernetes users.

name string | null

When source database connection detail is not accessible to mirrord operator, users can specify the database name so it is included in the connection options mirrord uses as the override.

ttl_secs integer

Mirrord operator starts counting the TTL when a branch is no longer used by any session. The time-to-live (TTL) for the branch database is set to 300 seconds by default. Users can set ttl_secs to customize this value according to their need. Please note that longer TTL paired with frequent mirrord session turnover can result in increased resource usage. For this reason, branch database TTL caps out at 15 min.

Default: 300
format=uint64min=0
version string | null

Mirrord operator uses a default version of the database image unless version is given.

MongodbBranchCopyConfig object | object

Users can choose from the following copy mode to bootstrap their MongoDB branch database:

  • Empty

    Creates an empty database. If the source DB connection options are found from the chosen target, mirrord operator extracts the database name and create an empty DB. Otherwise, mirrord operator looks for the name field from the branch DB config object. This option is useful for users that run DB migrations themselves before starting the application.

  • All

    Copies both schema and data of all collections. Supports optional collection filters to copy only specific collections or filter documents within collections.

MssqlBranchConfig object

When configuring a branch for MSSQL, set type to mssql.

connection object | object | ConnectionParamsConfig required

Different ways of connecting to the source database.

Accepts three formats:

Legacy URL (backward compatible):

{ "url": { "type": "env", "variable": "DB_CONNECTION_URL" } }

Flat URL:

{ "type": "env", "url": "DB_CONNECTION_URL" }

Individual connection params:

{ "type": "env", "params": { "host": "DB_HOST", "port": "DB_PORT", "user": "DB_USER", "password": "DB_PASSWORD", "database": "DB_NAME" } }

Individual connection params with password from a Kubernetes Secret:

{ "type": "env", "params": { "host": "DB_HOST", "password": { "secret": "my-secret", "key": "password" }, "database": "DB_NAME" } }
copy object | object | object

Users can choose from the following copy mode to bootstrap their MSSQL branch database:

  • Empty

    Creates an empty database. If the source DB connection options are found from the chosen target, mirrord operator extracts the database name and create an empty DB. Otherwise, mirrord operator looks for the name field from the branch DB config object. This option is useful for users that run DB migrations themselves before starting the application.

  • Schema

    Creates an empty database and copies schema of all tables.

  • All

    Copies both schema and data of all tables. This option shall only be used when the data volume of the source database is minimal.

creation_timeout_secs integer

The timeout in seconds to wait for a database branch to become ready after creation. Defaults to 60 seconds. Adjust this value based on your database size and cluster performance.

Default: 60
format=uint64min=0
id string | null

Users can choose to specify a unique id. This is useful for reusing or sharing the same database branch among Kubernetes users.

name string | null

When source database connection detail is not accessible to mirrord operator, users can specify the database name so it is included in the connection options mirrord uses as the override.

ttl_secs integer

Mirrord operator starts counting the TTL when a branch is no longer used by any session. The time-to-live (TTL) for the branch database is set to 300 seconds by default. Users can set ttl_secs to customize this value according to their need. Please note that longer TTL paired with frequent mirrord session turnover can result in increased resource usage. For this reason, branch database TTL caps out at 15 min.

Default: 300
format=uint64min=0
version string | null

Mirrord operator uses a default version of the database image unless version is given.

MssqlBranchCopyConfig object | object | object

Users can choose from the following copy mode to bootstrap their MSSQL branch database:

  • Empty

    Creates an empty database. If the source DB connection options are found from the chosen target, mirrord operator extracts the database name and create an empty DB. Otherwise, mirrord operator looks for the name field from the branch DB config object. This option is useful for users that run DB migrations themselves before starting the application.

  • Schema

    Creates an empty database and copies schema of all tables.

  • All

    Copies both schema and data of all tables. This option shall only be used when the data volume of the source database is minimal.

MysqlBranchConfig object

When configuring a branch for MySQL, set type to mysql.

connection object | object | ConnectionParamsConfig required

Different ways of connecting to the source database.

Accepts three formats:

Legacy URL (backward compatible):

{ "url": { "type": "env", "variable": "DB_CONNECTION_URL" } }

Flat URL:

{ "type": "env", "url": "DB_CONNECTION_URL" }

Individual connection params:

{ "type": "env", "params": { "host": "DB_HOST", "port": "DB_PORT", "user": "DB_USER", "password": "DB_PASSWORD", "database": "DB_NAME" } }

Individual connection params with password from a Kubernetes Secret:

{ "type": "env", "params": { "host": "DB_HOST", "password": { "secret": "my-secret", "key": "password" }, "database": "DB_NAME" } }
copy object | object | object

Users can choose from the following copy mode to bootstrap their MySQL branch database:

  • Empty

    Creates an empty database. If the source DB connection options are found from the chosen target, mirrord operator extracts the database name and create an empty DB. Otherwise, mirrord operator looks for the name field from the branch DB config object. This option is useful for users that run DB migrations themselves before starting the application.

  • Schema

    Creates an empty database and copies schema of all tables.

  • All

    Copies both schema and data of all tables. This option shall only be used when the data volume of the source database is minimal.

creation_timeout_secs integer

The timeout in seconds to wait for a database branch to become ready after creation. Defaults to 60 seconds. Adjust this value based on your database size and cluster performance.

Default: 60
format=uint64min=0
id string | null

Users can choose to specify a unique id. This is useful for reusing or sharing the same database branch among Kubernetes users.

name string | null

When source database connection detail is not accessible to mirrord operator, users can specify the database name so it is included in the connection options mirrord uses as the override.

ttl_secs integer

Mirrord operator starts counting the TTL when a branch is no longer used by any session. The time-to-live (TTL) for the branch database is set to 300 seconds by default. Users can set ttl_secs to customize this value according to their need. Please note that longer TTL paired with frequent mirrord session turnover can result in increased resource usage. For this reason, branch database TTL caps out at 15 min.

Default: 300
format=uint64min=0
version string | null

Mirrord operator uses a default version of the database image unless version is given.

MysqlBranchCopyConfig object | object | object

Users can choose from the following copy mode to bootstrap their MySQL branch database:

  • Empty

    Creates an empty database. If the source DB connection options are found from the chosen target, mirrord operator extracts the database name and create an empty DB. Otherwise, mirrord operator looks for the name field from the branch DB config object. This option is useful for users that run DB migrations themselves before starting the application.

  • Schema

    Creates an empty database and copies schema of all tables.

  • All

    Copies both schema and data of all tables. This option shall only be used when the data volume of the source database is minimal.

NetworkFileConfig object

Controls mirrord network operations.

See the network traffic reference for more details.

{
  "feature": {
    "network": {
      "incoming": {
        "mode": "steal",
        "http_filter": {
          "header_filter": "^baggage: .*mirrord-session={{ key }}.*$"
        },
        "port_mapping": [[ 7777, 8888 ]],
        "ignore_localhost": false,
        "ignore_ports": [9999, 10000]
      },
      "outgoing": {
        "tcp": true,
        "udp": true,
        "filter": {
          "local": ["tcp://1.1.1.0/24:1337", "1.1.5.0/24", "google.com", ":53"]
        },
        "ignore_localhost": false,
        "unix_streams": "bear.+"
      },
      "dns": {
        "enabled": true,
        "filter": {
          "local": ["1.1.1.0/24:1337", "1.1.5.0/24", "google.com"]
        }
      }
    }
  }
}
dns ToggleableConfig7 | null
incoming ToggleableConfig4 | null
ipv6 boolean | null

Enable ipv6 support. Turn on if your application listens to incoming traffic over IPv6, or connects to other services over IPv6.

outgoing ToggleableConfig6 | null
OutgoingFileConfig object

Tunnel outgoing network operations through mirrord.

See the outgoing reference for more details.

You can use either the true or false values to turn outgoing traffic tunneling on or off.

{
  "feature": {
    "network": {
      "outgoing": true
    }
  }
}

Alternatively, you can use more fine-grained configuration.

{
  "feature": {
    "network": {
      "outgoing": {
        "tcp": true,
        "udp": true,
        "ignore_localhost": false,
        "filter": {
          "local": ["tcp://1.1.1.0/24:1337", "1.1.5.0/24", "google.com", ":53"]
        },
        "unix_streams": "bear.+"
      }
    }
  }
}
filter OutgoingFilterConfig | null

Filters that are used to send specific traffic from either the remote pod or the local app

ignore_localhost boolean | null

Defaults to false.

tcp boolean | null

Defaults to true.

udp boolean | null

Defaults to true.

unix_streams VecOrSingle | null

Connect to these unix streams remotely (and to all other paths locally).

You can either specify a single value or an array of values. Each value is interpreted as a regular expression (Supported Syntax).

When your application connects to a unix socket, the target address will be converted to a string (non-utf8 bytes are replaced by a placeholder character) and matched against the set of regexes specified here. If there is a match, mirrord will connect your application with the target unix socket address on the target pod. Otherwise, it will leave the connection to happen locally on your machine.

OutgoingFilterConfig object | object

List of addresses/ports/subnets that should be sent through either the remote pod or local app, depending how you set this up with either remote or local.

You may use this option to specify when outgoing traffic is sent from the remote pod (which is the default behavior when you enable outgoing traffic), or from the local app (default when you have outgoing traffic disabled).

Takes a list of values, such as:

  • Only UDP traffic on subnet 1.1.1.0/24 on port 1337 will go through the remote pod.
{
  "remote": ["udp://1.1.1.0/24:1337"]
}
  • Only UDP and TCP traffic on resolved address of google.com on port 1337 and 7331 will go through the remote pod.
{
  "remote": ["google.com:1337", "google.com:7331"]
}
  • Only TCP traffic on localhost on port 1337 will go through the local app, the rest will be emitted remotely in the cluster.
{
  "local": ["tcp://localhost:1337"]
}
  • Only outgoing traffic on port 1337 and 7331 will go through the local app.
{
  "local": [":1337", ":7331"]
}

Valid values follow this pattern: [protocol]://[name|address|subnet/mask]:[port].

ParamSource string | object

A connection parameter source: either a plain env var name (string) or a Kubernetes Secret reference (object).

As a string: "DB_HOST" — resolved using the parent type field (env or env_from).

As an object: { "secret": "my-secret", "key": "password" } — read directly from a Kubernetes Secret.

PgBranchConfig object

When configuring a branch for PostgreSQL, set type to pg.

connection object | object | ConnectionParamsConfig required

Different ways of connecting to the source database.

Accepts three formats:

Legacy URL (backward compatible):

{ "url": { "type": "env", "variable": "DB_CONNECTION_URL" } }

Flat URL:

{ "type": "env", "url": "DB_CONNECTION_URL" }

Individual connection params:

{ "type": "env", "params": { "host": "DB_HOST", "port": "DB_PORT", "user": "DB_USER", "password": "DB_PASSWORD", "database": "DB_NAME" } }

Individual connection params with password from a Kubernetes Secret:

{ "type": "env", "params": { "host": "DB_HOST", "password": { "secret": "my-secret", "key": "password" }, "database": "DB_NAME" } }
copy object | object | object

Users can choose from the following copy mode to bootstrap their PostgreSQL branch database:

  • Empty

    Creates an empty database. If the source DB connection options are found from the chosen target, mirrord operator extracts the database name and create an empty DB. Otherwise, mirrord operator looks for the name field from the branch DB config object. This option is useful for users that run DB migrations themselves before starting the application.

  • Schema

    Creates an empty database and copies schema of all tables.

  • All

    Copies both schema and data of all tables. This option shall only be used when the data volume of the source database is minimal.

creation_timeout_secs integer

The timeout in seconds to wait for a database branch to become ready after creation. Defaults to 60 seconds. Adjust this value based on your database size and cluster performance.

Default: 60
format=uint64min=0
iam_auth IamAuthConfig | null

IAM authentication for the source database. Use this when your source database (AWS RDS, GCP Cloud SQL) requires IAM authentication instead of password-based authentication.

id string | null

Users can choose to specify a unique id. This is useful for reusing or sharing the same database branch among Kubernetes users.

name string | null

When source database connection detail is not accessible to mirrord operator, users can specify the database name so it is included in the connection options mirrord uses as the override.

ttl_secs integer

Mirrord operator starts counting the TTL when a branch is no longer used by any session. The time-to-live (TTL) for the branch database is set to 300 seconds by default. Users can set ttl_secs to customize this value according to their need. Please note that longer TTL paired with frequent mirrord session turnover can result in increased resource usage. For this reason, branch database TTL caps out at 15 min.

Default: 300
format=uint64min=0
version string | null

Mirrord operator uses a default version of the database image unless version is given.

PgBranchCopyConfig object | object | object

Users can choose from the following copy mode to bootstrap their PostgreSQL branch database:

  • Empty

    Creates an empty database. If the source DB connection options are found from the chosen target, mirrord operator extracts the database name and create an empty DB. Otherwise, mirrord operator looks for the name field from the branch DB config object. This option is useful for users that run DB migrations themselves before starting the application.

  • Schema

    Creates an empty database and copies schema of all tables.

  • All

    Copies both schema and data of all tables. This option shall only be used when the data volume of the source database is minimal.

PodTarget object

Mirror the pod specified by [PodTarget::pod].

pod string required

Pod to mirror.

container string | null
PreviewFileConfig object

Controls the lifetime and creation behavior of preview sessions.

{
  "feature": {
    "preview": {
      "image": "my-registry/my-app:latest",
      "ttl_mins": 60,
      "creation_timeout_secs": 60
    }
  }
}
creation_timeout_secs integer | null

How long (in seconds) the CLI waits for the preview session to become ready. If the session hasn't reached Ready within this time, the CLI deletes it.

format=uint64min=0
image string | null

Container image to run in the preview pod. The image must be pre-built and pushed to a registry accessible by the cluster.

ttl_mins PreviewTtlMins | null

How long (in minutes) the preview session is allowed to live after creation. The operator will terminate the session when this time elapses.

Set to "infinite" to disable TTL.

PreviewTtlKeyword string
PreviewTtlMins integer | PreviewTtlKeyword
QueueFilter object | object | object

For each queue, message_filter is a mapping between message attribute names and regexes they should match. The local application will only receive messages that match all of the given patterns. This means, only messages that have all of the attributes in the filter, with values of those attributes matching the respective patterns.

feature.split_queues.{}.queue_type {#feature-split_queues-queue_id-queue_type}

The type of queue to be split, currently SQS and Kafka are supported. More queue types might be added in the future.

RedisBranchConfig object

When configuring a branch for Redis, set type to redis.

Example with URL-based connection:

{
  "type": "redis",
  "location": "local",
  "connection": {
    "url": {
      "type": "env",
      "variable": "REDIS_URL"
    }
  }
}

Example with separated settings:

{
  "type": "redis",
  "location": "local",
  "connection": {
    "host": { "type": "env", "variable": "REDIS_HOST" },
    "port": 6379,
    "password": { "type": "env", "variable": "REDIS_PASSWORD" }
  }
}
connection object

Supports either a complete URL or separated connection parameters. If both are provided, url takes precedence.

The following fields can be sourced via remote environment variable:

  • url
  • host
  • password
  • username

Example:

"connection": {
    "host": { "type": "env", "variable": "REDIS_HOST" },
    "port": 6379,
    "password": { "type": "env", "variable": "REDIS_PASSWORD" }
}
7 nested properties
database integer | null

Redis database number (default: 0).

Default: null
format=uint16min=0max=65535
host RedisValueSource | null

Redis host/hostname. Can be sourced from an environment variable.

Default: null
password RedisValueSource | null

Redis password for authentication. Can be sourced from an environment variable.

Default: null
port integer | null

Redis port (default: 6379).

Default: null
format=uint16min=0max=65535
tls boolean | null

Enable TLS/SSL connection.

Default: null
url RedisValueSource | null

Complete Redis URL (e.g., redis://user:pass@host:6379/0). Can be sourced from an environment variable.

Default: null
username RedisValueSource | null

Redis username (Redis 6+ ACL). Can be sourced from an environment variable.

Default: null
id string | null

Optional unique identifier for reusing branches across sessions.

Default: null
local object

Configuration for local Redis runtime.

7 nested properties
container_command string | null

Custom path to the container command. If not provided, uses the runtime name from PATH (e.g., "docker"). Example: /usr/local/bin/docker or /home/user/.local/bin/podman

Default: null
container_runtime string | string | string

Container runtimes supported by mirrord.

options object

Example:

{
  "args": ["--maxmemory", "256mb", "--appendonly", "yes"]
}
1 nested properties
args string[]

Raw arguments passed directly to redis-server or as Docker CMD args. Use standard Redis config syntax (e.g., "--maxmemory 256mb").

Default:
[]
port integer

Local port to bind Redis to (default: 6379).

Default: 6379
format=uint16min=0max=65535
runtime string

For container-based runtimes, mirrord spawns the Redis image in a container. For redis_server, it runs the native binary directly.

Backends:

  • container (default) - Uses a container runtime (Docker/Podman/nerdctl), configured via container_runtime.
  • redis_server - Uses native redis-server binary
  • auto - Tries container first, falls back to redis-server
Values: "container" "redis_server" "auto"
server_command string | null

Custom path to the redis-server binary. If not provided, uses "redis-server" from PATH. Example: /opt/redis/bin/redis-server

Default: null
version string

Redis version/tag to use (default: "7-alpine"). Used as the container image tag.

Default: "7-alpine"
location string
Values: "local" "remote"
RedisBranchLocation string
RedisConnectionConfig object

Supports either a complete URL or separated connection parameters. If both are provided, url takes precedence.

The following fields can be sourced via remote environment variable:

  • url
  • host
  • password
  • username

Example:

"connection": {
    "host": { "type": "env", "variable": "REDIS_HOST" },
    "port": 6379,
    "password": { "type": "env", "variable": "REDIS_PASSWORD" }
}
database integer | null

Redis database number (default: 0).

Default: null
format=uint16min=0max=65535
host RedisValueSource | null

Redis host/hostname. Can be sourced from an environment variable.

Default: null
password RedisValueSource | null

Redis password for authentication. Can be sourced from an environment variable.

Default: null
port integer | null

Redis port (default: 6379).

Default: null
format=uint16min=0max=65535
tls boolean | null

Enable TLS/SSL connection.

Default: null
url RedisValueSource | null

Complete Redis URL (e.g., redis://user:pass@host:6379/0). Can be sourced from an environment variable.

Default: null
username RedisValueSource | null

Redis username (Redis 6+ ACL). Can be sourced from an environment variable.

Default: null
RedisEnvSource object

Environment variable source for Redis values.

type string required

Type marker for environment variable sources.

Values: "env"
variable string required
container string | null
Default: null
RedisEnvSourceType string

Type marker for environment variable sources.

RedisLocalConfig object

Configuration for local Redis runtime.

container_command string | null

Custom path to the container command. If not provided, uses the runtime name from PATH (e.g., "docker"). Example: /usr/local/bin/docker or /home/user/.local/bin/podman

Default: null
container_runtime string | string | string

Container runtimes supported by mirrord.

options object

Example:

{
  "args": ["--maxmemory", "256mb", "--appendonly", "yes"]
}
1 nested properties
args string[]

Raw arguments passed directly to redis-server or as Docker CMD args. Use standard Redis config syntax (e.g., "--maxmemory 256mb").

Default:
[]
port integer

Local port to bind Redis to (default: 6379).

Default: 6379
format=uint16min=0max=65535
runtime string

For container-based runtimes, mirrord spawns the Redis image in a container. For redis_server, it runs the native binary directly.

Backends:

  • container (default) - Uses a container runtime (Docker/Podman/nerdctl), configured via container_runtime.
  • redis_server - Uses native redis-server binary
  • auto - Tries container first, falls back to redis-server
Values: "container" "redis_server" "auto"
server_command string | null

Custom path to the redis-server binary. If not provided, uses "redis-server" from PATH. Example: /opt/redis/bin/redis-server

Default: null
version string

Redis version/tag to use (default: "7-alpine"). Used as the container image tag.

Default: "7-alpine"
RedisOptions object

Example:

{
  "args": ["--maxmemory", "256mb", "--appendonly", "yes"]
}
args string[]

Raw arguments passed directly to redis-server or as Docker CMD args. Use standard Redis config syntax (e.g., "--maxmemory 256mb").

Default:
[]
RedisRuntime string

For container-based runtimes, mirrord spawns the Redis image in a container. For redis_server, it runs the native binary directly.

Backends:

  • container (default) - Uses a container runtime (Docker/Podman/nerdctl), configured via container_runtime.
  • redis_server - Uses native redis-server binary
  • auto - Tries container first, falls back to redis-server
RedisValueSource string | RedisEnvSource

Source for a Redis configuration value.

Values can be specified directly or sourced from environment variables.

ReplicaSetTarget object
replica_set string required
container string | null
RolloutTarget object

Mirror the rollout specified by [RolloutTarget::rollout].

rollout string required

Rollout to mirror.

container string | null
SecurityContext object
app_armor_profile SecurityProfile | null
seccomp_profile SecurityProfile | null
SecurityProfile object
type string required
localhost_profile string | null
ServiceTarget object
service string required
container string | null
SplitQueuesConfig Record<string, object | object | object>

A mapping from queue ids to their filters. Each queue filter defines which messages from the original queue will be made available to the local application, based on message attributes or headers, and possibly on jq filters (for SQS).

The queue-ids have to match those defined in the MirrordWorkloadQueueRegistry for SQS and RabbitMQ or MirrordKafkaTopicsConsumer for Kafka.

{
  "feature": {
    "split_queues": {
      "first-queue": {
        "queue_type": "SQS",
        "message_filter": {
          "wows": "so wows",
          "coolz": "^very"
        }
      },
      "second-queue": {
        "queue_type": "SQS",
        "jq_filter": ".Body | fromjson | .customer_email | test(\"metalbear\\\\.com\")"
      },
      "third-queue": {
        "queue_type": "Kafka",
        "message_filter": {
          "who": "you$"
        }
      },
      "fourth-queue": {
        "queue_type": "Kafka",
        "message_filter": {
          "wows": "so wows",
          "coolz": "^very"
        }
      },
    }
  }
}
StartupRetryFileConfig object

Controls how many times, and how often mirrord retries its initial Kubernetes API requests (e.g. for resolving the target or connecting to the mirrord Operator).

If you're having cluster connectivity issues when starting mirrord, consider increasing max_retries and changing both min_ms and max_ms to have mirrord retry some of its initial Kubernetes API requests.

{
  "startup_retry": {
    "min_ms": 500,
    "max_ms": 5000,
    "max_retries": 2,
  }
}
max_ms integer | null

Sets the max interval (in milliseconds) of retries for Kubernetes API requests made by mirrord during startup (e.g. for resolving the target or connecting to the mirrord Operator).

Defaults to 5000 milliseconds.

format=uint64min=0
max_retries integer | null

Sets the max amount of retries for Kubernetes API requests made by mirrord during startup (e.g. for resolving the target or connecting to the mirrord Operator).

If you want to disable request retries, set this value to 0.

Defaults to 2.

format=uint32min=0
min_ms integer | null

Sets the min interval (in milliseconds) of retries for Kubernetes API requests made by mirrord during startup (e.g. for resolving the target or connecting to the mirrord Operator).

Defaults to 500 milliseconds.

format=uint64min=0
StatefulSetTarget object
stateful_set string required
container string | null
Target DeploymentTarget | PodTarget | RolloutTarget | JobTarget | CronJobTarget | StatefulSetTarget | ServiceTarget | ReplicaSetTarget | enum
TargetFileConfig Target | null | string | object
TlsDeliveryProtocol string | string
ToggleableConfig boolean | EnvFileConfig
ToggleableConfig2 boolean | FsUserConfig
ToggleableConfig3 boolean | NetworkFileConfig
ToggleableConfig4 boolean | IncomingFileConfig
ToggleableConfig5 boolean | HttpFilterFileConfig
ToggleableConfig6 boolean | OutgoingFileConfig
ToggleableConfig7 boolean | DnsFileConfig
VecOrSingle string | string[]
VecOrSingle2 integer | integer[]
io.k8s.api.core.v1.ResourceClaim object

ResourceClaim references one entry in PodSpec.ResourceClaims.

name string required

Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.

request string

Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.

io.k8s.api.core.v1.ResourceRequirements object

ResourceRequirements describes the compute resource requirements.

Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.

This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.

This field is immutable. It can only be set for containers.

Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

io.k8s.api.core.v1.Toleration object

The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator .

effect string

Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.

key string

Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.

operator string

Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.

tolerationSeconds integer

TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.

format=int64
value string

Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.

io.k8s.apimachinery.pkg.api.resource.Quantity

Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.

The serialization format is:


	(Note that <suffix> may be empty, from the "" case in <decimalSI>.)

<digit>           ::= 0 | 1 | ... | 9 <digits>          ::= <digit> | <digit><digits> <number>          ::= <digits> | <digits>.<digits> | <digits>. | .<digits> <sign>            ::= "+" | "-" <signedNumber>    ::= <number> | <sign><number> <suffix>          ::= <binarySI> | <decimalExponent> | <decimalSI> <binarySI>        ::= Ki | Mi | Gi | Ti | Pi | Ei

	(International System of units; See: <http://physics.nist.gov/cuu/Units/binary.html)>

<decimalSI>       ::= m | "" | k | M | G | T | P | E

	(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)

<decimalExponent> ::= "e" <signedNumber> | "E" <signedNumber> ```

No matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.

When a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.

Before serializing, Quantity will be put in "canonical form". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:

- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.

The sign will be omitted unless the number is negative.

Examples:

- 1.5 will be serialized as "1500m" - 1.5Gi will be serialized as "1536Mi"

Note that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.

Non-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)

This format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.