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
+26-3Lines changed: 26 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,17 +125,19 @@ az aks install-cli
125
125
126
126
If you use Azure Cloud Shell, _kubectl_ is already installed, and you can skip this step.
127
127
128
-
### Connect to your AKS cluster
128
+
### Connect to your AKS clusters in two regions
129
129
130
-
Use the portal to copy the resource group and cluster name for your AKS cluster. To configure _kubectl_ to connect to your AKS cluster, use the following command with your resource group and cluster name:
130
+
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
131
132
132
```bash
133
-
az aks get-credentials --resource-group myResourceGroup --name myClusterName
133
+
az aks get-credentials --resource-group myResourceGroup --name myClusterName -f AKS_WestUS2
134
134
```
135
135
136
136
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
+
151
167
## Deploy and test your application
152
168
153
169
Run the following command to deploy the application instance to your AKS cluster in **West US 2**:
154
170
155
171
```bash
172
+
set kubeconfig=AKS_WestUS2
173
+
156
174
kubectl apply -f app_west.yaml
157
175
```
158
176
@@ -196,6 +214,8 @@ Once the External-IP is available, open a web browser to the External-IP address
196
214
Run the same deployment steps and deploy an instance of the demo application to run in East US region.
197
215
198
216
```bash
217
+
set kubeconfig=AKS_EastUS
218
+
199
219
kubectl apply -f app_east
200
220
201
221
kubectl get pods -n east
@@ -214,8 +234,11 @@ You did it! Click on the buttons and explore the demo. To reset the count, add `
214
234
To clean up your cluster, run the following commands:
215
235
216
236
```bash
237
+
set kubeconfig=AKS_WestUS2
217
238
kubectl delete deployment shoppingcart-app -n west
218
239
kubectl delete service shoppingcart-svc -n west
240
+
241
+
set kubeconfig=AKS_EastUS
219
242
kubectl delete deployment shoppingcart-app -n east
0 commit comments