Overview of Dapr on Kubernetes

Overview of how to get Dapr running on your Kubernetes cluster

Dapr can be configured to run on any supported versions of Kubernetes. To achieve this, Dapr begins by deploying the following Kubernetes services, which provide first-class integration to make running applications with Dapr easy.

Kubernetes servicesDescription
dapr-operatorManages component updates and Kubernetes services endpoints for Dapr (state stores, pub/subs, etc.)
dapr-sidecar-injectorInjects Dapr into annotated deployment pods and adds the environment variables DAPR_HTTP_PORT and DAPR_GRPC_PORT to enable user-defined applications to easily communicate with Dapr without hard-coding Dapr port values.
dapr-placementUsed for actors only. Creates mapping tables that map actor instances to pods. Not deployed when actor placement is served by the Scheduler service (global.scheduler.placement.enabled=true)
dapr-sentryManages mTLS between services and acts as a certificate authority. For more information read the security overview
dapr-schedulerProvides distributed job scheduling capabilities used by the Jobs API, Workflow API, and Actor Reminders. Can also serve actor placement in place of dapr-placement
Dapr on KubernetesA dashed region stands for the Kubernetes cluster. Along its top are the five Dapr control plane services, each in its own pod: placement, which maps actor instances to pods and is used for actors only; the sidecar injector, which injects the Dapr sidecar into annotated pods; sentry, the certificate authority, which manages mTLS and assigns SPIFFE identity; the operator, which manages components and Kubernetes service endpoints; and the scheduler, which schedules jobs for the Jobs and Workflow APIs. Each reaches down to an application pod in the middle, where the Dapr sidecar runs beside the application. The kubelet probes that pod, using readiness and liveness probes on the healthz API to decide Dapr health state. Below, a dashed strip headed "Host on any cloud or edge infrastructure" carries Azure, AWS, Google Cloud, Alibaba Cloud and Kubernetes. On the right, the sidecar uses components for publish and subscribe, workflows, state management, configuration and secrets.PodPlacementActor partitionplacementMap actorinstances to pods,for actors onlyPodInjectorDapr runtimeinjectorInject the sidecarinto annotatedpodsPodSentryCertificateauthorityManage mTLS,assign SPIFFEidentityPodOperatorComponentupdatesManage componentsand serviceendpointsPodSchedulerDistributed jobschedulingSchedule jobs forthe Jobs andWorkflow APIsPodAppKubeletReadiness and livenessprobes on the healthz APIdecide Dapr health stateHost on any cloud or edge infrastructureAzureAlibaba CloudKubernetesUse componentsPublish &subscribeWorkflowsStatemanagementConfigurationSecrets

Supported versions

Dapr support for Kubernetes is aligned with Kubernetes Version Skew Policy.

Deploying Dapr to a Kubernetes cluster

Read Deploy Dapr on a Kubernetes cluster to learn how to deploy Dapr to your Kubernetes cluster.

Adding Dapr to a Kubernetes deployment

Deploying and running a Dapr-enabled application into your Kubernetes cluster is as simple as adding a few annotations to the pods schema. For example, in the following example, your Kubernetes pod is annotated to:

  • Give your service an id and port known to Dapr
  • Turn on tracing through configuration
  • Launch the Dapr sidecar container
  annotations:
    dapr.io/enabled: "true"
    dapr.io/app-id: "nodeapp"
    dapr.io/app-port: "3000"
    dapr.io/config: "tracing"

For more information, check Dapr annotations.

Pulling container images from private registries

Dapr works seamlessly with any user application container image, regardless of its origin. Simply initialize Dapr and add the Dapr annotations to your Kubernetes definition to add the Dapr sidecar.

The Dapr control plane and sidecar images come from the daprio Docker Hub container registry, which is a public registry.

For information about:

Tutorials

Work through the Hello Kubernetes tutorial to learn more about getting started with Dapr on your Kubernetes cluster.