Skip to content

Commit 3c8fa12

Browse files
authored
Merge pull request #205267 from hhunter-ms/hh-1970132
[Dapr in AKS] Updates to Dapr how-to & new doc
2 parents 3ae67a9 + 3187103 commit 3c8fa12

File tree

4 files changed

+143
-15
lines changed

4 files changed

+143
-15
lines changed

articles/aks/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@
452452
href: dapr-overview.md
453453
- name: How to use Dapr
454454
href: dapr.md
455+
- name: Migrate from Dapr OSS
456+
href: dapr-migration.md
455457
- name: Use GitOps
456458
href: ../azure-arc/kubernetes/tutorial-use-gitops-flux2.md
457459
maintainContext: true

articles/aks/dapr-migration.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Migrate from Dapr OSS to the Dapr extension for Azure Kubernetes Service (AKS)
3+
description: Learn how to migrate from Dapr OSS to the Dapr extension for AKS
4+
author: hhunter-ms
5+
ms.author: hannahhunter
6+
ms.reviewer: nigreenf
7+
ms.service: container-service
8+
ms.topic: article
9+
ms.date: 07/21/2022
10+
ms.custom: devx-track-azurecli
11+
---
12+
13+
# Migrate from Dapr OSS to the Dapr extension for Azure Kubernetes Service (AKS)
14+
15+
You've installed and configured Dapr OSS on your Kubernetes cluster and want to migrate to the Dapr extension on AKS. Before you can successfully migrate to the Dapr extension, you need to fully remove Dapr OSS from your AKS cluster. In this guide, you will migrate from Dapr OSS by:
16+
17+
> [!div class="checklist"]
18+
> - Uninstalling Dapr, including CRDs and the `dapr-system` namespace
19+
> - Installing Dapr via the Dapr extension for AKS
20+
> - Applying your components
21+
> - Restarting your applications that use Dapr
22+
23+
> [!NOTE]
24+
> Expect downtime of approximately 10 minutes while migrating to Dapr extension for AKS. Downtime may take longer depending on varying factors. During this downtime, no Dapr functionality should be expected to run.
25+
26+
## Uninstall Dapr
27+
28+
#### [Dapr CLI](#tab/cli)
29+
30+
1. Run the following command to uninstall Dapr and all CRDs:
31+
32+
```bash
33+
dapr uninstall -k –-all
34+
```
35+
36+
1. Uninstall the Dapr namespace:
37+
38+
```bash
39+
kubectl delete namespace dapr-system
40+
```
41+
42+
> [!NOTE]
43+
> `dapr-system` is the default namespace installed with `dapr init -k`. If you created a custom namespace, replace `dapr-system` with your namespace.
44+
45+
#### [Helm](#tab/helm)
46+
47+
1. Run the following command to uninstall Dapr:
48+
49+
```bash
50+
dapr uninstall -k –-all
51+
```
52+
53+
1. Uninstall CRDs:
54+
55+
```bash
56+
kubectl delete crd components.dapr.io
57+
kubectl delete crd configurations.dapr.io
58+
kubectl delete crd subscriptions.dapr.io
59+
kubectl delete crd resiliencies.dapr.io
60+
```
61+
62+
1. Uninstall the Dapr namespace:
63+
64+
```bash
65+
kubectl delete namespace dapr-system
66+
```
67+
68+
> [!NOTE]
69+
> `dapr-system` is the default namespace while doing a Helm install. If you created a custom namespace (`helm install dapr dapr/dapr --namespace <my-namespace>`), replace `dapr-system` with your namespace.
70+
71+
---
72+
73+
## Install Dapr via the AKS extension
74+
75+
Once you've uninstalled Dapr from your system, install the [Dapr extension for AKS and Arc-enabled Kubernetes](./dapr.md#create-the-extension-and-install-dapr-on-your-aks-or-arc-enabled-kubernetes-cluster).
76+
77+
```bash
78+
az k8s-extension create --cluster-type managedClusters \
79+
--cluster-name <dapr-cluster-name> \
80+
--resource-group <dapr-resource-group> \
81+
--name <dapr-ext> \
82+
--extension-type Microsoft.Dapr
83+
```
84+
85+
## Apply your components
86+
87+
```bash
88+
kubectl apply -f <component.yaml>
89+
```
90+
91+
## Restart your applications that use Dapr
92+
93+
Restarting the deployment will create a new sidecar from the new Dapr installation.
94+
95+
```bash
96+
kubectl rollout restart <deployment-name>
97+
```
98+
99+
## Next steps
100+
101+
Learn more about [the cluster extension](./dapr-overview.md) and [how to use it](./dapr.md).

articles/aks/dapr-overview.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn more about using Dapr on your Azure Kubernetes Service (AKS)
44
ms.author: nickoman
55
ms.service: container-service
66
ms.topic: article
7-
ms.date: 05/03/2022
7+
ms.date: 07/21/2022
88
ms.custom: devx-track-azurecli, event-tier1-build-2022
99
---
1010

@@ -69,6 +69,8 @@ When installing Dapr OSS via helm or the Dapr CLI, runtime versions and configur
6969

7070
Lastly, the Dapr extension is an extension of AKS, therefore you can expect the same support policy as other AKS features.
7171

72+
[Learn more about migrating from Dapr OSS to the Dapr extension for AKS][dapr-migration].
73+
7274
### How can I switch to using the Dapr extension if I’ve already installed Dapr via a method, such as Helm?
7375

7476
Recommended guidance is to completely uninstall Dapr from the AKS cluster and reinstall it via the cluster extension.
@@ -84,6 +86,7 @@ After learning about Dapr and some of the challenges it solves, try [Deploying a
8486
[osm-docs]: ./open-service-mesh-about.md
8587
[cluster-extensions]: ./cluster-extensions.md
8688
[dapr-quickstart]: ./quickstart-dapr.md
89+
[dapr-migration]: ./dapr-migration.md
8790

8891
<!-- Links External -->
8992
[dapr-docs]: https://docs.dapr.io/

articles/aks/dapr.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ author: greenie-msft
55
ms.author: nigreenf
66
ms.service: container-service
77
ms.topic: article
8-
ms.date: 05/16/2022
8+
ms.date: 07/21/2022
99
ms.custom: devx-track-azurecli, ignite-fall-2021, event-tier1-build-2022
1010
---
1111

1212
# Dapr extension for Azure Kubernetes Service (AKS) and Arc-enabled Kubernetes
1313

14-
[Dapr](https://dapr.io/) is a portable, event-driven runtime that makes it easy for any developer to build resilient, stateless and stateful applications that run on the cloud and edge and embraces the diversity of languages and developer frameworks. Leveraging the benefits of a sidecar architecture, Dapr helps you tackle the challenges that come with building microservices and keeps your code platform agnostic. In particular, it helps with solving problems around services calling other services reliably and securely, building event-driven apps with pub-sub, and building applications that are portable across multiple cloud services and hosts (e.g., Kubernetes vs. a VM).
14+
[Dapr](https://dapr.io/) is a portable, event-driven runtime that simplifies building resilient, stateless, and stateful applications that run on the cloud and edge and embrace the diversity of languages and developer frameworks. Applying the benefits of a sidecar architecture, Dapr helps you tackle the challenges that come with building microservices and keeps your code platform agnostic. In particular, it helps solve problems around services:
15+
- Calling other services reliably and securely
16+
- Building event-driven apps with pub-sub
17+
- Building applications that are portable across multiple cloud services and hosts (for example, Kubernetes vs. a VM)
1518

1619
By using the Dapr extension to provision Dapr on your AKS or Arc-enabled Kubernetes cluster, you eliminate the overhead of downloading Dapr tooling and manually installing and managing the runtime on your AKS cluster. Additionally, the extension offers support for all [native Dapr configuration capabilities][dapr-configuration-options] through simple command-line arguments.
1720

1821
> [!NOTE]
19-
> If you plan on installing Dapr in a Kubernetes production environment, please see the [Dapr guidelines for production usage][kubernetes-production] documentation page.
22+
> If you plan on installing Dapr in a Kubernetes production environment, see the [Dapr guidelines for production usage][kubernetes-production] documentation page.
2023
2124
## How it works
2225

@@ -25,9 +28,9 @@ The Dapr extension uses the Azure CLI to provision the Dapr control plane on you
2528
- **dapr-operator**: Manages component updates and Kubernetes services endpoints for Dapr (state stores, pub/subs, etc.)
2629
- **dapr-sidecar-injector**: Injects 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.
2730
- **dapr-placement**: Used for actors only. Creates mapping tables that map actor instances to pods
28-
- **dapr-sentry**: Manages mTLS between services and acts as a certificate authority. For more information read the [security overview][dapr-security].
31+
- **dapr-sentry**: Manages mTLS between services and acts as a certificate authority. For more information, read the [security overview][dapr-security].
2932

30-
Once Dapr is installed on your cluster, you can begin to develop using the Dapr building block APIs by [adding a few annotations][dapr-deployment-annotations] to your deployments. For a more in-depth overview of the building block APIs and how to best use them, please see the [Dapr building blocks overview][building-blocks-concepts].
33+
Once Dapr is installed on your cluster, you can begin to develop using the Dapr building block APIs by [adding a few annotations][dapr-deployment-annotations] to your deployments. For a more in-depth overview of the building block APIs and how to best use them, see the [Dapr building blocks overview][building-blocks-concepts].
3134

3235
> [!WARNING]
3336
> If you install Dapr through the AKS or Arc-enabled Kubernetes extension, our recommendation is to continue using the extension for future management of Dapr instead of the Dapr CLI. Combining the two tools can cause conflicts and result in undesired behavior.
@@ -40,7 +43,7 @@ The Dapr extension support varies depending on how you manage the runtime.
4043

4144
**Self-managed**
4245
For self-managed runtime, the Dapr extension supports:
43-
- [The latest version of Dapr and 2 previous versions (N-2)][dapr-supported-version]
46+
- [The latest version of Dapr and two previous versions (N-2)][dapr-supported-version]
4447
- Upgrading minor version incrementally (for example, 1.5 -> 1.6 -> 1.7)
4548

4649
Self-managed runtime requires manual upgrade to remain in the support window. To upgrade Dapr via the extension, follow the [Update extension instance instructions][update-extension].
@@ -64,7 +67,7 @@ Global Azure cloud is supported with Arc support on the regions listed by [Azure
6467

6568
### Set up the Azure CLI extension for cluster extensions
6669

67-
You will need the `k8s-extension` Azure CLI extension. Install this by running the following commands:
70+
You'll need the `k8s-extension` Azure CLI extension. Install by running the following commands:
6871

6972
```azurecli-interactive
7073
az extension add --name k8s-extension
@@ -83,6 +86,9 @@ When installing the Dapr extension, use the flag value that corresponds to your
8386
- **AKS cluster**: `--cluster-type managedClusters`.
8487
- **Arc-enabled Kubernetes cluster**: `--cluster-type connectedClusters`.
8588

89+
> [!NOTE]
90+
> If you're using Dapr OSS on your AKS cluster and would like to install the Dapr extension for AKS, read more about [how to successfully migrate to the Dapr extension][dapr-migration].
91+
8692
Create the Dapr extension, which installs Dapr on your AKS or Arc-enabled Kubernetes cluster. For example, for an AKS cluster:
8793

8894
```azure-cli-interactive
@@ -135,7 +141,7 @@ If no configuration-settings are passed, the Dapr configuration defaults to:
135141
allowedClockSkew: 15m
136142
```
137143
138-
For a list of available options, please see [Dapr configuration][dapr-configuration-options].
144+
For a list of available options, see [Dapr configuration][dapr-configuration-options].
139145
140146
## Targeting a specific Dapr version
141147
@@ -154,9 +160,23 @@ az k8s-extension create --cluster-type managedClusters \
154160
--version X.X.X
155161
```
156162

157-
## Limiting the extension to certain nodes (`nodeSelector`)
163+
## Limiting the extension to certain nodes
164+
165+
In some configurations, you may only want to run Dapr on certain nodes. You can limit the extension by passing a `nodeSelector` in the extension configuration. If the desired `nodeSelector` contains `.`, you must escape them from the shell and the extension. For example, the following configuration will install Dapr to only nodes with `topology.kubernetes.io/zone: "us-east-1c"`:
166+
167+
```azure-cli-interactive
168+
az k8s-extension create --cluster-type managedClusters \
169+
--cluster-name myAKSCluster \
170+
--resource-group myResourceGroup \
171+
--name myDaprExtension \
172+
--extension-type Microsoft.Dapr \
173+
--auto-upgrade-minor-version true \
174+
--configuration-settings "global.ha.enabled=true" \
175+
--configuration-settings "dapr_operator.replicaCount=2" \
176+
--configuration-settings "global.nodeSelector.kubernetes\.io/zone: us-east-1c"
177+
```
158178
159-
In some configurations you may only want to run Dapr on certain nodes. This can be accomplished by passing a `nodeSelector` in the extension configuration. Note that if the desired `nodeSelector` contains `.`, you must escape them from the shell and the extension. For example, the following configuration will install Dapr to only nodes with `kubernetes.io/os=linux`:
179+
For managing OS and architecture, use the [supported versions](https://github.com/dapr/dapr/blob/b8ae13bf3f0a84c25051fcdacbfd8ac8e32695df/docker/docker.mk#L50) of the `global.daprControlPlaneOs` and `global.daprControlPlaneArch` configuration:
160180

161181
```azure-cli-interactive
162182
az k8s-extension create --cluster-type managedClusters \
@@ -167,7 +187,8 @@ az k8s-extension create --cluster-type managedClusters \
167187
--auto-upgrade-minor-version true \
168188
--configuration-settings "global.ha.enabled=true" \
169189
--configuration-settings "dapr_operator.replicaCount=2" \
170-
--configuration-settings "global.nodeSelector.kubernetes\.io/os=linux"
190+
--configuration-settings "global.daprControlPlaneOs=linux” \
191+
--configuration-settings "global.daprControlPlaneArch=amd64”
171192
```
172193

173194
## Show current configuration settings
@@ -184,14 +205,14 @@ az k8s-extension show --cluster-type managedClusters \
184205
## Update configuration settings
185206

186207
> [!IMPORTANT]
187-
> Some configuration options cannot be modified post-creation. Adjustments to these options require deletion and recreation of the extension. This is applicable to the following settings:
208+
> Some configuration options cannot be modified post-creation. Adjustments to these options require deletion and recreation of the extension, applicable to the following settings:
188209
> * `global.ha.*`
189210
> * `dapr_placement.*`
190211

191212
> [!NOTE]
192213
> High availability (HA) can be enabled at any time. However, once enabled, disabling it requires deletion and recreation of the extension. If you aren't sure if high availability is necessary for your use case, we recommend starting with it disabled to minimize disruption.
193214

194-
To update your Dapr configuration settings, simply recreate the extension with the desired state. For example, assume we have previously created and installed the extension using the following configuration:
215+
To update your Dapr configuration settings, recreate the extension with the desired state. For example, assume we've previously created and installed the extension using the following configuration:
195216

196217
```azurecli-interactive
197218
az k8s-extension create --cluster-type managedClusters \
@@ -204,7 +225,7 @@ az k8s-extension create --cluster-type managedClusters \
204225
--configuration-settings "dapr_operator.replicaCount=2"
205226
```
206227

207-
To update the `dapr_operator.replicaCount` from 2 to 3, use the following:
228+
To update the `dapr_operator.replicaCount` from two to three, use the following command:
208229

209230
```azurecli-interactive
210231
az k8s-extension create --cluster-type managedClusters \
@@ -265,6 +286,7 @@ az k8s-extension delete --resource-group myResourceGroup --cluster-name myAKSClu
265286
[arc-k8s-cluster]: ../azure-arc/kubernetes/quickstart-connect-cluster.md
266287
[update-extension]: ./cluster-extensions.md#update-extension-instance
267288
[install-cli]: /cli/azure/install-azure-cli
289+
[dapr-migration]: ./dapr-migration.md
268290

269291
<!-- LINKS EXTERNAL -->
270292
[kubernetes-production]: https://docs.dapr.io/operations/hosting/kubernetes/kubernetes-production

0 commit comments

Comments
 (0)