When setting up Kubernetes you can use either the Dapr CLI or Helm.
For more information on what is deployed to your Kubernetes cluster read the Kubernetes overview
You can install Dapr on any Kubernetes cluster. Here are some helpful links:
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.You can install Dapr to a Kubernetes cluster using the Dapr CLI.
The -k
flag initializes Dapr on the Kubernetes cluster in your current context.
kubectl context (kubectl config get-contexts)
to verify. You can set a different context using kubectl config use-context <CONTEXT>
.Run the following command on your local machine to init Dapr on your cluster:
dapr init -k
⌛ Making the jump to hyperspace...
✅ Deploying the Dapr control plane to your cluster...
✅ Success! Dapr has been installed to namespace dapr-system. To verify, run "dapr status -k" in your terminal. To get started, go here: https://aka.ms/dapr-getting-started
The default namespace when initializing Dapr is dapr-system
. You can override this with the -n
flag.
dapr init -k -n mynamespace
You can run Dapr with 3 replicas of each control plane pod in the dapr-system namespace for production scenarios.
dapr init -k --enable-ha=true
Dapr is initialized by default with mTLS. You can disable it with:
dapr init -k --enable-mtls=false
You can wait for the installation to complete its deployment with the --wait
flag.
The default timeout is 300s (5 min), but can be customized with the --timeout
flag.
dapr init -k --wait --timeout 600
Run the following command on your local machine to uninstall Dapr on your cluster:
dapr uninstall -k
You can install Dapr on Kubernetes using a Helm 3 chart.
Make sure Helm 3 is installed on your machine
Add Helm repo and update
helm repo add dapr https://dapr.github.io/helm-charts/
helm repo update
# See which chart versions are available
helm search repo dapr --devel --versions
Install the Dapr chart on your cluster in the dapr-system
namespace.
helm upgrade --install dapr dapr/dapr \
--version=1.2 \
--namespace dapr-system \
--create-namespace \
--wait
To install in high availability mode:
helm upgrade --install dapr dapr/dapr \
--version=1.2 \
--namespace dapr-system \
--create-namespace \
--set global.ha.enabled=true \
--wait
See Guidelines for production ready deployments on Kubernetes for more information on installing and upgrading Dapr using Helm.
helm uninstall dapr --namespace dapr-system
Once the installation is complete, verify that the dapr-operator, dapr-placement, dapr-sidecar-injector and dapr-sentry pods are running in the dapr-system
namespace:
kubectl get pods --namespace dapr-system
NAME READY STATUS RESTARTS AGE
dapr-dashboard-7bd6cbf5bf-xglsr 1/1 Running 0 40s
dapr-operator-7bd6cbf5bf-xglsr 1/1 Running 0 40s
dapr-placement-7f8f76778f-6vhl2 1/1 Running 0 40s
dapr-sidecar-injector-8555576b6f-29cqm 1/1 Running 0 40s
dapr-sentry-9435776c7f-8f7yd 1/1 Running 0 40s