Skip to content

Commit

Permalink
Merge pull request #4031 from hhunter-ms/issue_3828
Browse files Browse the repository at this point in the history
[k8s] Add section for Dapr Kubernetes Operator
  • Loading branch information
hhunter-ms authored Feb 15, 2024
2 parents ca42727 + ad5bf01 commit 8d8d8fc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
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.

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

0 comments on commit 8d8d8fc

Please sign in to comment.