Configuration

LayerFileConfig

LayerFileConfig

Type: object

Main struct for mirrord-layer's configuration

Examples

  • Run mirrord with read-only file operations, mirroring traffic, skipping unwanted processes:

```toml # mirrord-config.toml

target = "pod/sample-pod-1234" skip_processes = ["ide-debugger", "ide-service"] # we don't want mirrord to hook into these

[agent] log_level = "debug" ttl = 1024 # seconds

[feature] fs = "read" # default

[feature.network] incoming = "mirror" # default ```

  • Run mirrord with read-write file operations, stealing traffic, accept local TLS certificates, use a custom mirrord-agent image:

```toml # mirrord-config.toml

target = "pod/sample-pod-1234" acceptinvalidcertificates = true

[agent] loglevel = "debug" ttl = 1024 # seconds image = "registry/mirrord-agent-custom:latest" imagepull_policy = "Always"

[feature] fs = "write"

[feature.network] incoming = "steal" ```

No Additional Properties

Type: boolean or null

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

Type: object

Agent configuration, see [agent::AgentFileConfig].

No Additional Properties

Type: integer or nullFormat: uint16

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.

Type: boolean or null

Runs the agent as an ephemeral container

Type: string or 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.

Type: string or null

Controls when a new agent image is downloaded.

Supports any valid kubernetes image pull policy

Type: string or null

Log level for the agent.

Supports anything that would work with RUST_LOG.

Type: string or null

Namespace where the agent shall live.

Defaults to the current kubernetes namespace.

Type: string or null

Which network interface to use for mirroring.

The default behavior is try to access the internet and use that interface and if that fails it uses eth0.

Type: integer or nullFormat: uint64

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

If initialization takes longer than this value, mirrord exits.

Type: integer or nullFormat: uint16

Controls how long the agent pod persists for, after the local process terminated (in seconds).

Can be useful for collecting logs.

Type: string or null

Agent name that already exists that we can connect to.

Type: integer or nullFormat: uint16

Agent listen port that already exists that we can connect to.

Type: string or null

IP:PORT to connect to instead of using k8s api, for testing purposes.

Type: object

Controls mirrord features, see [feature::FeatureFileConfig].

No Additional Properties

Type: boolean or null Default: null

Controls the crash reporting feature.

With this feature enabled, mirrord generates a nice crash report log.

Type: object

Controls the environment variables feature, see [EnvFileConfig].

For more information, check the environment variables technical reference.

Type: boolean
Type: object

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

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.

Examples

  • Include every environment variable from the remote pod (default):

```toml # mirrord-config.toml

[feature] env = true

[feature.env] include = "*" ```

Some environment variables are excluded by default (PATH for example), including these requires specifying them with include, see [mirrord_agent::env::EnvFilter].

  • Include the remote pod's environment variables "PROJECT", "DATABASE":

```toml # mirrord-config.toml

[feature] env = true

[feature.env] include = "PROJECT;DATABASE" ```

  • Exclude the remote pod's environment variables "USER", "SECRET", and include everything else:

```toml # mirrord-config.toml

[feature] env = true

[feature.env] exclude = "USER;SECRET" ```

No Additional Properties


Include the remote environment variables in the local process that are NOT specified by this option.

Value is a list separated by ";".


Include only these remote environment variables in the local process.

Value is a list separated by ";".

Type: object or null

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 overrides to set REGION=2 (locally) instead.

Each additional property must conform to the following schema

Type: string

Type: object

Controls the file operations feature, see [FsUserConfig].

For more information, check the file operations technical reference.

Type: boolean
Type: object

Changes file operations behavior based on user configuration.

Defaults to [FsUserConfig::Simple], with [FsModeConfig::Read].

See the file operations reference for more details.

Examples

  • Read-write file operations:

```toml # mirrord-config.toml

[feature] fs = "write" ```

  • Read-only excluding .foo files:

```toml # mirrord-config.toml

[feature.fs] mode = "read" exclude = "^.*.foo$" ```

  • Read-write including only .baz files:

```toml # mirrord-config.toml

[feature.fs] mode = "write" include = "^.*.baz$" ```

Type: enum (of string)

Basic configuration that controls the env vars MIRRORD_FILE_OPS and MIRRORD_FILE_RO_OPS (default).

Must be one of:

  • "disabled"
  • "read"
  • "write"
Type: object

Allows the user to specify both [FsModeConfig] (as above), and configuration for the MIRRORD_FILE_FILTER_INCLUDE and MIRRORD_FILE_FILTER_EXCLUDE env vars.

No Additional Properties


Allows the user to specify regexes that are used to match against files when mirrord file operations are enabled.

The opposite of include, files that match the regexes specified here will bypass mirrord and are accessed locally.


Allows the user to specify regexes that are used to match against files when mirrord file operations are enabled.

The regexes specified here will make mirrord operate only on files that match it, otherwise the file will be accessed locally (bypassing mirrord).

Type: enum (of string)

File operations mode, defaults to read-only, see [FsModeConfig].

Same definition as feature_fs_anyOf_i1_anyOf_i0

Type: object

Controls the network feature, see [NetworkFileConfig].

For more information, check the network traffic technical reference.

Type: boolean
Type: object

Controls mirrord network operations.

See the network traffic reference for more details.

Examples

  • Steal incoming traffic, enable TCP outgoing traffic and DNS resolution:

```toml # mirrord-config.toml

[feature.network] incoming = "steal" dns = true # not needed, as this is the default

[feature.network.outgoing] tcp = true ```

No Additional Properties

Type: boolean or null

Resolve DNS via the remote pod.


Mode of operation for incoming network requests in mirrord, supports mirror or steal:

  • mirror: mirror incoming requests to the remote pod to the local process; - steal: redirect incoming requests to the remote pod to the local process

Type: enum (of string)

Must be one of:

  • "mirror"
  • "steal"

Type: object

Tunnel outgoing network operations through mirrord.

Type: object
No Additional Properties

Type: boolean or null

Type: boolean or 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.

Type: object

Specifies the running pod to mirror.

Supports: - pod/{sample-pod}/[container]/{sample-container}; - podname/{sample-pod}/[container]/{sample-container}; - deployment/{sample-deployment}/[container]/{sample-container};


Type: object

Specifies the running pod (or deployment) to mirror.

Supports: - pod/{sample-pod}; - podname/{sample-pod}; - deployment/{sample-deployment}; - container/{sample-container}; - containername/{sample-container}.

Examples

  • Mirror pod hello-world-abcd-1234:

```toml # mirrord-config.toml

target = "pod/hello-world-abcd-1234" ```

Type: object

Mirror a deployment.

Type: string or null

Type: string

Deployment to mirror.

Type: object

Mirror a pod.

Type: string or null

Type: string

Pod to mirror.

Type: null
Type: object

Type: string or null


Type: object

Specifies the running pod (or deployment) to mirror.

Supports: - pod/{sample-pod}; - podname/{sample-pod}; - deployment/{sample-deployment}; - container/{sample-container}; - containername/{sample-container}.

Examples

  • Mirror pod hello-world-abcd-1234:

```toml # mirrord-config.toml

target = "pod/hello-world-abcd-1234" ```

Same definition as target_anyOf_i0_anyOf_i0