Deploy to hybrid Linux/Windows Kubernetes clusters

    Dapr supports running on kubernetes clusters with windows nodes. You can run your Dapr microservices exclusively on Windows, exclusively on Linux, or a combination of both. This is helpful to users who may be doing a piecemeal migration of a legacy application into a Dapr Kubernetes cluster.

    Kubernetes uses a concept called node affinity so that you can denote whether you want your application to be launched on a Linux node or a Windows node. When deploying to a cluster which has both Windows and Linux nodes, you must provide affinity rules for your applications, otherwise the Kubernetes scheduler might launch your application on the wrong type of node.

    You will need a Kubernetes cluster with Windows nodes. Many Kubernetes providers support the automatic provisioning of Windows enabled Kubernetes clusters.

    1. Once you have set up the cluster, you should see that it has both Windows and Linux nodes available

    If you are installing using the Dapr CLI or via a helm chart, simply follow the normal deployment procedures:

    If you understand the above, but want to deploy the Dapr control plane to Windows, you can do so by setting:

    In order to launch a Dapr application on Windows, you’ll first need to create a Docker container with your application installed. For a step by step guide see Get started: Prep Windows for containers. Once you have a docker container with your application, create a deployment YAML file with node affinity set to kubernetes.io/os: windows.

    1. Create a deployment YAML

      Here is a sample deployment with nodeAffinity set to “windows”. Modify as needed for your application.

    2. Deploy to your Kubernetes cluster

      Linux applications

      If you have already got a dapr application with runs on Linux, you’ll still need to add affinity rules as above, but choose linux affinity instead.

      1. Create a deployment YAML

        Here is a sample deployment with nodeAffinity set to “linux”. Modify as needed for your application.

      2. Deploy to your Kubernetes cluster