mirror of https://github.com/dapr/docs.git
add components-path references (#626)
* add components-path references * address comments * nits
This commit is contained in:
parent
7232249721
commit
61cb0f6c7b
|
@ -126,4 +126,5 @@ kubectl apply -f redis-pubsub.yaml
|
|||
|
||||
### Standalone
|
||||
|
||||
By default the Dapr CLI creates a local Redis instance when you run `dapr init`. However, if you want to configure a different Redis instance, create a directory named `components` in the root path of your Dapr binary and then copy your `redis.yaml` into that directory.
|
||||
By default the Dapr CLI creates a local Redis instance when you run `dapr init`. However, if you want to configure a different Redis instance, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ Dapr provides different implementation of the underlying system, and allows oper
|
|||
The first step is to setup the Pub/Sub component.
|
||||
For this guide, we'll use Redis Streams, which is also installed by default on a local machine when running `dapr init`.
|
||||
|
||||
*Note: When running Dapr locally, a pub/sub component YAML will automatically be created if it doesn't exist in a directory called `components` in your current working directory.*
|
||||
*Note: When running Dapr locally, a pub/sub component YAML is automatically created for you locally. To override, create a `components` directory containing the file and use the flag `--components-path` with the `dapr run` CLI command.*
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
|
|
@ -11,7 +11,7 @@ Dapr provides different implementation of the underlying system, and allows oper
|
|||
The first step is to setup the Pub/Sub component.
|
||||
For this guide, we'll use Redis Streams, which is also installed by default on a local machine when running `dapr init`.
|
||||
|
||||
*Note: When running Dapr locally, a pub/sub component YAML will automatically be created if it doesn't exist in a directory called `components` in your current working directory.*
|
||||
*Note: When running Dapr locally, a pub/sub component YAML is automatically created for you locally. To override, create a `components` directory containing the file and use the flag `--components-path` with the `dapr run` CLI command.*
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
|
|
@ -9,7 +9,8 @@ An output binding represents a resource that Dapr will use invoke and send messa
|
|||
|
||||
For the purpose of this guide, we'll use a Kafka binding. You can find a list of the different binding specs [here](../../concepts/bindings/README.md).
|
||||
|
||||
Create the following YAML file, named binding.yaml, and save this to the /components sub-folder in your application directory.
|
||||
Create the following YAML file, named binding.yaml, and save this to a `components` sub-folder in your application directory.
|
||||
(Use the `--components-path` flag with `dapr run` to point to your custom components dir)
|
||||
|
||||
*Note: When running in Kubernetes, apply this file to your cluster using `kubectl apply -f binding.yaml`*
|
||||
|
||||
|
|
|
@ -42,5 +42,4 @@ kubectl apply -f eventhubs.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Azure Event Hubs, replace the contents of `pubsub.yaml` (or `messagebus.yaml` for Dapr < 0.6.0) file with the contents of `eventhubs.yaml` above (Don't change the filename).
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -47,5 +47,4 @@ kubectl apply -f azuresb.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Azure Service Bus, replace the contents of `pubsub.yaml` (or `messagebus.yaml` for Dapr < 0.6.0) file with the contents of `azuresb.yaml` above (Don't change the filename).
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -70,4 +70,4 @@ kubectl apply -f messagebus.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory. To use Cloud Pubsub, replace the contents of `pubsub.yaml` (or `messagebus.yaml` for Dapr < 0.6.0) file with the contents of yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -48,5 +48,4 @@ kubectl apply -f hazelcast.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Hazelcast, replace the `pubsub.yaml` (or `messagebus.yaml` for Dapr < 0.6.0) file with the hazelcast.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -53,5 +53,4 @@ kubectl apply -f kafka.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Kafka, replace the `pubsub.yaml` (or `messagebus.yaml` for Dapr < 0.6.0) file with the kafka.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -109,6 +109,5 @@ kubectl apply -f mqtt.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
To use MQTT, replace the contents of `pubsub.yaml` file with the contents of `mqtt.yaml` above (Don't change the filename).
|
||||
|
|
|
@ -58,5 +58,4 @@ kubectl apply -f nats.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use NATS, replace the contents of `pubsub.yaml` (or `messagebus.yaml` for Dapr < 0.6.0) file with the contents of `nats.yaml` above (Don't change the filename).
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -45,4 +45,5 @@ To apply the Pulsar pub/sub to Kubernetes, use the kubectl CLI:
|
|||
`` kubectl apply -f pulsar.yaml ``
|
||||
|
||||
### Running locally ###
|
||||
The Dapr CLI will automatically create a directory named components in your current working directory with a Redis component. To use Pulsar, replace the pubsub.yaml (or messagebus.yaml for Dapr < 0.6.0) file with the pulsar.yaml above.
|
||||
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -72,5 +72,4 @@ kubectl apply -f rabbitmq.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use RabbitMQ, replace the contents of `pubsub.yaml` (or `messagebus.yaml` for Dapr < 0.6.0) file with the contents of `rabbitmq.yaml` above (Don't change the filename).
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -6,8 +6,8 @@ Dapr can use any Redis instance - containerized, running on your local dev machi
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create and setup a Redis Streams instance for you when you.
|
||||
The Redis instance will be installed via Docker when you run `dapr init`, and the component file will be setup with `dapr run`.
|
||||
The Dapr CLI will automatically create and setup a Redis Streams instance for you.
|
||||
The Redis instance will be installed via Docker when you run `dapr init`, and the component file will be created in default directory. (`$HOME/.dapr/components` directory (Mac/Linux) or `%USERPROFILE%\.dapr\components` on Windows).
|
||||
|
||||
### Creating a Redis instance in your Kubernetes Cluster using Helm
|
||||
|
||||
|
@ -82,4 +82,4 @@ kubectl apply -f pubsub.yaml
|
|||
|
||||
### Standalone
|
||||
|
||||
By default the Dapr CLI creates a local Redis instance when you run `dapr init`. When you run an app using `dapr run`, the component file will automatically be created for you in a `components` dir in your current working directory.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -33,7 +33,7 @@ To deploy in Kubernetes, save the file above to `aws_secret_manager.yaml` and th
|
|||
kubectl apply -f aws_secret_manager.yaml
|
||||
```
|
||||
|
||||
When running in self hosted mode, place this file in a `components` directory under the Dapr working directory.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
## AWS Secret Manager reference example
|
||||
|
||||
|
|
|
@ -98,8 +98,6 @@ This section walks you through how to enable an Azure Key Vault secret store to
|
|||
|
||||
1. Create a components directory in your application root
|
||||
|
||||
All Dapr components are stored in a directory called 'components' below at application root. Create this directory.
|
||||
|
||||
```bash
|
||||
mkdir components
|
||||
```
|
||||
|
@ -129,6 +127,8 @@ spec:
|
|||
value : "[pfx_certificate_file_local_path]"
|
||||
```
|
||||
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
4. Store redisPassword secret to keyvault
|
||||
|
||||
```bash
|
||||
|
|
|
@ -45,7 +45,7 @@ To deploy in Kubernetes, save the file above to `gcp_secret_manager.yaml` and th
|
|||
kubectl apply -f gcp_secret_manager.yaml
|
||||
```
|
||||
|
||||
When running in self hosted mode, place this file in a `components` directory under the Dapr working directory.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
## GCP Secret Manager reference example
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ To deploy in Kubernetes, save the file above to `vault.yaml` and then run:
|
|||
kubectl apply -f vault.yaml
|
||||
```
|
||||
|
||||
When running in self hosted mode, place this file in a `components` directory from the Dapr working directory.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
## Vault reference example
|
||||
|
||||
|
|
|
@ -64,5 +64,4 @@ kubectl apply -f aerospike.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Aerospike, replace the redis.yaml file with the aerospike.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -75,8 +75,7 @@ kubectl apply -f cosmos.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use CosmosDB, replace the redis.yaml file with cosmos.yaml file above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
## Partition keys
|
||||
|
||||
|
|
|
@ -70,8 +70,7 @@ kubectl apply -f azuretable.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Azure Table Storage, replace the redis.yaml file with azuretable.yaml file above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
## Partitioning
|
||||
|
||||
|
|
|
@ -97,5 +97,4 @@ kubectl apply -f cassandra.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Cassandra, replace the redis.yaml file with the cassandra.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -88,5 +88,4 @@ kubectl apply -f consul.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Consul, replace the redis.yaml file with the consul.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -60,5 +60,4 @@ kubectl apply -f couchbase.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Couchbase, replace the redis.yaml file with the couchbase.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -64,5 +64,4 @@ kubectl apply -f etcd.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use etcd, replace the redis.yaml file with the etcd.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -64,5 +64,4 @@ kubectl apply -f firestore.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Firestore, replace the redis.yaml file with firestore.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -50,5 +50,4 @@ kubectl apply -f hazelcast.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Hazelcast, replace the redis.yaml file with the hazelcast.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -63,5 +63,4 @@ kubectl apply -f memcached.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Memcached, replace the redis.yaml file with the memcached.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -101,5 +101,4 @@ kubectl apply -f mongodb.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use MongoDB, replace the redis.yaml file with the mongodb.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -90,4 +90,4 @@ kubectl apply -f redis.yaml
|
|||
|
||||
### Standalone
|
||||
|
||||
By default the Dapr CLI creates a local Redis instance when you run `dapr init`. When you run an app using `dapr run`, the component file will automatically be created for you in a `components` dir in your current working directory.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -76,5 +76,4 @@ kubectl apply -f sqlserver.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use SQL Server, replace the redis.yaml file with sqlserver.yaml file above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -68,5 +68,4 @@ kubectl apply -f zookeeper.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||
To use Zookeeper, replace the redis.yaml file with the zookeeper.yaml above.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
|
|
@ -20,7 +20,8 @@ An input binding represents an event resource that Dapr uses to read events from
|
|||
|
||||
For the purpose of this HowTo, we'll use a Kafka binding. You can find a list of the different binding specs [here](../../reference/specs/bindings/README.md).
|
||||
|
||||
Create the following YAML file, named binding.yaml, and save this to the /components sub-folder in your application directory:
|
||||
Create the following YAML file, named binding.yaml, and save this to a `components` sub-folder in your application directory.
|
||||
(Use the `--components-path` flag with `dapr run` to point to your custom components dir)
|
||||
|
||||
*Note: When running in Kubernetes, apply this file to your cluster using `kubectl apply -f binding.yaml`*
|
||||
|
||||
|
|
|
@ -80,7 +80,8 @@ Furthermore, Dapr can be integrated with any developer framework. For example, i
|
|||
|
||||
Dapr can be configured to run on your local developer machine in [self hosted mode](../getting-started). Each running service has a Dapr runtime process (or sidecar) which is configured to use state stores, pub/sub, binding components and the other building blocks.
|
||||
|
||||
In self hosted mode, Redis running locally in a container, is installed as the both a default a state store and pub/sub message bus components. See the local Components folder for the yaml files.
|
||||
In self hosted mode, Redis is running locally in a container and is configured to server as both the default state store and pub/sub.
|
||||
After running `dapr init`, see the `$HOME/.dapr/components` directory (Mac/Linux) or `%USERPROFILE%\.dapr\components` on Windows.
|
||||
|
||||
The `dapr-placement` service is responsible for managing the actor distribution scheme and key range settings. This service is only required if you are using Dapr actors. For more information on the actor `Placement` service read [actor overview](../concepts/actors).
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ Terminology used below:
|
|||
- Dapr CLI - the Dapr command line tool. The binary name is dapr (dapr.exe on Windows)
|
||||
- Dapr runtime - this runs alongside each app. The binary name is daprd (daprd.exe on Windows)
|
||||
|
||||
In self hosting mode, running `dapr init` copies the Dapr runtime onto your box and starts the placement service (used for actors) and Redis in containers. These must be present before running `dapr run`. The Dapr CLI also creates the default components directory which for Linux/MacOS is: `$HOME\.dapr\components` and for Windows: %USERPROFILE%\.dapr\components if it does not already exist.
|
||||
In self hosting mode, running `dapr init` copies the Dapr runtime onto your box and starts the placement service (used for actors) and Redis in containers. These must be present before running `dapr run`. The Dapr CLI also creates the default components directory which for Linux/MacOS is: `$HOME/.dapr/components` and for Windows: `%USERPROFILE%\.dapr\components` if it does not already exist.
|
||||
|
||||
What happens when `dapr run` is executed?
|
||||
|
||||
|
@ -15,11 +15,12 @@ What happens when `dapr run` is executed?
|
|||
dapr run --app-id nodeapp --app-port 3000 --port 3500 node app.js
|
||||
```
|
||||
|
||||
First, the Dapr CLI uses the default components directory to write two component files representing the default state store and the default pub/sub bus: `statestore.yaml` and `pubsub.yaml`, respectively. [Code](https://github.com/dapr/cli/blob/51b99a988c4d1545fdc04909d6308be121a7fe0c/pkg/standalone/run.go#L196-L266).
|
||||
First, the Dapr CLI loads the components from the default directory (specified above) for the state store and pub/sub: `statestore.yaml` and `pubsub.yaml`, respectively. [Code](https://github.com/dapr/cli/blob/51b99a988c4d1545fdc04909d6308be121a7fe0c/pkg/standalone/run.go#L196-L266).
|
||||
|
||||
*Note as of this writing (Dec 2019) the names have been changed to `statestore.yaml` and `messagebus.yaml` in the master branch, but this change is not in the latest release, 0.3.0*.
|
||||
You can either add components to the default directory or create your own `components` directory and provide the path to the CLI using the `--components-path` flag.
|
||||
|
||||
yaml files in components directory contains configuration for various Dapr components (e.g. statestore, pubsub, bindings etc.). The components must be created prior to using them with Dapr, for example, redis is launched as a container when running dapr init. If these component files already exist, they are not overwritten. This means you could overwrite `statestore.yaml`, which by default uses Redis, with a content for a different statestore (e.g. Mongo) and the latter would be what gets used. If you did this and ran `dapr run` again, the Dapr runtime would use the specified Mongo state store.
|
||||
In order to switch components, simply replace or add the YAML files in the components directory and run `dapr run` again.
|
||||
For example, by default Dapr will use the Redis state store in the default components dir. You can either override it with a different YAML, or supply your own components path.
|
||||
|
||||
Then, the Dapr CLI will [launch](https://github.com/dapr/cli/blob/d585612185a4a525c05fb62b86e288ccad510006/pkg/standalone/run.go#L290) two proceses: the Dapr runtime and your app (in this sample `node app.js`).
|
||||
|
||||
|
|
Loading…
Reference in New Issue