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

Component Hot Reloading #3910

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
8 changes: 8 additions & 0 deletions daprdocs/content/en/concepts/components-concept.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ For example:

For more information read [Pluggable components overview]({{< ref "pluggable-components-overview" >}})

## Hot Reloading

With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), components are able to be "hot reloaded" at runtime.
This means that you can update component configuration without restarting the Dapr runtime.
Component reloading happens when a component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory.
JoshVanL marked this conversation as resolved.
Show resolved Hide resolved
When a component is updated, the component is first closed, and then reinitialized using the new configuration.
There is a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized.
JoshVanL marked this conversation as resolved.
Show resolved Hide resolved

## Available component types

The following are the component types provided by Dapr:
Expand Down
15 changes: 12 additions & 3 deletions daprdocs/content/en/operations/components/component-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@ weight: 300
description: "Updating deployed components used by applications"
---

When making an update to an existing deployed component used by an application, Dapr does not update the component automatically. The Dapr sidecar needs to be restarted in order to pick up the latest version of the component. How this done depends on the hosting environment.
When making an update to an existing deployed component used by an application, Dapr does not update the component automatically unless the `HotReload` feature gate is enabled.
The Dapr sidecar needs to be restarted in order to pick up the latest version of the component.
How this done depends on the hosting environment.
JoshVanL marked this conversation as resolved.
Show resolved Hide resolved

{{% alert title="Note" color="primary" %}}
Dapr can be made to "hot reload" components where updates will be picked up automatically without needing a restart.
JoshVanL marked this conversation as resolved.
Show resolved Hide resolved
This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}).
All component types are supported for hot reloading.
This feature is currently in preview.
{{% /alert %}}

## Kubernetes

When running in Kubernetes, the process of updating a component involves two steps:

1. Applying the new component YAML to the desired namespace
JoshVanL marked this conversation as resolved.
Show resolved Hide resolved
2. Performing a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component
2. (Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}})), perform a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component
JoshVanL marked this conversation as resolved.
Show resolved Hide resolved

## Self Hosted

When running in Self Hosted mode, the process of updating a component involves a single step of stopping the `daprd` process and starting it again to pick up the latest component.
Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), the process of updating a component involves a single step of stopping the `daprd` process and starting it again to pick up the latest component.
JoshVanL marked this conversation as resolved.
Show resolved Hide resolved

## Further reading
- [Components concept]({{< ref components-concept.md >}})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ For CLI there is no explicit opt-in, just the version that this was first made a
| **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 |
| **Actor State TTL** | Allow actors to save records to state stores with Time To Live (TTL) set to automatically clean up old data. In its current implementation, actor state with TTL may not be reflected correctly by clients, read [Actor State Transactions]({{< ref actors_api.md >}}) for more information. | `ActorStateTTL` | [Actor State Transactions]({{< ref actors_api.md >}}) | v1.11 |
| **Transactional Outbox** | Allows state operations for inserts and updates to be published to a configured pub/sub topic using a single transaction across the state store and the pub/sub | N/A | [Transactional Outbox Feature]({{< ref howto-outbox.md >}}) | v1.12 |

| **Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self-hosted mode.| `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 |
JoshVanL marked this conversation as resolved.
Show resolved Hide resolved
Loading