Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Dapr Shared Docs #4121

Merged
merged 75 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
2aae78a
initial dapr shared
salaboy Apr 29, 2024
71161c7
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
c4141e5
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
122de7f
Update daprdocs/content/en/operations/dapr-shared/_index.md
salaboy May 2, 2024
7f5b0b0
Update daprdocs/content/en/operations/dapr-shared/_index.md
salaboy May 2, 2024
97c8cb5
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
82de23b
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
da6ec97
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
ce0d6b8
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
c161d7e
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
b664f95
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
96570e0
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
2f58aae
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
4025856
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
6f142b3
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
bac9e09
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 2, 2024
0a95864
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 7, 2024
a56f11d
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 7, 2024
5aef0c6
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 7, 2024
b77836b
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 7, 2024
3aafc68
Update daprdocs/content/en/operations/dapr-shared/_index.md
salaboy May 21, 2024
386db5a
Update daprdocs/content/en/operations/dapr-shared/_index.md
salaboy May 21, 2024
fca4132
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 21, 2024
8839d0b
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 21, 2024
273bacd
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 21, 2024
0ce5ad9
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 21, 2024
7b83e1d
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 21, 2024
a231b03
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 21, 2024
f0502e8
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy May 21, 2024
97a1b18
add section for types and ids
hhunter-ms May 18, 2023
2f85aa0
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy Jun 5, 2024
0626f9b
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy Jun 5, 2024
1c763a1
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy Jun 5, 2024
a8a88af
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy Jun 5, 2024
0f3eea2
Update daprdocs/content/en/operations/dapr-shared/_index.md
salaboy Jun 5, 2024
d96d0a8
Update daprdocs/content/en/operations/dapr-shared/dapr-shared.md
salaboy Jun 5, 2024
62bfaf3
moving tutorial to Kubernetes section
salaboy Jun 21, 2024
da3e3b2
adding hello-kubernetes tutorial on shared repo
salaboy Jun 21, 2024
7b0b9aa
updating weights for other kubernetes articles
salaboy Jun 21, 2024
f2680f5
actors change
salaboy Jun 21, 2024
e372bee
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 22, 2024
cbf50f4
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 22, 2024
f51c1bc
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 22, 2024
f06f6c1
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 22, 2024
e9082d4
blank space
salaboy Jun 22, 2024
5eb0bfb
new diagrams
salaboy Jun 22, 2024
9b925c9
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
6426417
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
7f3e902
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
f3fe6e2
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
256282a
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
1e13f9b
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
6b45f1e
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
f16957a
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
6341809
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 25, 2024
c67b8fc
Fix red squiggly lines in Secrets management overview page
RafaelJCamara Jun 20, 2024
d8cb1dc
Update kubernetes-dapr-shared.md
salaboy Jun 25, 2024
d6ce6f1
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 26, 2024
df6a053
updating diagrams
salaboy Jun 26, 2024
6921555
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 26, 2024
ebdf8a5
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
salaboy Jun 26, 2024
872d8c7
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
msfussell Jun 26, 2024
6fc2e27
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
msfussell Jun 26, 2024
e692120
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
msfussell Jun 26, 2024
66e087b
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
msfussell Jun 26, 2024
76140ef
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
msfussell Jun 26, 2024
d2c4bcf
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
msfussell Jun 26, 2024
fce5f24
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
msfussell Jun 26, 2024
b67ea7a
Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-d…
msfussell Jun 26, 2024
6818039
new diagrams with kube background
salaboy Jun 27, 2024
6e5431d
doc: http metrics path normalization (#4155)
nelson-parente Jun 27, 2024
2c23abe
replacing daemonset image
salaboy Jun 27, 2024
0a12d82
updating images
salaboy Jun 27, 2024
ddb4cfd
Update configuration-overview.md
salaboy Jun 27, 2024
3ee6a17
Merge branch 'v1.13' into dapr-shared
salaboy Jun 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
type: docs
title: "Deploy Dapr per-node or per-cluster with Dapr Shared"
linkTitle: "Dapr Shared"
weight: 50000
description: "Learn more about using Dapr Shared as an alternative deployment to sidecars"

---

Dapr automatically injects a sidecar to enable the Dapr APIs for your applications for the best availability and reliability.

Dapr Shared enables two alternative deployment strategies to create Dapr applications using a Kubernetes `Daemonset` for a per-node deployment or a `Deployment` for a per-cluster deployment.

- **`DaemonSet`:** When running Dapr Shared as a Kubernetes `DaemonSet` resource, the daprd container runs on each Kubernetes node in the cluster. This can reduce network hops between the applications and Dapr.
- **`Deployment`:** When running Dapr Shared as a Kubernetes `Deployment`, the Kubernetes scheduler decides on which single node in the cluster the daprd container instance runs.

{{% alert title="Dapr Shared deployments" color="primary" %}}
For each Dapr application you deploy, you need to deploy the Dapr Shared Helm chart using different `shared.appId`s.
{{% /alert %}}



## Why Dapr Shared?

By default, when Dapr is installed into a Kubernetes cluster, the Dapr control plane injects Dapr as a sidecar to applications annotated with Dapr annotations ( `dapr.io/enabled: "true"`). Sidecars offer many advantages, including improved resiliency, since there is an instance per application and all communication between the application and the sidecar happens without involving the network.


<img src="/images/dapr-shared/sidecar.png" width=800 style="padding-bottom:15px;">

While sidecars are Dapr's default deployment, some use cases require other approaches. Let's say you want to decouple the lifecycle of your workloads from the Dapr APIs. A typical example of this is functions, or function-as-a-service runtimes, which might automatically downscale your idle workloads to free up resources. For such cases, keeping the Dapr APIs and all the Dapr async functionalities (such as subscriptions) separate might be required.

Dapr Shared was created for these scenarios, extending the Dapr sidecar model with two new deployment approaches: `DaemonSet` (per-node) and `Deployment` (per-cluster).

{{% alert title="Important" color="primary" %}}
No matter which deployment approach you choose, it is important to understand that in most use cases, you have one instance of Dapr Shared (Helm release) per service (app-id). This means that if you have an application composed of three microservices, each service is recommended to have its own Dapr Shared instance. You can see this in action by trying the [Hello Kubernetes with Dapr Shared tutorial](https://github.com/dapr/dapr-shared/blob/main/docs/tutorial/README.md).
{{% /alert %}}


### `DeamonSet`(Per-node)

With Kubernetes `DaemonSet`, you can define applications that need to be deployed once per node in the cluster. This enables applications that are running on the same node to communicate with local Dapr APIs, no matter where the Kubernetes `Scheduler` schedules your workload.

<img src="/images/dapr-shared/daemonset.png" width=800 style="padding-bottom:15px;">
salaboy marked this conversation as resolved.
Show resolved Hide resolved

{{% alert title="Note" color="primary" %}}
Since `DaemonSet` installs one instance per node, it consumes more resources in your cluster, compared to `Deployment` for a per cluster deployment, with the advantage of improved resiliency.
{{% /alert %}}


### `Deployment` (Per-cluster)

Kubernetes `Deployments` are installed once per cluster. Based on available resources, the Kubernetes `Scheduler` decides on which node the workload is scheduled. For Dapr Shared, this means that your workload and the Dapr instance might be located on separate nodes, which can introduce considerable network latency with the trade-off of reduce resource usage.

<img src="/images/dapr-shared/deployment.png" width=800 style="padding-bottom:15px;">
salaboy marked this conversation as resolved.
Show resolved Hide resolved

## Getting Started with Dapr Shared

{{% alert title="Prerequisites" color="primary" %}}
Before installing Dapr Shared, make ensure you have [Dapr installed in your cluster]({{< ref "kubernetes-deploy.md" >}}).
{{% /alert %}}

If you want to get started with Dapr Shared, you can create a new Dapr Shared instance by installing the official Helm Chart:

```
helm install my-shared-instance oci://registry-1.docker.io/daprio/dapr-shared-chart --set shared.appId=<DAPR_APP_ID> --set shared.remoteURL=<REMOTE_URL> --set shared.remotePort=<REMOTE_PORT> --set shared.strategy=deployment
msfussell marked this conversation as resolved.
Show resolved Hide resolved
```

Your Dapr-enabled applications can now make use of the Dapr Shared instance by pointing the Dapr SDKs to or sending requests to the `my-shared-instance-dapr` Kubernetes service exposed by the Dapr Shared instance.

> The `my-shared-instance` above is the Helm Chart release name.
If you are using the Dapr SDKs, you can set the following environment variables for your application to connect to the Dapr Shared instance (in this case, running on the `default` namespace):

```
env:
- name: DAPR_HTTP_ENDPOINT
value: http://my-shared-instance-dapr.default.svc.cluster.local:3500
- name: DAPR_GRPC_ENDPOINT
value: http://my-shared-instance-dapr.default.svc.cluster.local:50001
```

If you are not using the SDKs, you can send HTTP or gRPC requests to those endpoints.

## Next steps

- Try the [Hello Kubernetes tutorial with Dapr Shared](https://github.com/dapr/dapr-shared/blob/main/docs/tutorial/README.md).
- Read more in the [Dapr Shared repo](https://github.com/dapr/dapr-shared/blob/main/README.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: docs
title: "Deploy to hybrid Linux/Windows Kubernetes clusters"
linkTitle: "Hybrid clusters"
weight: 60000
weight: 70000
description: "How to run Dapr apps on Kubernetes clusters with Windows nodes"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: docs
title: "Running Dapr with a Kubernetes Job"
linkTitle: "Kubernetes Jobs"
weight: 70000
weight: 80000
description: "Use Dapr API in a Kubernetes Job context"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: docs
title: "How-to: Mount Pod volumes to the Dapr sidecar"
linkTitle: "How-to: Mount Pod volumes"
weight: 80000
weight: 90000
description: "Configure the Dapr sidecar to mount Pod Volumes"
---

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added daprdocs/static/images/dapr-shared/sidecar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading