forked from dapr/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates API ref for jobs. Adds doc on Kubernetes Scheduler persistent (…
…dapr#4256) * Updates API ref for jobs. Adds doc on Kubernetes Scheduler persistent volume Signed-off-by: joshvanl <[email protected]> * Apply suggestions from code review Co-authored-by: Hannah Hunter <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> * Adds scheduler persistent volume docs for selfhosted Signed-off-by: joshvanl <[email protected]> * Updates scheduler volume docs based on dapr/cli#1423 Signed-off-by: joshvanl <[email protected]> * Apply suggestions from code review Co-authored-by: Hannah Hunter <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> * Adds reference for file system location of scheduler local volume Signed-off-by: joshvanl <[email protected]> * Update daprdocs/content/en/reference/api/jobs_api.md Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> * Update daprdocs/content/en/operations/hosting/self-hosted/self-hosted-persisting-scheduler.md Signed-off-by: Mark Fussell <[email protected]> * Apply suggestions from code review Co-authored-by: Mark Fussell <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> * Adds default volume name for scheduler dapr init Signed-off-by: joshvanl <[email protected]> * Adds directions for getting scheduler volume from Docker Desktop Signed-off-by: joshvanl <[email protected]> * Update daprdocs/content/en/operations/hosting/self-hosted/self-hosted-persisting-scheduler.md Signed-off-by: Mark Fussell <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> Signed-off-by: Mark Fussell <[email protected]> Co-authored-by: Hannah Hunter <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: Mark Fussell <[email protected]>
- Loading branch information
1 parent
dac824f
commit 2deca48
Showing
6 changed files
with
172 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...ocs/content/en/operations/hosting/kubernetes/kubernetes-persisting-scheduler.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
type: docs | ||
title: "How-to: Persist Scheduler Jobs" | ||
linkTitle: "How-to: Persist Scheduler Jobs" | ||
weight: 50000 | ||
description: "Configure Scheduler to persist its database to make it resilient to restarts" | ||
--- | ||
|
||
The [Scheduler]({{< ref scheduler.md >}}) service is responsible for writing jobs to its embedded database and scheduling them for execution. | ||
By default, the Scheduler service database writes this data to an in-memory ephemeral tempfs volume, meaning that **this data is not persisted across restarts**. Job data will be lost during these events. | ||
|
||
To make the Scheduler data resilient to restarts, a persistent volume must be mounted to the Scheduler `StatefulSet`. | ||
This persistent volume is backed by a real disk that is provided by the hosted Cloud Provider or Kubernetes infrastructure platform. | ||
Disk size is determined by how many jobs are expected to be persisted at once; however, 64Gb should be more than sufficient for most use cases. | ||
Some Kubernetes providers recommend using a [CSI driver](https://kubernetes.io/docs/concepts/storage/volumes/#csi) to provision the underlying disks. | ||
Below are a list of useful links to the relevant documentation for creating a persistent disk for the major cloud providers: | ||
- [Google Cloud Persistent Disk](https://cloud.google.com/compute/docs/disks) | ||
- [Amazon EBS Volumes](https://aws.amazon.com/blogs/storage/persistent-storage-for-kubernetes/) | ||
- [Azure AKS Storage Options](https://learn.microsoft.com/azure/aks/concepts-storage) | ||
- [Digital Ocean Block Storage](https://www.digitalocean.com/docs/kubernetes/how-to/add-volumes/) | ||
- [VMWare vSphere Storage](https://docs.vmware.com/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-A19F6480-40DC-4343-A5A9-A5D3BFC0742E.html) | ||
- [OpenShift Persistent Storage](https://docs.openshift.com/container-platform/4.6/storage/persistent_storage/persistent-storage-aws-efs.html) | ||
- [Alibaba Cloud Disk Storage](https://www.alibabacloud.com/help/ack/ack-managed-and-ack-dedicated/user-guide/create-a-pvc) | ||
|
||
|
||
Once the persistent volume class is available, you can install Dapr using the following command, with Scheduler configured to use the persistent volume class (replace `my-storage-class` with the name of the storage class): | ||
|
||
{{% alert title="Note" color="primary" %}} | ||
If Dapr is already installed, the control plane needs to be completely [uninstalled]({{< ref dapr-uninstall.md >}}) in order for the Scheduler `StatefulSet` to be recreated with the new persistent volume. | ||
{{% /alert %}} | ||
|
||
{{< tabs "Dapr CLI" "Helm" >}} | ||
<!-- Dapr CLI --> | ||
{{% codetab %}} | ||
|
||
```bash | ||
dapr init -k --set dapr_scheduler.cluster.storageClassName=my-storage-class | ||
``` | ||
|
||
{{% /codetab %}} | ||
|
||
<!-- Helm --> | ||
{{% codetab %}} | ||
|
||
```bash | ||
helm upgrade --install dapr dapr/dapr \ | ||
--version={{% dapr-latest-version short="true" %}} \ | ||
--namespace dapr-system \ | ||
--create-namespace \ | ||
--set dapr_scheduler.cluster.storageClassName=my-storage-class \ | ||
--wait | ||
``` | ||
|
||
{{% /codetab %}} | ||
{{< /tabs >}} |
27 changes: 27 additions & 0 deletions
27
...s/content/en/operations/hosting/self-hosted/self-hosted-persisting-scheduler.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
type: docs | ||
title: "How-to: Persist Scheduler Jobs" | ||
linkTitle: "How-to: Persist Scheduler Jobs" | ||
weight: 50000 | ||
description: "Configure Scheduler to persist its database to make it resilient to restarts" | ||
--- | ||
|
||
The [Scheduler]({{< ref scheduler.md >}}) service is responsible for writing jobs to its embedded database and scheduling them for execution. | ||
By default, the Scheduler service database writes this data to the local volume `dapr_scheduler`, meaning that **this data is persisted across restarts**. | ||
|
||
The host file location for this local volume is typically located at either `/var/lib/docker/volumes/dapr_scheduler/_data` or `~/.local/share/containers/storage/volumes/dapr_scheduler/_data`, depending on your container runtime. | ||
Note that if you are using Docker Desktop, this volume is located in the Docker Desktop VM's filesystem, which can be accessed using: | ||
|
||
```bash | ||
docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh | ||
``` | ||
|
||
The Scheduler persistent volume can be modified with a custom volume that is pre-existing, or is created by Dapr. | ||
|
||
{{% alert title="Note" color="primary" %}} | ||
By default `dapr init` creates a local persistent volume on your drive called `dapr_scheduler`. If Dapr is already installed, the control plane needs to be completely [uninstalled]({{< ref dapr-uninstall.md >}}) in order for the Scheduler container to be recreated with the new persistent volume. | ||
{{% /alert %}} | ||
|
||
```bash | ||
dapr init --scheduler-volume my-scheduler-volume | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters