Go to file
Luca Burgazzoli 55d09b0bfd
Update tools
2024-03-29 11:36:27 +01:00
.github Update tools 2024-03-29 11:36:27 +01:00
api/operator Let helm manage the installation of Dapr's CRDs #67 2023-12-03 21:49:49 +01:00
cmd Let helm manage the installation of Dapr's CRDs #67 2023-12-03 21:49:49 +01:00
config Update tools 2024-03-29 11:36:27 +01:00
docs/install doc: add install instructions 2023-09-07 12:48:41 +02:00
hack Update tools 2024-03-29 11:36:27 +01:00
helm-charts/dapr Dapr 1.13 Operator Upgrade #107 2024-03-29 09:58:59 +01:00
internal/controller/operator Let helm manage the installation of Dapr's CRDs #67 2023-12-03 21:49:49 +01:00
pkg Update tools 2024-03-29 11:36:27 +01:00
test Update tools 2024-03-29 11:36:27 +01:00
.dockerignore feat: refacto to a custom operator leveragin helm directly instead of the operator-sdk's helm-operator 2023-08-21 14:44:14 +02:00
.gitignore feat: refacto to a custom operator leveragin helm directly instead of the operator-sdk's helm-operator 2023-08-21 14:44:14 +02:00
.golangci.yml chore: update tools (operator-sdk, golangci-lint, codegen) versions 2023-10-25 14:06:34 +02:00
Dockerfile Update tools 2024-03-29 11:36:27 +01:00
LICENSE feat: refacto to a custom operator leveragin helm directly instead of the operator-sdk's helm-operator 2023-08-21 14:44:14 +02:00
Makefile Update tools 2024-03-29 11:36:27 +01:00
PROJECT Allow using different charts and/or deploy different Dapr versions #46 2023-11-16 08:08:56 +01:00
README.md doc: add usage section 2023-10-19 09:02:05 +02:00
go.mod Update tools 2024-03-29 11:36:27 +01:00
go.sum chore(deps): bump github.com/onsi/gomega from 1.31.1 to 1.32.0 2024-03-19 13:15:40 +00:00

README.md

Dapr Kubernetes Operator

The 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.

Installation

The Dapr Kubernetes Operator was created with the intention of running through the Operator Lifecycle Manager, specifically on OpenShift 4. This is where the operator shines most, as it leverages the powerful features built into the latest version of OpenShift.

That being said, the operator can be installed and provide the same functionality on any Kubernetes cluster. The following methods are provided for installing the operator.

OpenShift

The operator is published as part of the built-in Community Operators in the Operator Hub on OpenShift 4. See the OpenShift Install Guide for more information on installing on the OpenShift platorm.

Operator Lifecycle Manager

Using the Operator Lifecycle Manager to install and manage the Dapr Kubernetes Operator is the preferred method. The operator is published to operatorhub.io. Following the installation process there should work for most OLM installations.

Look at the OLM Install Guide for an example using this approach with minikube.

Manual Installation

The operator can be installed manually if desired.

!!! info The manual installation method requires cluster credentials that provide the cluster-admin ClusterRole or equivalent.

The Manual Installation Guide provides the steps needed to manually install the operator on any Kubernetes cluster.

Usage

Basic

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

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

The DaprControlPlane resource is a Kubernetes Custom Resource (CRD) that describes the desired state for a given Dapr instance and allows for the configuration of the components that make up the instance.

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. This means that the same configuration option that are 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 works to reconfigure the cluster to ensure the actual state of the cluster matches the desired state.

[!IMPORTANT] The operator expect that a single DaprControlPlane named dapr-control-plane and placed in the same namespace where the operator runs exists in a given point in time. Any additional DaprControlPlane resources will be moved to an Error state and ignored.

The DaprControlPlane Custom Resource consists of the following properties

Name Default Description
values [Empty] The values passed into the Dapr Helm chart

Create

Create a new Dapr Control Plane operator in the openshift-operators namespace using the provided basic example

kubectl apply -n openshift-operators -f config/samples/basic/dapr-basic.yaml

There will be several Dapr controllers and resources created that should be familiar to anyone who has deployed Dapr beforeusing helm:

➜ kubecto tree daprcontrolplanes.operator.dapr.io dapr-control-plane
NAMESPACE            NAME                                                     READY  REASON  AGE
openshift-operators  DaprControlPlane/dapr-control-plane                      True   Ready   72s
openshift-operators  ├─ConfigMap/dapr-trust-bundle                            -              68s
openshift-operators  ├─Configuration/daprsystem                               -              68s
openshift-operators  ├─Deployment/dapr-operator                               -              68s
openshift-operators  │ └─ReplicaSet/dapr-operator-5b98cf8c8                   -              68s
openshift-operators  │   └─Pod/dapr-operator-5b98cf8c8-cnt29                  True           67s
openshift-operators  ├─Deployment/dapr-sentry                                 -              68s
openshift-operators  │ └─ReplicaSet/dapr-sentry-74cbc77cb                     -              68s
openshift-operators  │   └─Pod/dapr-sentry-74cbc77cb-n7kb9                    True           67s
openshift-operators  ├─Deployment/dapr-sidecar-injector                       -              68s
openshift-operators  │ └─ReplicaSet/dapr-sidecar-injector-6745d677c7          -              68s
openshift-operators  │   └─Pod/dapr-sidecar-injector-6745d677c7-zbxv4         True           67s
openshift-operators  ├─Role/dapr-injector                                     -              67s
openshift-operators  ├─Role/dapr-operator                                     -              67s
openshift-operators  ├─Role/dapr-sentry                                       -              67s
openshift-operators  ├─Role/secret-reader                                     -              67s
openshift-operators  ├─RoleBinding/dapr-injector                              -              67s
openshift-operators  ├─RoleBinding/dapr-operator                              -              67s
openshift-operators  ├─RoleBinding/dapr-secret-reader                         -              67s
openshift-operators  ├─RoleBinding/dapr-sentry                                -              67s
openshift-operators  ├─Secret/dapr-trust-bundle                               -              67s
openshift-operators  ├─Service/dapr-api                                       -              67s
openshift-operators  │ └─EndpointSlice/dapr-api-mxw2p                         -              67s
openshift-operators  ├─Service/dapr-placement-server                          -              67s
openshift-operators  │ └─EndpointSlice/dapr-placement-server-74rkd            -              67s
openshift-operators  ├─Service/dapr-sentry                                    -              67s
openshift-operators  │ └─EndpointSlice/dapr-sentry-6c46f                      -              67s
openshift-operators  ├─Service/dapr-sidecar-injector                          -              67s
openshift-operators  │ └─EndpointSlice/dapr-sidecar-injector-8lt7j            -              67s
openshift-operators  ├─Service/dapr-webhook                                   -              67s
openshift-operators  │ └─EndpointSlice/dapr-webhook-sq5vm                     -              67s
openshift-operators  ├─ServiceAccount/dapr-injector                           -              67s
openshift-operators  ├─ServiceAccount/dapr-operator                           -              67s
openshift-operators  ├─ServiceAccount/dapr-placement                          -              67s
openshift-operators  ├─ServiceAccount/dapr-sentry                             -              67s
openshift-operators  └─StatefulSet/dapr-placement-server                      -              67s
openshift-operators    └─ControllerRevision/dapr-placement-server-6cb96b4b85  -              67s