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

[k8s] Add section for Dapr Kubernetes Operator #4031

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get started with the Dapr Workflow building block
The workflow building block is currently in **alpha**.
{{% /alert %}}

Let's take a look at the Dapr [Workflow building block]({{< ref workflow >}}). In this Quickstart, you'll create a simple console application to demonstrate Dapr's workflow programming model and the workflow management APIs.
Let's take a look at the Dapr [Workflow building block]({{< ref workflow-overview.md >}}). In this Quickstart, you'll create a simple console application to demonstrate Dapr's workflow programming model and the workflow management APIs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be here in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it was a link validation - apparently just the "workflow" reference is too ambiguous.


In this guide, you'll:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ When [setting up Dapr on Kubernetes]({{< ref kubernetes-overview.md >}}), you ca
Both the Dapr CLI and the Dapr Helm chart automatically deploy with affinity for nodes with the label `kubernetes.io/os=linux`. You can deploy Dapr to Windows nodes if your application requires it. For more information, see [Deploying to a hybrid Linux/Windows Kubernetes cluster]({{< ref kubernetes-hybrid-clusters >}}).
{{% /alert %}}

## Install Dapr on Kubernetes

Select your preferred installation method for Dapr on Kubernetes.

{{< tabs "Dapr CLI" "Helm" >}}
<!-- Dapr CLI -->
{{% codetab %}}
## Install with Dapr CLI

You can install Dapr on a Kubernetes cluster using the [Dapr CLI]({{< ref install-dapr-cli.md >}}).

Expand Down Expand Up @@ -131,8 +134,6 @@ dapr uninstall -k
<!-- Helm -->
{{% codetab %}}

## Install with Helm

You can install Dapr on Kubernetes using a Helm v3 chart.

❗**Important:** The latest Dapr Helm chart no longer supports Helm v2. [Migrate from Helm v2 to Helm v3](https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/).
Expand Down Expand Up @@ -236,7 +237,7 @@ helm uninstall dapr --namespace dapr-system

{{< /tabs >}}

### Use Mariner-based images
## Use Mariner-based images

The default container images pulled on Kubernetes are based on [*distroless*](https://github.com/GoogleContainerTools/distroless).

Expand Down Expand Up @@ -274,6 +275,45 @@ helm upgrade --install dapr dapr/dapr \

{{< /tabs >}}

## Use the Dapr Kubernetes Operator

The [Dapr Kubernetes Operator](https://github.com/dapr-sandbox/dapr-kubernetes-operator) manages the lifecycle for Dapr and its components. The operator's goal is to automate the tasks required when operating a Dapr running in Kubernetes mode.

The operator was created with the intention of running through the [Operator Lifecycle Manager](https://github.com/operator-framework/operator-lifecycle-manager), specifically on [OpenShift 4](https://try.openshift.com/), but you can install and get the same functionality on any Kubernetes cluster.

The following example shows the most minimal valid manifest to create a new Dapr instance:

```yaml
apiVersion: operator.dapr.io/v1alpha1
kind: DaprControlPlane
metadata:
name: "dapr-control-plane"
spec:
values: {}
```

> See the [Dapr Kubernetes Operator repo](https://github.com/dapr-sandbox/dapr-kubernetes-operator) for more details.

When the Dapr Kubernetes Operator sees a new `DaprControlPlane` resource, the Dapr components are provisioned using Kubernetes resources generated from the official Dapr Helm charts and managed by the operator. The same configuration options available when installing Dapr using Helm can also be used to configure the Dapr Kubernetes Operator.

When something changes on an existing `DaprControlPlane` resource or any resource generated by the operator, the operator reconfigures the cluster to ensure the actual state of the cluster matches the desired state.

{{% alert title="Important" color="warning" %}}
The operator expects that a single `DaprControlPlane` named `dapr-control-plane` in the same namespace where the operator runs exists in a given point in time. Any additional `DaprControlPlane` resources are moved to an error state and ignored.
{{% /alert %}}

The `DaprControlPlane` custom resource consists of the following properties:

| Property | Default | Description |
| -------- | ------- | ----------- |
| `values` | [Empty] | The values passed into the Dapr Helm chart |

### Demo

Watch the [Dapr Community Call #90 presentation on the Dapr Kubernetes Operator.](https://youtu.be/d3ahz41I_Io?si=MsfnR_U5TkG9OrfK&t=50)

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/d3ahz41I_Io?si=PdbNMIApbO6TyALP&amp;start=50" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

## Related links
- [Deploy Dapr with Helm parameters and other details]({{< ref "kubernetes-production.md#deploy-dapr-with-helm" >}})
- [Upgrade Dapr on Kubernetes]({{< ref kubernetes-upgrade.md >}})
Expand Down
Loading