From fe86f32e793a05fe03872638352897fbca1d19b9 Mon Sep 17 00:00:00 2001 From: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:39:35 +0530 Subject: [PATCH 01/12] adding k8s fields for dev/test env Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> --- .../multi-app-dapr-run/multi-app-template.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index 8bca3008036..7ecff8d2eea 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -86,6 +86,8 @@ apps: command: ["python3", "app.py"] appLogDestination: file # (optional), can be file, console or fileAndConsole. default is fileAndConsole. daprdLogDestination: file # (optional), can be file, console or fileAndConsole. default is file. + containerImage: ghcr.io/dapr/samples/hello-k8s-node:latest # (optional) URI of the container image to be used when deploying to Kubernetes dev/test environment. + createService: true # (optional) Create a Kubernetes service for the application when deploying to dev/test environment. - appID: backend # optional appDirPath: .dapr/backend/ # REQUIRED appProtocol: grpc @@ -145,6 +147,8 @@ The properties for the Multi-App Run template align with the `dapr run` CLI flag | `env` | N | Map to environment variable; environment variables applied per application will overwrite environment variables shared across applications | `DEBUG`, `DAPR_HOST_ADD` | | `appLogDestination` | N | Log destination for outputting app logs; Its value can be file, console or fileAndConsole. Default is fileAndConsole | `file`, `console`, `fileAndConsole` | | `daprdLogDestination` | N | Log destination for outputting daprd logs; Its value can be file, console or fileAndConsole. Default is file | `file`, `console`, `fileAndConsole` | +| `containerImage`| N | URI of the container image to be used when deploying to Kubernetes dev/test environment. | `ghcr.io/dapr/samples/hello-k8s-python:latest` +| `createService`| N | Create a Kubernetes service for the application when deploying to dev/test environment. | `true`, `false` | ## Next steps From 7a8861c674e5d1a47c799d35be2ac16582261ffd Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Mon, 11 Sep 2023 16:58:58 -0400 Subject: [PATCH 02/12] add table.html and work on multi app run overview and how to for k8s Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 47 ++++- .../multi-app-dapr-run/multi-app-template.md | 161 +++++++++++++++++- daprdocs/layouts/shortcodes/table.html | 6 + 3 files changed, 210 insertions(+), 4 deletions(-) create mode 100644 daprdocs/layouts/shortcodes/table.html diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 5fac41131e7..78fd3c27c74 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -19,11 +19,15 @@ Instead, you simply want to run them as local executables in self-hosted mode. - Remember the resources folders and configuration files that each application refers to. - Recall all of the additional flags you used to tweak the `dapr run` command behavior (`--app-health-check-path`, `--dapr-grpc-port`, `--unix-domain-socket`, etc.) +{{< tabs Self-hosted Kubernetes>}} + +{{% codetab %}} + With Multi-App Run, you can start multiple applications in self-hosted mode using a single `dapr run -f` command using a template file. The template file describes how to start multiple applications as if you had run many separate CLI `run`commands. By default, this template file is called `dapr.yaml`. ## Multi-App Run template file -When you execute `dapr run -f .`, it uses the multi-app template file (named `dapr.yaml`) present in the current directory to run all the applications. +When you execute `dapr run -f .`, it generates the multi-app template file (named `dapr.yaml`) present in the current directory to run all the applications. You can name template file with preferred name other than the default. For example `dapr run -f ./.yaml`. @@ -47,6 +51,47 @@ apps: For a more in-depth example and explanation of the template properties, see [Multi-app template]({{< ref multi-app-template.md >}}). +{{% /codetab %}} + +{{% codetab %}} + +With Multi-App Run, you can start multiple applications in a Kubernetes development or test environment using a single `dapr run -f -k` command using a template file. The template file describes how to start multiple applications as if you had run many separate CLI `run`commands. By default, this template file is called `dapr.yaml`. + +## Multi-App Run template file + +When you execute `dapr run -f .`, Dapr generates the multi-app template file (named `dapr.yaml`) in the `.dapr/deploy` directory within each application. Each time you run `dapr run -f -k .`, the generated Kubernetes Deployment YAML file is overwritten. run all the applications. + +You can name template file with preferred name other than the default. For example `dapr run -f -k ./.yaml`. + +The following example includes some of the template properties you can customize for your applications. In the example, you can simultaneously launch 2 applications with app IDs of `nodeapp` and `pythonapp`. + +```yaml +version: 1 +common: +apps: + - appID: nodeapp + appDirPath: ./nodeapp/ + appPort: 3000 + containerImage: ghcr.io/dapr/samples/hello-k8s-node:latest + createService: true + env: + APP_PORT: 3000 + - appID: pythonapp + appDirPath: ./pythonapp/ + containerImage: ghcr.io/dapr/samples/hello-k8s-python:latest +``` + +> **Note:** +> - If the `containerImage` field is not specified, `dapr run -f -k` produces an error. +> - The `createService` field defines a basic service in Kubernetes (ClusterIP or LoadBalancer) that targets the `--app-port` specified in the template. If `createService` isn't specified, the application is not accessible from outside the cluster. + +For a more in-depth example and explanation of the template properties, see [Multi-app template]({{< ref multi-app-template.md >}}). + +{{% /codetab %}} + +{{< /tabs >}} + + ## Locations for resources and configuration files You have options on where to place your applications' resources and configuration files when using Multi-App Run. diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index 7ecff8d2eea..63a291e59cd 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -26,20 +26,53 @@ When you provide a directory path, the CLI will try to locate the Multi-App Run Execute the following CLI command to read the Multi-App Run template file, named `dapr.yaml` by default: +{{< tabs Self-hosted Kubernetes>}} + +{{% codetab %}} + + ```cmd # the template file needs to be called `dapr.yaml` by default if a directory path is given dapr run -f ``` +{{% /codetab %}} + +{{% codetab %}} + + +```cmd +dapr run -f -k +``` +{{% /codetab %}} + +{{< /tabs >}} ### Execute by providing a file path If the Multi-App Run template file is named something other than `dapr.yaml`, then you can provide the relative or absolute file path to the command: +{{< tabs Self-hosted Kubernetes>}} + +{{% codetab %}} + + ```cmd dapr run -f ./path/to/.yaml ``` +{{% /codetab %}} + +{{% codetab %}} + + +```cmd +dapr run -f -k ./path/to/.yaml +``` +{{% /codetab %}} + +{{< /tabs >}} + ## View the started applications Once the multi-app template is running, you can view the started applications with the following command: @@ -52,6 +85,11 @@ dapr list Stop the multi-app run template anytime with either of the following commands: +{{< tabs Self-hosted Kubernetes>}} + +{{% codetab %}} + + ```cmd # the template file needs to be called `dapr.yaml` by default if a directory path is given @@ -63,10 +101,36 @@ or: dapr stop -f ./path/to/.yaml ``` +{{% /codetab %}} + +{{% codetab %}} + + +```cmd +# the template file needs to be called `dapr.yaml` by default if a directory path is given + +dapr stop -f -k +``` +or: + +```cmd +dapr stop -f -k ./path/to/.yaml +``` + +{{% /codetab %}} + +{{< /tabs >}} + + ## Template file structure The Multi-App Run template file can include the following properties. Below is an example template showing two applications that are configured with some of the properties. +{{< tabs Self-hosted Kubernetes>}} + +{{% codetab %}} + + ```yaml version: 1 common: # optional section for variables shared across apps @@ -86,6 +150,41 @@ apps: command: ["python3", "app.py"] appLogDestination: file # (optional), can be file, console or fileAndConsole. default is fileAndConsole. daprdLogDestination: file # (optional), can be file, console or fileAndConsole. default is file. + - appID: backend # optional + appDirPath: .dapr/backend/ # REQUIRED + appProtocol: grpc + appPort: 3000 + unixDomainSocket: "/tmp/test-socket" + env: + - DEBUG: false + command: ["./backend"] +``` + +The following rules apply for all the paths present in the template file: + - If the path is absolute, it is used as is. + - All relative paths under comman section should be provided relative to the template file path. + - `appDirPath` under apps section should be provided relative to the template file path. + - All relative paths under app section should be provided relative to the appDirPath. + +{{% /codetab %}} + +{{% codetab %}} + + +```yaml +version: 1 +common: # optional section for variables shared across apps + env: # any environment variable shared across apps + DEBUG: true +apps: + - appID: webapp # optional + appDirPath: .dapr/webapp/ # REQUIRED + appChannelAddress: 127.0.0.1 # network address where the app listens on. (optional) can be left to default value by convention. + appProtocol: http + appPort: 8080 + appHealthCheckPath: "/healthz" + appLogDestination: file # (optional), can be file, console or fileAndConsole. default is fileAndConsole. + daprdLogDestination: file # (optional), can be file, console or fileAndConsole. default is file. containerImage: ghcr.io/dapr/samples/hello-k8s-node:latest # (optional) URI of the container image to be used when deploying to Kubernetes dev/test environment. createService: true # (optional) Create a Kubernetes service for the application when deploying to dev/test environment. - appID: backend # optional @@ -95,22 +194,28 @@ apps: unixDomainSocket: "/tmp/test-socket" env: - DEBUG: false - command: ["./backend"] ``` -{{% alert title="Important" color="warning" %}} The following rules apply for all the paths present in the template file: - If the path is absolute, it is used as is. - All relative paths under comman section should be provided relative to the template file path. - `appDirPath` under apps section should be provided relative to the template file path. - All relative paths under app section should be provided relative to the appDirPath. -{{% /alert %}} +{{% /codetab %}} + +{{< /tabs >}} ## Template properties +{{< tabs Self-hosted Kubernetes>}} + +{{% codetab %}} + + The properties for the Multi-App Run template align with the `dapr run` CLI flags, [listed in the CLI reference documentation]({{< ref "dapr-run.md#flags" >}}). +{{< table "table table-white table-striped table-bordered" >}} | Properties | Required | Details | Example | |--------------------------|:--------:|--------|---------| @@ -147,9 +252,59 @@ The properties for the Multi-App Run template align with the `dapr run` CLI flag | `env` | N | Map to environment variable; environment variables applied per application will overwrite environment variables shared across applications | `DEBUG`, `DAPR_HOST_ADD` | | `appLogDestination` | N | Log destination for outputting app logs; Its value can be file, console or fileAndConsole. Default is fileAndConsole | `file`, `console`, `fileAndConsole` | | `daprdLogDestination` | N | Log destination for outputting daprd logs; Its value can be file, console or fileAndConsole. Default is file | `file`, `console`, `fileAndConsole` | + +{{< /table >}} + + +{{% /codetab %}} + +{{% codetab %}} + + +The properties for the Multi-App Run template align with the `dapr run -k` CLI flags, [listed in the CLI reference documentation]({{< ref "dapr-run.md#flags" >}}). + +{{< table "table table-white table-striped table-bordered" >}} + +| Properties | Required | Details | Example | +|--------------------------|:--------:|--------|---------| +| `appDirPath` | Y | Path to the your application code | `./webapp/`, `./backend/` | +| `appID` | N | Application's app ID. If not provided, will be derived from `appDirPath` | `webapp`, `backend` | +| `appChannelAddress` | N | The network address the application listens on. Can be left to the default value by convention. | `127.0.0.1` | `localhost` | +| `appProtocol` | N | The protocol Dapr uses to talk to the application. | `http`, `grpc` | +| `appPort` | N | The port your application is listening on | `8080`, `3000` | +| `daprHTTPPort` | N | Dapr HTTP port | | +| `daprGRPCPort` | N | Dapr GRPC port | | +| `daprInternalGRPCPort` | N | gRPC port for the Dapr Internal API to listen on; used when parsing the value from a local DNS component | | +| `metricsPort` | N | The port that Dapr sends its metrics information to | | +| `unixDomainSocket` | N | Path to a unix domain socket dir mount. If specified, communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports. Not available on Windows. | `/tmp/test-socket` | +| `profilePort` | N | The port for the profile server to listen on | | +| `enableProfiling` | N | Enable profiling via an HTTP endpoint | | +| `apiListenAddresses` | N | Dapr API listen addresses | | +| `logLevel` | N | The log verbosity. | | +| `appMaxConcurrency` | N | The concurrency level of the application; default is unlimited | | +| `placementHostAddress` | N | | | +| `appSSL` | N | Enable https when Dapr invokes the application | | +| `daprHTTPMaxRequestSize` | N | Max size of the request body in MB. | | +| `daprHTTPReadBufferSize` | N | Max size of the HTTP read buffer in KB. This also limits the maximum size of HTTP headers. The default 4 KB | | +| `enableAppHealthCheck` | N | Enable the app health check on the application | `true`, `false` | +| `appHealthCheckPath` | N | Path to the health check file | `/healthz` | +| `appHealthProbeInterval` | N | Interval to probe for the health of the app in seconds + | | +| `appHealthProbeTimeout` | N | Timeout for app health probes in milliseconds | | +| `appHealthThreshold` | N | Number of consecutive failures for the app to be considered unhealthy | | +| `enableApiLogging` | N | Enable the logging of all API calls from application to Dapr | | +| `env` | N | Map to environment variable; environment variables applied per application will overwrite environment variables shared across applications | `DEBUG`, `DAPR_HOST_ADD` | +| `appLogDestination` | N | Log destination for outputting app logs; Its value can be file, console or fileAndConsole. Default is fileAndConsole | `file`, `console`, `fileAndConsole` | +| `daprdLogDestination` | N | Log destination for outputting daprd logs; Its value can be file, console or fileAndConsole. Default is file | `file`, `console`, `fileAndConsole` | | `containerImage`| N | URI of the container image to be used when deploying to Kubernetes dev/test environment. | `ghcr.io/dapr/samples/hello-k8s-python:latest` | `createService`| N | Create a Kubernetes service for the application when deploying to dev/test environment. | `true`, `false` | +{{< /table >}} + +{{% /codetab %}} + +{{< /tabs >}} + ## Next steps Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo?t=2456): diff --git a/daprdocs/layouts/shortcodes/table.html b/daprdocs/layouts/shortcodes/table.html new file mode 100644 index 00000000000..66e1df62edc --- /dev/null +++ b/daprdocs/layouts/shortcodes/table.html @@ -0,0 +1,6 @@ +{{ $htmlTable := .Inner | markdownify }} +{{ $class := .Get 0 | default "" }} +{{ $old := "" }} +{{ $new := printf "
" $class }} +{{ $htmlTable := replace $htmlTable $old $new }} +{{ $htmlTable | safeHTML }} From 23c45f52ca631725ddd8c7d5ecf0ceb39b4636c4 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 12 Sep 2023 15:29:19 -0400 Subject: [PATCH 03/12] mark review and add demo video Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 2 +- .../multi-app-dapr-run/multi-app-template.md | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 78fd3c27c74..2322aa341cf 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -59,7 +59,7 @@ With Multi-App Run, you can start multiple applications in a Kubernetes developm ## Multi-App Run template file -When you execute `dapr run -f .`, Dapr generates the multi-app template file (named `dapr.yaml`) in the `.dapr/deploy` directory within each application. Each time you run `dapr run -f -k .`, the generated Kubernetes Deployment YAML file is overwritten. run all the applications. +When you execute `dapr run -f .`, Dapr generates the multi-app template file (named `dapr.yaml`) in the `.dapr/deploy` directory within each application. Each time you run `dapr run -f -k .`, the generated Kubernetes Deployment YAML file is overwritten. You can name template file with preferred name other than the default. For example `dapr run -f -k ./.yaml`. diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index 63a291e59cd..f8f198702d6 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -162,9 +162,9 @@ apps: The following rules apply for all the paths present in the template file: - If the path is absolute, it is used as is. - - All relative paths under comman section should be provided relative to the template file path. + - All relative paths under command section should be provided relative to the template file path. - `appDirPath` under apps section should be provided relative to the template file path. - - All relative paths under app section should be provided relative to the appDirPath. + - All relative paths under app section should be provided relative to the `appDirPath`. {{% /codetab %}} @@ -198,9 +198,8 @@ apps: The following rules apply for all the paths present in the template file: - If the path is absolute, it is used as is. - - All relative paths under comman section should be provided relative to the template file path. - `appDirPath` under apps section should be provided relative to the template file path. - - All relative paths under app section should be provided relative to the appDirPath. + - All relative paths under app section should be provided relative to the `appDirPath`. {{% /codetab %}} @@ -255,7 +254,11 @@ The properties for the Multi-App Run template align with the `dapr run` CLI flag {{< /table >}} +## Next steps + +Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo?t=2456): + {{% /codetab %}} {{% codetab %}} @@ -301,12 +304,14 @@ The properties for the Multi-App Run template align with the `dapr run -k` CLI f {{< /table >}} +## Next steps + +Watch [this video for an overview on Multi-App Run in Kubernetes](https://youtu.be/nWatANwaAik?si=O8XR-TUaiY0gclgO&t=1024): + + + {{% /codetab %}} {{< /tabs >}} -## Next steps - -Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo?t=2456): - From 2ac6bab1679609c9093e3c1f070319936ff107f5 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Wed, 13 Sep 2023 13:43:49 -0400 Subject: [PATCH 04/12] additions per mukundan Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 72 +++++++++++-------- .../content/en/reference/cli/dapr-init.md | 3 + 2 files changed, 45 insertions(+), 30 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 2322aa341cf..92aa28d1ab5 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -10,22 +10,21 @@ description: Run multiple applications with one CLI command Multi-App Run is currently a preview feature only supported in Linux/MacOS. {{% /alert %}} -Let's say you want to run several applications locally to test them together, similar to a production scenario. With a local Kubernetes cluster, you'd be able to do this with helm/deployment YAML files. You'd also have to build them as containers and set up Kubernetes, which can add some complexity. - -Instead, you simply want to run them as local executables in self-hosted mode. However, self-hosted mode requires you to: +Let's say you want to run several applications locally to test them together, similar to a production scenario. Until Multi-App Run, you'd have to: - Run multiple `dapr run` commands - Keep track of all ports opened (you cannot have duplicate ports for different applications). - Remember the resources folders and configuration files that each application refers to. - Recall all of the additional flags you used to tweak the `dapr run` command behavior (`--app-health-check-path`, `--dapr-grpc-port`, `--unix-domain-socket`, etc.) +With Multi-App Run, you can start multiple applications in either self-hosted or Kubernetes mode using a template file and running a single command. The template file describes how to start multiple applications as if you had run many separate CLI `run`commands. By default, this template file is called `dapr.yaml`. + +## Multi-App Run template file + {{< tabs Self-hosted Kubernetes>}} {{% codetab %}} -With Multi-App Run, you can start multiple applications in self-hosted mode using a single `dapr run -f` command using a template file. The template file describes how to start multiple applications as if you had run many separate CLI `run`commands. By default, this template file is called `dapr.yaml`. - -## Multi-App Run template file When you execute `dapr run -f .`, it generates the multi-app template file (named `dapr.yaml`) present in the current directory to run all the applications. @@ -51,13 +50,28 @@ apps: For a more in-depth example and explanation of the template properties, see [Multi-app template]({{< ref multi-app-template.md >}}). +## Locations for resources and configuration files + +You have options on where to place your applications' resources and configuration files when using Multi-App Run. + +### Point to one file location (with convention) + +You can set all of your applications resources and configurations at the `~/.dapr` root. This is helpful when all applications share the same resources path, like when testing on a local machine. + +### Separate file locations for each application (with convention) + +When using Multi-App Run, each application directory can have a `.dapr` folder, which contains a `config.yaml` file and a `resources` directory. Otherwise, if the `.dapr` directory is not present within the app directory, the default `~/.dapr/resources/` and `~/.dapr/config.yaml` locations are used. + +If you decide to add a `.dapr` directory in each application directory, with a `/resources` directory and `config.yaml` file, you can specify different resources paths for each application. This approach remains within convention by using the default `~/.dapr`. + +### Point to separate locations (custom) + +You can also name each app directory's `.dapr` directory something other than `.dapr`, such as, `webapp`, or `backend`. This helps if you'd like to be explicit about resource or application directory paths. + {{% /codetab %}} {{% codetab %}} -With Multi-App Run, you can start multiple applications in a Kubernetes development or test environment using a single `dapr run -f -k` command using a template file. The template file describes how to start multiple applications as if you had run many separate CLI `run`commands. By default, this template file is called `dapr.yaml`. - -## Multi-App Run template file When you execute `dapr run -f .`, Dapr generates the multi-app template file (named `dapr.yaml`) in the `.dapr/deploy` directory within each application. Each time you run `dapr run -f -k .`, the generated Kubernetes Deployment YAML file is overwritten. @@ -91,25 +105,6 @@ For a more in-depth example and explanation of the template properties, see [Mul {{< /tabs >}} - -## Locations for resources and configuration files - -You have options on where to place your applications' resources and configuration files when using Multi-App Run. - -### Point to one file location (with convention) - -You can set all of your applications resources and configurations at the `~/.dapr` root. This is helpful when all applications share the same resources path, like when testing on a local machine. - -### Separate file locations for each application (with convention) - -When using Multi-App Run, each application directory can have a `.dapr` folder, which contains a `config.yaml` file and a `resources` directory. Otherwise, if the `.dapr` directory is not present within the app directory, the default `~/.dapr/resources/` and `~/.dapr/config.yaml` locations are used. - -If you decide to add a `.dapr` directory in each application directory, with a `/resources` directory and `config.yaml` file, you can specify different resources paths for each application. This approach remains within convention by using the default `~/.dapr`. - -### Point to separate locations (custom) - -You can also name each app directory's `.dapr` directory something other than `.dapr`, such as, `webapp`, or `backend`. This helps if you'd like to be explicit about resource or application directory paths. - ## Logs The run template provides two log destination fields for each application and its associated daprd process: @@ -118,7 +113,7 @@ The run template provides two log destination fields for each application and it 2. `daprdLogDestination` : This field configures the log destination for the `daprd` process. The possible values are `console`, `file` and `fileAndConsole`. The default value is `file` where the `daprd` logs are written to a file by default. -#### Log file format +### Log file format Logs for application and `daprd` are captured in separate files. These log files are created automatically under `.dapr/logs` directory under each application directory (`appDirPath` in the template). These log file names follow the pattern seen below: @@ -127,13 +122,30 @@ Logs for application and `daprd` are captured in separate files. These log files Even if you've decided to rename your resources folder to something other than `.dapr`, the log files are written only to the `.dapr/logs` folder (created in the application directory). - ## Watch the demo +{{< tabs Self-hosted Kubernetes>}} + +{{% codetab %}} + + Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo?t=2456): +{{% /codetab %}} + +{{% codetab %}} + + +Watch [this video for an overview on Multi-App Run in Kubernetes](https://youtu.be/nWatANwaAik?si=O8XR-TUaiY0gclgO&t=1024): + + + +{{% /codetab %}} + +{{< /tabs >}} + ## Next steps - [Learn the Multi-App Run template file structure and its properties]({{< ref multi-app-template.md >}}) diff --git a/daprdocs/content/en/reference/cli/dapr-init.md b/daprdocs/content/en/reference/cli/dapr-init.md index a94c3e19a40..bdb93bf5d15 100644 --- a/daprdocs/content/en/reference/cli/dapr-init.md +++ b/daprdocs/content/en/reference/cli/dapr-init.md @@ -44,6 +44,9 @@ dapr init [flags] | N/A | DAPR_HELM_REPO_USERNAME | A username for a private Helm chart | The username required to access the private Dapr Helm chart. If it can be accessed publicly, this env variable does not need to be set| | N/A | DAPR_HELM_REPO_PASSWORD | A password for a private Helm chart |The password required to access the private Dapr Helm chart. If it can be accessed publicly, this env variable does not need to be set| | | `--container-runtime` | | `docker` | Used to pass in a different container runtime other than Docker. Supported container runtimes are: `docker`, `podman` | +| `--dev` | | | Creates Redis and Zipkin deployments when run in Kubernetes. | + + ### Examples #### Self hosted environment From eb1b1d0c354a6d36e36bb78cf1668de53165f48b Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Wed, 13 Sep 2023 13:53:14 -0400 Subject: [PATCH 05/12] formatting updates Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 92aa28d1ab5..164ffe982e5 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -19,13 +19,13 @@ Let's say you want to run several applications locally to test them together, si With Multi-App Run, you can start multiple applications in either self-hosted or Kubernetes mode using a template file and running a single command. The template file describes how to start multiple applications as if you had run many separate CLI `run`commands. By default, this template file is called `dapr.yaml`. -## Multi-App Run template file - {{< tabs Self-hosted Kubernetes>}} {{% codetab %}} +## Multi-App Run template file + When you execute `dapr run -f .`, it generates the multi-app template file (named `dapr.yaml`) present in the current directory to run all the applications. You can name template file with preferred name other than the default. For example `dapr run -f ./.yaml`. @@ -68,12 +68,37 @@ If you decide to add a `.dapr` directory in each application directory, with a ` You can also name each app directory's `.dapr` directory something other than `.dapr`, such as, `webapp`, or `backend`. This helps if you'd like to be explicit about resource or application directory paths. +## Logs + +The run template provides two log destination fields for each application and its associated daprd process: + +1. `appLogDestination` : This field configures the log destination for the application. The possible values are `console`, `file` and `fileAndConsole`. The default value is `fileAndConsole` where application logs are written to both console and to a file by default. + +1. `daprdLogDestination` : This field configures the log destination for the `daprd` process. The possible values are `console`, `file` and `fileAndConsole`. The default value is `file` where the `daprd` logs are written to a file by default. + +### Log file format + +Logs for application and `daprd` are captured in separate files. These log files are created automatically under `.dapr/logs` directory under each application directory (`appDirPath` in the template). These log file names follow the pattern seen below: + +- `_app_.log` (file name format for `app` log) +- `_daprd_.log` (file name format for `daprd` log) + +Even if you've decided to rename your resources folder to something other than `.dapr`, the log files are written only to the `.dapr/logs` folder (created in the application directory). + +## Watch the demo + +Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo?t=2456): + + + {{% /codetab %}} {{% codetab %}} -When you execute `dapr run -f .`, Dapr generates the multi-app template file (named `dapr.yaml`) in the `.dapr/deploy` directory within each application. Each time you run `dapr run -f -k .`, the generated Kubernetes Deployment YAML file is overwritten. +## Multi-App Run template file + +When you execute `dapr run -f -k .`, Dapr generates the multi-app template file (named `dapr.yaml`) in the `.dapr/deploy` directory within each application. Each time you run `dapr run -f -k .`, the generated Kubernetes Deployment YAML file is overwritten. You can name template file with preferred name other than the default. For example `dapr run -f -k ./.yaml`. @@ -101,10 +126,6 @@ apps: For a more in-depth example and explanation of the template properties, see [Multi-app template]({{< ref multi-app-template.md >}}). -{{% /codetab %}} - -{{< /tabs >}} - ## Logs The run template provides two log destination fields for each application and its associated daprd process: @@ -124,20 +145,6 @@ Even if you've decided to rename your resources folder to something other than ` ## Watch the demo -{{< tabs Self-hosted Kubernetes>}} - -{{% codetab %}} - - -Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo?t=2456): - - - -{{% /codetab %}} - -{{% codetab %}} - - Watch [this video for an overview on Multi-App Run in Kubernetes](https://youtu.be/nWatANwaAik?si=O8XR-TUaiY0gclgO&t=1024): From efd0ef6a772099a6b50d2a8ea588b68fc0a9c9a0 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Mon, 18 Sep 2023 13:49:15 -0400 Subject: [PATCH 06/12] update per mukundan Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 164ffe982e5..0d34e9bc2e0 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -98,9 +98,29 @@ Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo ## Multi-App Run template file -When you execute `dapr run -f -k .`, Dapr generates the multi-app template file (named `dapr.yaml`) in the `.dapr/deploy` directory within each application. Each time you run `dapr run -f -k .`, the generated Kubernetes Deployment YAML file is overwritten. +Generate the multi-app template file (`dapr.yaml`) by running one of the following commands: -You can name template file with preferred name other than the default. For example `dapr run -f -k ./.yaml`. +```bash +dapr run -k -f . +``` + +Or + +```bash +dapr run -k -f dapr.yaml +``` + +The necessary default service and deployment definitions for Kubernetes are generated within the `.dapr/deploy` folder for each app in the `dapr.yaml` template. + +If the `createService` field is present in the `dapr.yaml` template and set to `true`, then the `service.yaml` file(s): +- Generate in the `.dapr/deploy` folder of each app in the multi-app run template +- Are used to deploy the applications in a dev/test environment in K8s + +You can name the template file with any preferred name other than the default. For example: + +```bash +dapr run -k -f ./.yaml +``` The following example includes some of the template properties you can customize for your applications. In the example, you can simultaneously launch 2 applications with app IDs of `nodeapp` and `pythonapp`. @@ -121,7 +141,7 @@ apps: ``` > **Note:** -> - If the `containerImage` field is not specified, `dapr run -f -k` produces an error. +> - If the `containerImage` field is not specified, `dapr run -k -f` produces an error. > - The `createService` field defines a basic service in Kubernetes (ClusterIP or LoadBalancer) that targets the `--app-port` specified in the template. If `createService` isn't specified, the application is not accessible from outside the cluster. For a more in-depth example and explanation of the template properties, see [Multi-app template]({{< ref multi-app-template.md >}}). From c533e13b56779d1934119c7242e50c52e85646c5 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Wed, 20 Sep 2023 17:12:09 -0400 Subject: [PATCH 07/12] mukundan review Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 0d34e9bc2e0..e0d6c5511d9 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -26,7 +26,7 @@ With Multi-App Run, you can start multiple applications in either self-hosted or ## Multi-App Run template file -When you execute `dapr run -f .`, it generates the multi-app template file (named `dapr.yaml`) present in the current directory to run all the applications. +When you execute `dapr run -f .`, it starts the multi-app template file (named `dapr.yaml`) present in the current directory to run all the applications. You can name template file with preferred name other than the default. For example `dapr run -f ./.yaml`. @@ -98,23 +98,15 @@ Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo ## Multi-App Run template file -Generate the multi-app template file (`dapr.yaml`) by running one of the following commands: +When you execute `dapr run -k -f .` or `dapr run -k -f dapr.yaml`, the applications defined in the `dapr.yaml` multi-app run template file will start in Kubernetes default namespace. -```bash -dapr run -k -f . -``` +The necessary default service and deployment definitions for Kubernetes are generated within the `.dapr/deploy` folder for each app in the `dapr.yaml` template. -Or +If the `createService` field is set to `true` in the `dapr.yaml` template for an app, then the `service.yaml` file is generated in the `.dapr/deploy` folder of the app. -```bash -dapr run -k -f dapr.yaml -``` - -The necessary default service and deployment definitions for Kubernetes are generated within the `.dapr/deploy` folder for each app in the `dapr.yaml` template. +Otherwise, only the `deployment.yaml` file is generated for each app that has the `containerImage` field set. -If the `createService` field is present in the `dapr.yaml` template and set to `true`, then the `service.yaml` file(s): -- Generate in the `.dapr/deploy` folder of each app in the multi-app run template -- Are used to deploy the applications in a dev/test environment in K8s +The files `service.yaml` and `deployment.yaml` are used to deploy the applications in `default` namespace in Kubernetes. This feature is specifically targeted only for running multiple apps in a dev/test environment in Kubernetes. You can name the template file with any preferred name other than the default. For example: From 71a303d5a068af4d97ed393fecac9c7758392d82 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Fri, 22 Sep 2023 14:08:58 -0400 Subject: [PATCH 08/12] mark review pt1 Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 9 ++++----- .../multi-app-dapr-run/multi-app-template.md | 2 +- daprdocs/content/en/reference/cli/dapr-run.md | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index e0d6c5511d9..6535d6db628 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -6,10 +6,6 @@ weight: 1000 description: Run multiple applications with one CLI command --- -{{% alert title="Note" color="primary" %}} - Multi-App Run is currently a preview feature only supported in Linux/MacOS. -{{% /alert %}} - Let's say you want to run several applications locally to test them together, similar to a production scenario. Until Multi-App Run, you'd have to: - Run multiple `dapr run` commands @@ -98,6 +94,8 @@ Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo ## Multi-App Run template file +> **Note:** Multi-App Run in Kubernetes is currently a preview feature only supported in Linux/MacOS. + When you execute `dapr run -k -f .` or `dapr run -k -f dapr.yaml`, the applications defined in the `dapr.yaml` multi-app run template file will start in Kubernetes default namespace. The necessary default service and deployment definitions for Kubernetes are generated within the `.dapr/deploy` folder for each app in the `dapr.yaml` template. @@ -168,4 +166,5 @@ Watch [this video for an overview on Multi-App Run in Kubernetes](https://youtu. ## Next steps - [Learn the Multi-App Run template file structure and its properties]({{< ref multi-app-template.md >}}) -- [Try out the Multi-App Run template with the Service Invocation quickstart]({{< ref serviceinvocation-quickstart.md >}}) \ No newline at end of file +- [Try out the self-hosted Multi-App Run template with the Service Invocation quickstart]({{< ref serviceinvocation-quickstart.md >}}) +- [Try out the Kubernetes Multi-App Run template with the `hello-kubernetes` tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/hello-kubernetes) \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index f8f198702d6..fc4c3a5605c 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -7,7 +7,7 @@ description: Unpack the Multi-App Run template file and its properties --- {{% alert title="Note" color="primary" %}} - Multi-App Run is currently a preview feature only supported in Linux/MacOS. + Multi-App Run for Kubernetes is currently a preview feature only supported in Linux/MacOS. {{% /alert %}} The Multi-App Run template file is a YAML file that you can use to run multiple applications at once. In this guide, you'll learn how to: diff --git a/daprdocs/content/en/reference/cli/dapr-run.md b/daprdocs/content/en/reference/cli/dapr-run.md index 9a519f98c72..ba79d761fed 100644 --- a/daprdocs/content/en/reference/cli/dapr-run.md +++ b/daprdocs/content/en/reference/cli/dapr-run.md @@ -23,6 +23,7 @@ dapr run [flags] [command] | Name | Environment Variable | Default | Description | | ------------------------------ | -------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `--kubernetes`, `-k` | | | Running Dapr on Kubernetes, and used for [Multi-App Run template files on Kubernetes]({{< ref multi-app-dapr-run >}}). | | `--app-id`, `-a` | `APP_ID` | | The id for your application, used for service discovery. Cannot contain dots. | | `--app-max-concurrency` | | `unlimited` | The concurrency level of the application; default is unlimited | | `--app-port`, `-p` | `APP_PORT` | | The port your application is listening on | From b5d74ff4ebeac723641bbe5c973204c1823bfb26 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Fri, 22 Sep 2023 14:24:12 -0400 Subject: [PATCH 09/12] update intro Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 6535d6db628..bc6e2db6af0 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -6,14 +6,12 @@ weight: 1000 description: Run multiple applications with one CLI command --- -Let's say you want to run several applications locally to test them together, similar to a production scenario. Until Multi-App Run, you'd have to: +Let's say you want to run several applications locally to test them together, similar to a production scenario. Multi-App Run allows you to start and stop a set of applications simultaneously, either: +- Locally/self-hosted with processes, or +- By building container images and deploying to a Kubernetes cluster + - You can use a local Kubernetes cluster (KiND) or one deploy to a Cloud (AKS, EKS, and GKE). -- Run multiple `dapr run` commands -- Keep track of all ports opened (you cannot have duplicate ports for different applications). -- Remember the resources folders and configuration files that each application refers to. -- Recall all of the additional flags you used to tweak the `dapr run` command behavior (`--app-health-check-path`, `--dapr-grpc-port`, `--unix-domain-socket`, etc.) - -With Multi-App Run, you can start multiple applications in either self-hosted or Kubernetes mode using a template file and running a single command. The template file describes how to start multiple applications as if you had run many separate CLI `run`commands. By default, this template file is called `dapr.yaml`. +The Multi-App Run template file describes how to start multiple applications as if you had run many separate CLI `run` commands. By default, this template file is called `dapr.yaml`. {{< tabs Self-hosted Kubernetes>}} @@ -96,7 +94,7 @@ Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo > **Note:** Multi-App Run in Kubernetes is currently a preview feature only supported in Linux/MacOS. -When you execute `dapr run -k -f .` or `dapr run -k -f dapr.yaml`, the applications defined in the `dapr.yaml` multi-app run template file will start in Kubernetes default namespace. +When you execute `dapr run -k -f .` or `dapr run -k -f dapr.yaml`, the applications defined in the `dapr.yaml` multi-app run template file starts in Kubernetes default namespace. The necessary default service and deployment definitions for Kubernetes are generated within the `.dapr/deploy` folder for each app in the `dapr.yaml` template. From 184af4141a23174c4fbc9be2478f81d461b3d0e1 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Fri, 22 Sep 2023 14:26:21 -0400 Subject: [PATCH 10/12] update preview features table Signed-off-by: Hannah Hunter --- .../content/en/operations/support/support-preview-features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index 64d7fa1844f..2c96fd5f5cc 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -17,7 +17,7 @@ For CLI there is no explicit opt-in, just the version that this was first made a | --- | --- | --- | --- | --- | | **Streaming for HTTP service invocation** | Enables (partial) support for using streams in HTTP service invocation; see below for more details. | `ServiceInvocationStreaming` | [Details]({{< ref "support-preview-features.md#streaming-for-http-service-invocation" >}}) | v1.10 | | **Pluggable components** | Allows creating self-hosted gRPC-based components written in any language that supports gRPC. The following component APIs are supported: State stores, Pub/sub, Bindings | N/A | [Pluggable components concept]({{}})| v1.9 | -| **Multi-App Run** | Configure multiple Dapr applications from a single configuration file and run from a single command | `dapr run -f` | [Multi-App Run]({{< ref multi-app-dapr-run.md >}}) | v1.10 | +| **Multi-App Run for Kubernetes** | Configure multiple Dapr applications from a single configuration file and run from a single command on Kubernetes | `dapr run -k -f` | [Multi-App Run]({{< ref multi-app-dapr-run.md >}}) | v1.10 | | **Workflows** | Author workflows as code to automate and orchestrate tasks within your application, like messaging, state management, and failure handling | N/A | [Workflows concept]({{< ref "components-concept#workflows" >}})| v1.10 | | **Cryptography** | Encrypt or decrypt data without having to manage secrets keys | N/A | [Cryptography concept]({{< ref "components-concept#cryptography" >}})| v1.11 | | **Service invocation for non-Dapr endpoints** | Allow the invocation of non-Dapr endpoints by Dapr using the [Service invocation API]({{< ref service_invocation_api.md >}}). Read ["How-To: Invoke Non-Dapr Endpoints using HTTP"]({{< ref howto-invoke-non-dapr-endpoints.md >}}) for more information. | N/A | [Service invocation API]({{< ref service_invocation_api.md >}}) | v1.11 | From dbb729cb1c3554aa2cad5afcad8fde440ff46385 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Fri, 22 Sep 2023 14:30:48 -0400 Subject: [PATCH 11/12] add note about restriction, move note Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 8 ++++++-- .../multi-app-dapr-run/multi-app-template.md | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index bc6e2db6af0..64283705de6 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -6,6 +6,10 @@ weight: 1000 description: Run multiple applications with one CLI command --- +{{% alert title="Note" color="primary" %}} + Multi-App Run for **Kubernetes** is currently a preview feature only supported in Linux/MacOS. +{{% /alert %}} + Let's say you want to run several applications locally to test them together, similar to a production scenario. Multi-App Run allows you to start and stop a set of applications simultaneously, either: - Locally/self-hosted with processes, or - By building container images and deploying to a Kubernetes cluster @@ -92,9 +96,9 @@ Watch [this video for an overview on Multi-App Run](https://youtu.be/s1p9MNl4VGo ## Multi-App Run template file -> **Note:** Multi-App Run in Kubernetes is currently a preview feature only supported in Linux/MacOS. +When you execute `dapr run -k -f .` or `dapr run -k -f dapr.yaml`, the applications defined in the `dapr.yaml` Multi-App Run template file starts in Kubernetes default namespace. -When you execute `dapr run -k -f .` or `dapr run -k -f dapr.yaml`, the applications defined in the `dapr.yaml` multi-app run template file starts in Kubernetes default namespace. +> **Note:** Currently, the Multi-App Run template can only start applications in the default Kubernetes namespace. The necessary default service and deployment definitions for Kubernetes are generated within the `.dapr/deploy` folder for each app in the `dapr.yaml` template. diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index fc4c3a5605c..81cb228e87a 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -7,7 +7,7 @@ description: Unpack the Multi-App Run template file and its properties --- {{% alert title="Note" color="primary" %}} - Multi-App Run for Kubernetes is currently a preview feature only supported in Linux/MacOS. + Multi-App Run for **Kubernetes** is currently a preview feature only supported in Linux/MacOS. {{% /alert %}} The Multi-App Run template file is a YAML file that you can use to run multiple applications at once. In this guide, you'll learn how to: From cf9fa335dec8c922d06fa5323c076e275647da79 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Mon, 25 Sep 2023 08:44:29 -0400 Subject: [PATCH 12/12] updates from mark/mukundan Signed-off-by: Hannah Hunter --- .../multi-app-dapr-run/multi-app-overview.md | 2 +- .../multi-app-dapr-run/multi-app-template.md | 2 +- daprdocs/content/en/reference/cli/dapr-run.md | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md index 64283705de6..50c3e8e32dc 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-overview.md @@ -7,7 +7,7 @@ description: Run multiple applications with one CLI command --- {{% alert title="Note" color="primary" %}} - Multi-App Run for **Kubernetes** is currently a preview feature only supported in Linux/MacOS. + Multi-App Run for **Kubernetes** is currently a preview feature. {{% /alert %}} Let's say you want to run several applications locally to test them together, similar to a production scenario. Multi-App Run allows you to start and stop a set of applications simultaneously, either: diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index 81cb228e87a..19cedc31dec 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -7,7 +7,7 @@ description: Unpack the Multi-App Run template file and its properties --- {{% alert title="Note" color="primary" %}} - Multi-App Run for **Kubernetes** is currently a preview feature only supported in Linux/MacOS. + Multi-App Run for **Kubernetes** is currently a preview feature. {{% /alert %}} The Multi-App Run template file is a YAML file that you can use to run multiple applications at once. In this guide, you'll learn how to: diff --git a/daprdocs/content/en/reference/cli/dapr-run.md b/daprdocs/content/en/reference/cli/dapr-run.md index ba79d761fed..b6fed8a8265 100644 --- a/daprdocs/content/en/reference/cli/dapr-run.md +++ b/daprdocs/content/en/reference/cli/dapr-run.md @@ -23,7 +23,6 @@ dapr run [flags] [command] | Name | Environment Variable | Default | Description | | ------------------------------ | -------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `--kubernetes`, `-k` | | | Running Dapr on Kubernetes, and used for [Multi-App Run template files on Kubernetes]({{< ref multi-app-dapr-run >}}). | | `--app-id`, `-a` | `APP_ID` | | The id for your application, used for service discovery. Cannot contain dots. | | `--app-max-concurrency` | | `unlimited` | The concurrency level of the application; default is unlimited | | `--app-port`, `-p` | `APP_PORT` | | The port your application is listening on | @@ -51,6 +50,7 @@ dapr run [flags] [command] | `--unix-domain-socket`, `-u` | | | Path to a unix domain socket dir mount. If specified, communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports. Not available on Windows. | | `--dapr-http-max-request-size` | | `4` | Max size of the request body in MB. | | `--dapr-http-read-buffer-size` | | `4` | Max size of the HTTP read buffer in KB. This also limits the maximum size of HTTP headers. The default 4 KB | +| `--kubernetes`, `-k` | | | Running Dapr on Kubernetes, and used for [Multi-App Run template files on Kubernetes]({{< ref multi-app-dapr-run >}}). | | `--components-path`, `-d` | | Linux/Mac: `$HOME/.dapr/components`
Windows: `%USERPROFILE%\.dapr\components` | **Deprecated** in favor of `--resources-path` | ### Examples @@ -82,4 +82,10 @@ dapr run --app-id myapp --app-port 3000 --enable-api-logging -- node myapp.js # Pass multiple resource paths dapr run --app-id myapp --resources-path path1 --resources-path path2 -``` + +# Run the multi-app run template file +dapr run -f dapr.yaml + +# Run the multi-app run template file on Kubernetes +dapr run -k -f dapr.yaml +``` \ No newline at end of file