mirror of https://github.com/dapr/docs.git
Merge branch 'master' into brooke/postgresdocs
This commit is contained in:
commit
60fc3386b2
|
@ -6,11 +6,13 @@ Dapr can be run in either self hosted or Kubernetes modes. Running Dapr runtime
|
|||
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Installing Dapr CLI](#installing-dapr-cli)
|
||||
- [Installing Dapr in standalone mode](#installing-dapr-in-standalone-mode)
|
||||
- [Installing Dapr in self-hosted mode](#installing-dapr-in-self-hosted-mode)
|
||||
- [Installing Dapr on Kubernetes cluster](#installing-dapr-on-a-kubernetes-cluster)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
On default Dapr will install with a developer environment using Docker containers to get you started easily. However, Dapr does not depend on Docker to run (see [here](https://github.com/dapr/cli/blob/master/README.md) for instructions on installing Dapr locally without Docker using slim init). This getting started guide assumes Dapr is installed along with this developer environment.
|
||||
|
||||
- Install [Docker](https://docs.docker.com/install/)
|
||||
|
||||
> For Windows user, ensure that `Docker Desktop For Windows` uses Linux containers.
|
||||
|
@ -61,9 +63,11 @@ Each release of Dapr CLI includes various OSes and architectures. These binary v
|
|||
|
||||
## Installing Dapr in self hosted mode
|
||||
|
||||
### Install Dapr runtime using the CLI
|
||||
### Initialize Dapr using the CLI
|
||||
|
||||
Install Dapr by running `dapr init` from a command prompt
|
||||
On default, during initialization the Dapr CLI will install the Dapr binaries as well as setup a developer environment to help you get started easily with Dapr. This environment uses Docker containers, therefore Docker is listed as a prerequisite.
|
||||
|
||||
>If you prefer to run Dapr without this environment and no dependency on Docker, see the CLI documentation for usage of the `--slim` flag with the init CLI command [here](https://github.com/dapr/cli/blob/master/README.md). Note, if you are a new user, it is strongly recommended to intall Docker and use the regular init command.
|
||||
|
||||
> For Linux users, if you run your docker cmds with sudo, you need to use "**sudo dapr init**"
|
||||
> For Windows users, make sure that you run the cmd terminal in administrator mode
|
||||
|
@ -82,7 +86,7 @@ If you prefer you can also install to an alternate location by using `--install-
|
|||
$ dapr init --install-path /home/user123/mydaprinstall
|
||||
```
|
||||
|
||||
To see that Dapr has been installed successful, from a command prompt run the `docker ps` command and check that the `daprio/dapr:latest` and `redis` container images are both running.
|
||||
To see that Dapr has been installed successfully, from a command prompt run the `docker ps` command and check that the `daprio/dapr:latest` and `redis` container images are both running.
|
||||
|
||||
### Install a specific runtime version
|
||||
|
||||
|
@ -98,9 +102,9 @@ cli version: v0.1.0
|
|||
runtime version: v0.1.0
|
||||
```
|
||||
|
||||
### Uninstall Dapr in a standalone mode
|
||||
### Uninstall Dapr in a self hosted mode
|
||||
|
||||
Uninstalling removes the Placement service container.
|
||||
Uninstalling removes the Placement service container or the Placement service binary.
|
||||
|
||||
```bash
|
||||
$ dapr uninstall
|
||||
|
@ -111,7 +115,13 @@ It won't remove the Redis or Zipkin containers by default in case you were using
|
|||
$ dapr uninstall --all
|
||||
```
|
||||
|
||||
You should always run `dapr uninstall` before running another `dapr init`.
|
||||
**You should always run `dapr uninstall` before running another `dapr init`.**
|
||||
|
||||
To specify a custom install path from which you have to uninstall run:
|
||||
|
||||
```bash
|
||||
$ dapr uninstall --install-path /path/to/binary
|
||||
```
|
||||
|
||||
## Installing Dapr on a Kubernetes cluster
|
||||
|
||||
|
@ -135,6 +145,11 @@ You can install Dapr on any Kubernetes cluster. Here are some helpful links:
|
|||
- [Setup Google Cloud Kubernetes Engine](https://cloud.google.com/kubernetes-engine/docs/quickstart)
|
||||
- [Setup Amazon Elastic Kubernetes Service](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html)
|
||||
|
||||
> **Note:** The dapr control plane containers are curently only distributed on linux containers.
|
||||
> Your kubernetes cluser must contain available Linux capable nodes.
|
||||
> Both the dapr cli, and the dapr helm chart will automatically deploy with affinity for nodes with the label kubernetes.io/os=linux.
|
||||
> For more information see [Deploying to a Hybrid Linux/Windows K8s Cluster](../howto/hybrid-clusters/)
|
||||
|
||||
### Using the Dapr CLI
|
||||
|
||||
You can install Dapr to a Kubernetes cluster using CLI.
|
||||
|
|
|
@ -89,6 +89,7 @@ For Actors How Tos see the SDK documentation
|
|||
|
||||
* [Sidecar configuration on Kubernetes](./configure-k8s)
|
||||
* [Autoscale on Kubernetes using KEDA and Dapr bindings](./autoscale-with-keda)
|
||||
* [Deploy to hybrid Linux/Windows Kubernetes clusters](./hybrid-clusters)
|
||||
|
||||
## Developer tooling
|
||||
### Using Visual Studio Code
|
||||
|
|
|
@ -60,7 +60,7 @@ We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Ku
|
|||
value: lhDOkwTlp0
|
||||
```
|
||||
|
||||
### Option 2: Creating an managed Azure Cache for Redis service
|
||||
### Option 2: Creating an Azure Cache for Redis service
|
||||
|
||||
> **Note**: This approach requires having an Azure Subscription.
|
||||
|
||||
|
@ -138,7 +138,9 @@ kubectl apply -f redis-state.yaml
|
|||
kubectl apply -f redis-pubsub.yaml
|
||||
```
|
||||
|
||||
### Standalone
|
||||
### Self Hosted Mode
|
||||
|
||||
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`.
|
||||
|
||||
If you initialized Dapr using `dapr init --slim`, the Dapr CLI did not create a Redis instance or a default configuration file for it. Follow [these instructions](#Creating-a-Redis-Store) to create a Redis store. Create the `redis.yaml` following the configuration [instructions](#Configuration) in a `components` dir and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# Deploy to hybrid Linux/Windows Kubernetes clusters
|
||||
|
||||
Deploying Dapr to a Kubernetes cluster that contains both Windows and Linux nodes has known limitiations. All Dapr control plane components must be run exclusively on Linux enabled nodes. The same is currently true for all Dapr applications. Thus when deploying to hybrid Kubernetes clusters you will need to ensure that Kubernetes knows to place your application containers exclusively on Linux enabled nodes.
|
||||
|
||||
> **Note:** Windows container support for Dapr applications is in progress. Please see: [dapr/dapr#842](https://github.com/dapr/dapr/issues/842).
|
||||
|
||||
## Installing the Dapr Control Plane
|
||||
|
||||
If you are installing using the Dapr CLI or via a helm chart, simply follow the normal deployment procedures:
|
||||
[Installing Dapr on a Kubernetes cluster](../../getting-started/environment-setup.md#installing-Dapr-on-a-kubernetes-cluster)
|
||||
|
||||
Affinity will be automatically set for kubernetes.io/os=linux. If you need to override Linux to another value, you can do so by setting:
|
||||
|
||||
```
|
||||
helm install dapr dapr/dapr --set global.daprControlPlaneOs=YOUR_OS
|
||||
```
|
||||
|
||||
Dapr control plane container images are only provided for Linux, so you shouldn't need to do this unless you really know what you are doing.
|
||||
|
||||
## Installing Dapr applications
|
||||
The Dapr sidecar container is currently Linux only. For this reason, if you are writing a Dapr application, you must run it in a Linux container.
|
||||
|
||||
When deploying to a hybrid cluster, you must configure your applications to be deployed to only Linux available nodes. One of the simplest ways to do this is to add kubernetes.io/os=linux to your app's nodeSelector.
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
```
|
||||
|
||||
## Related links
|
||||
|
||||
- See the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/) for examples of more advanced configuration via node affinity
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
# Self hosted mode without containers
|
||||
|
||||
This article provides guidance on running Dapr in self-hosted mode without Docker.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Dapr CLI](../../getting-started/environment-setup.md#installing-dapr-cli)
|
||||
|
||||
## Initialize Dapr without containers
|
||||
|
||||
The Dapr CLI provides an option to initialize Dapr using slim init, without the default creation of a development environment which has a dependency on Docker. To initialize Dapr with slim init, after installing the Dapr CLI use the following command:
|
||||
|
||||
```bash
|
||||
dapr init --slim
|
||||
```
|
||||
|
||||
In this mode two different binaries are installed `daprd` and `placement`. The `placement` binary is needed to enable [actors](../../concepts/actors/README.md) in a Dapr self-hosted installation.
|
||||
|
||||
In this mode no default components such as Redis are installed for state managment or pub/sub. This means, that aside from [Service Invocation](../../concepts/service-invocation/README.md), no other building block functionality is availble on install out of the box. Users are free to setup their own environemnt and custom components. Furthermore, actor based service invocation is possible if a statestore is configured as explained in the following sections.
|
||||
|
||||
## Service invocation
|
||||
See [this sample](https://github.com/dapr/samples/tree/master/11.hello-dapr-slim) for an example on how to perform service invocation in this mode.
|
||||
|
||||
## Enabling state management or pub/sub
|
||||
|
||||
See configuring Redis in self hosted mode [without docker](../../howto/configure-redis/README.md#Self-Hosted-Mode-without-Containers) to enable a local state store or pub/sub broker for messaging.
|
||||
|
||||
## Enabling actors
|
||||
|
||||
The placement service must be run locally to enable actor placement. Also a [transactoinal state store](#Enabling-state-management-or-pub/sub) must be enabled for actors.
|
||||
|
||||
By default for Linux/MacOS the `placement` binary is installed in `/usr/local/bin` or for Windows at `c:\dapr`.
|
||||
|
||||
```bash
|
||||
$ /usr/local/bin/placement
|
||||
|
||||
INFO[0000] starting Dapr Placement Service -- version 0.8.0 -- commit 74db927 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
INFO[0000] log level set to: info instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
INFO[0000] metrics server started on :9090/ instance=host.localhost.name scope=dapr.metrics type=log ver=0.8.0
|
||||
INFO[0000] placement Service started on port 50005 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
INFO[0000] Healthz server is listening on :8080 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
|
||||
```
|
||||
|
||||
From here on you can follow the sample example created for the [java-sdk](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/actors/http), [python-sdk](https://github.com/dapr/python-sdk/tree/master/examples/demo_actor) or [dotnet-sdk](https://github.com/dapr/dotnet-sdk/tree/master/samples/Actor) for running an application with Actors enabled.
|
||||
|
||||
Update the state store configuration files to have the Redis host and password match the setup that you have. Additionally to enable it as a actor state store have the metadata piece added similar to the [sample Java Redis component](https://github.com/dapr/java-sdk/blob/master/examples/components/redis.yaml) definition.
|
||||
|
||||
```yaml
|
||||
- name: actorStateStore
|
||||
value: "true"
|
||||
```
|
||||
|
||||
The logs of the placement service are updated whenever a host that uses actors is added or removed similar to the following output:
|
||||
|
||||
```
|
||||
INFO[0446] host added: 192.168.1.6 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
INFO[0450] host removed: 192.168.1.6 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
```
|
||||
|
||||
## Cleanup
|
||||
|
||||
Follow the uninstall [instructions](../../getting-started/environment-setup.md#Uninstall-Dapr-in-self-hosted-mode-(without-docker)) to remove the binaries.
|
Loading…
Reference in New Issue