You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-tutorial-active-replication.md
+71-22Lines changed: 71 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ In this tutorial, you will host a simple inventory application on Azure Kubernet
19
19
20
20
- An Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
21
21
- Two Azure Kubernetes Service Clusters in different regions- For more information on creating a cluster, see [Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure portal](/azure/aks/learn/quick-kubernetes-deploy-portal). Alternatively, you can host two instances of the demo application on the same AKS cluster.
22
+
<!-- SP -->
23
+
- One Azure Kubernetes Service Cluster - For more information on creating a cluster, see [Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure portal](/azure/aks/learn/quick-kubernetes-deploy-portal). Alternately, you can host two instances of the demo application on the two different AKS clusters, which will how your production environment will be set up. However, for this tutorial, we will deploy both instances of the application on the same AKS cluster.
22
24
23
25
> [!IMPORTANT]
24
26
> This tutorial assumes that you are familiar with basic Kubernetes concepts like containers, pods and service.
@@ -52,6 +54,8 @@ To demonstrate data replication across regions, we run two instances of the same
52
54
53
55
1. Update environment variables `REDIS_HOST` and `REDIS_PASSWORD` with _hostname_ and _access key_ of your _West US 2_ cache.
54
56
1. Update `APP_LOCATION` to display the region where this application instance is running. For this cache, configure the `APP_LOCATION` to _Seattle_ to indicate this application instance is running in Seattle.
57
+
<!-- sp -->
58
+
1. Update environment variables REDIS_HOST and REDIS_PASSWORD with endpoint (remove the suffix ":10000") and access key of your Azure Cache for Redis Enterprise instance in West US 2 or one of the two regions your chose earlier.
55
59
56
60
```YAML
57
61
apiVersion: apps/v1
@@ -81,7 +85,7 @@ To demonstrate data replication across regions, we run two instances of the same
@@ -108,8 +112,65 @@ To demonstrate data replication across regions, we run two instances of the same
108
112
109
113
1. Save another copy of the same YAML file as _app_east.yaml_. This time, use different values.
110
114
111
-
1. Update environment variables `REDIS_HOST` and `REDIS_PASSWORD` with _hostname_ and _access key_ of your _East US_ cache.
115
+
1. Update environment variables `REDIS_HOST` and `REDIS_PASSWORD` with Eendpoint_ and _access key_ of your _East US_ cache.
112
116
1. Update `APP_LOCATION` to display the region where this application instance is running. For this cache, configure the `APP_LOCATION` to _New York_ to indicate this application instance is running in New York.
117
+
118
+
1. +Save another copy of the same YAML file as app_east.yaml. This time, update the namespace, REDIS_HOST, REDIS_PASSWORD and APP_LOCATION to point to Redis Enterprise instance in East US or your second region of choice.
@@ -130,13 +191,12 @@ If you use Azure Cloud Shell, _kubectl_ is already installed, and you can skip t
130
191
Use the portal to copy the resource group and cluster name for your AKS cluster in the West US 2 region. To configure _kubectl_ to connect to your AKS cluster, use the following command with your resource group and cluster name:
131
192
132
193
```bash
133
-
az aks get-credentials --resource-group myResourceGroup --name myClusterName -f AKS_WestUS2
194
+
az aks get-credentials --resource-group myResourceGroup --name myClusterName
134
195
```
135
196
136
197
Verify that you are able to connect to your cluster by running the following command:
Now, repeat the steps for getting credentials for your AKS cluster in East US region.
154
-
155
-
```bash
156
-
az aks get-credentials --resource-group myResourceGroup --name myClusterName -f AKS_EastUS
157
-
158
-
set kubeconfig=AKS_EastUS
159
-
160
-
kubectl get nodes
161
-
```
162
-
163
-
Thus, you now have context on your machine to connect to both the AKS clusters on your machine.
164
-
Alternately, you can apply the YAML files to appropriate AKS clusters through portal directly. To apply YAML through portal, go to the "Services and ingresses" blade for your AKS cluster, and click on the "Create" and choose "Apply a YAML" option. This will open an editor where you can copy paste your YAML file.
165
-
166
213
167
214
## Deploy and test your application
168
215
169
-
Run the following command to deploy the application instance to your AKS cluster in **West US 2**:
216
+
You need two namespaces for your applications to run on your AKS cluster. Create a west and then deploy the application.
217
+
218
+
Run the following command to deploy the application instance to your AKS cluster in the _west_ namespace:
0 commit comments