diff --git a/changelog.d/+change-config-docs.internal.md b/changelog.d/+change-config-docs.internal.md new file mode 100644 index 00000000000..356cb2b000d --- /dev/null +++ b/changelog.d/+change-config-docs.internal.md @@ -0,0 +1 @@ +Add information how to use config file in config docs \ No newline at end of file diff --git a/mirrord-schema.json b/mirrord-schema.json index ffc86fc0b0f..89b9cc64d36 100644 --- a/mirrord-schema.json +++ b/mirrord-schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "LayerFileConfig", - "description": "mirrord allows for a high degree of customization when it comes to which features you want to enable, and how they should function.\n\nAll of the configuration fields have a default value, so a minimal configuration would be no configuration at all.\n\nThe configuration supports templating using the [Tera](https://keats.github.io/tera/docs/) 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.\n\nTo help you get started, here are examples of a basic configuration file, and a complete configuration file containing all fields.\n\n### Basic `config.json` {#root-basic}\n\n```json { \"target\": \"pod/bear-pod\", \"feature\": { \"env\": true, \"fs\": \"read\", \"network\": true } } ```\n\n### Basic `config.json` with templating {#root-basic-templating}\n\n```json { \"target\": \"{{ get_env(name=\"TARGET\", default=\"pod/fallback\") }}\", \"feature\": { \"env\": true, \"fs\": \"read\", \"network\": true } } ```\n\n### Complete `config.json` {#root-complete}\n\nDon't use this example as a starting point, it's just here to show you all the available options. ```json { \"accept_invalid_certificates\": false, \"skip_processes\": \"ide-debugger\", \"pause\": false, \"target\": { \"path\": \"pod/bear-pod\", \"namespace\": \"default\" }, \"connect_tcp\": null, \"agent\": { \"log_level\": \"info\", \"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, \"network_interface\": \"eth0\", \"flush_connections\": true }, \"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\": \"host: api\\..+\" }, \"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\": { \"scale_down\": false } }, }, \"operator\": true, \"kubeconfig\": \"~/.kube/config\", \"sip_binaries\": \"bash\", \"telemetry\": true, \"kube_context\": \"my-cluster\" } ```\n\n# Options {#root-options}", + "description": "mirrord allows for a high degree of customization when it comes to which features you want to enable, and how they should function.\n\nAll of the configuration fields have a default value, so a minimal configuration would be no configuration at all.\n\nThe configuration supports templating using the [Tera](https://keats.github.io/tera/docs/) 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.\n\nTo use a configuration file in the CLI, use the `-f ` flag. Or if using VSCode Extension or JetBrains plugin, simply create a `.mirrord/mirrord.json` file or use the UI.\n\nTo help you get started, here are examples of a basic configuration file, and a complete configuration file containing all fields.\n\n### Basic `config.json` {#root-basic}\n\n```json { \"target\": \"pod/bear-pod\", \"feature\": { \"env\": true, \"fs\": \"read\", \"network\": true } } ```\n\n### Basic `config.json` with templating {#root-basic-templating}\n\n```json { \"target\": \"{{ get_env(name=\"TARGET\", default=\"pod/fallback\") }}\", \"feature\": { \"env\": true, \"fs\": \"read\", \"network\": true } } ```\n\n### Complete `config.json` {#root-complete}\n\nDon't use this example as a starting point, it's just here to show you all the available options. ```json { \"accept_invalid_certificates\": false, \"skip_processes\": \"ide-debugger\", \"pause\": false, \"target\": { \"path\": \"pod/bear-pod\", \"namespace\": \"default\" }, \"connect_tcp\": null, \"agent\": { \"log_level\": \"info\", \"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, \"network_interface\": \"eth0\", \"flush_connections\": true }, \"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\": \"host: api\\..+\" }, \"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\": { \"scale_down\": false } }, }, \"operator\": true, \"kubeconfig\": \"~/.kube/config\", \"sip_binaries\": \"bash\", \"telemetry\": true, \"kube_context\": \"my-cluster\" } ```\n\n# Options {#root-options}", "type": "object", "properties": { "accept_invalid_certificates": { @@ -815,7 +815,7 @@ }, "log_level": { "title": "internal_proxy.log_level {#internal_proxy-log_level}", - "description": "Set the log level for the internal proxy. RUST_LOG convention (i.e `mirrord=trace`) will only beu sed if log_destination is set", + "description": "Set the log level for the internal proxy. RUST_LOG convention (i.e `mirrord=trace`) will only be used if log_destination is set", "type": [ "string", "null" diff --git a/mirrord/config/configuration.md b/mirrord/config/configuration.md index afabc74d3a4..bfc5596c1bc 100644 --- a/mirrord/config/configuration.md +++ b/mirrord/config/configuration.md @@ -8,6 +8,9 @@ The configuration supports templating using the [Tera](https://keats.github.io/t 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 ` flag. +Or if using VSCode Extension or JetBrains plugin, simply create a `.mirrord/mirrord.json` file or use the UI. + To help you get started, here are examples of a basic configuration file, and a complete configuration file containing all fields. @@ -1044,7 +1047,7 @@ want to increase the timeouts a bit. } ``` -### internal_proxy.idle_timeout {#agent-idle_timeout} +### internal_proxy.idle_timeout {#internal_proxy-idle_timeout} How much time to wait while we don't have any active connections before exiting. @@ -1059,7 +1062,7 @@ and don't connect to the proxy. } ``` -### internal_proxy.start_idle_timeout {#agent-start_idle_timeout} +### internal_proxy.start_idle_timeout {#internal_proxy-start_idle_timeout} How much time to wait for the first connection to the proxy in seconds. @@ -1074,3 +1077,11 @@ on process execution, delaying the layer startup and connection to proxy. } ``` +### internal_proxy.log_destination {#internal_proxy-log_destination} +Set the log file destination for the internal proxy. + +### internal_proxy.log_level {#internal_proxy-log_level} +Set the log level for the internal proxy. +RUST_LOG convention (i.e `mirrord=trace`) +will only be used if log_destination is set + diff --git a/mirrord/config/src/internal_proxy.rs b/mirrord/config/src/internal_proxy.rs index eb4e5e4df96..0ab7bd7092e 100644 --- a/mirrord/config/src/internal_proxy.rs +++ b/mirrord/config/src/internal_proxy.rs @@ -58,7 +58,7 @@ pub struct InternalProxyConfig { /// ### internal_proxy.log_level {#internal_proxy-log_level} /// Set the log level for the internal proxy. /// RUST_LOG convention (i.e `mirrord=trace`) - /// will only beu sed if log_destination is set + /// will only be used if log_destination is set pub log_level: Option, /// ### internal_proxy.log_destination {#internal_proxy-log_destination} diff --git a/mirrord/config/src/lib.rs b/mirrord/config/src/lib.rs index 356ae29c3dd..d9ac619260a 100644 --- a/mirrord/config/src/lib.rs +++ b/mirrord/config/src/lib.rs @@ -51,6 +51,10 @@ const PAUSE_WITHOUT_STEAL_WARNING: &str = /// 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 ` flag. +/// Or if using VSCode Extension or JetBrains plugin, simply create a `.mirrord/mirrord.json` file +/// or use the UI. +/// /// To help you get started, here are examples of a basic configuration file, and a complete /// configuration file containing all fields. ///