Skip to content

Commit f3981d8

Browse files
authored
Merge pull request #179714 from MikeRayMSFT/20211112-create-data-controller-direct-cli
Update create-data-controller-direct-cli.md
2 parents e4d45fd + 98d7fba commit f3981d8

File tree

1 file changed

+43
-39
lines changed

1 file changed

+43
-39
lines changed

articles/azure-arc/data/create-data-controller-direct-cli.md

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.reviewer: mikeray
77
services: azure-arc
88
ms.service: azure-arc
99
ms.subservice: azure-arc-data
10-
ms.date: 11/03/2021
10+
ms.date: 11/12/2021
1111
ms.topic: overview
1212
---
1313

@@ -29,7 +29,7 @@ Creating an Azure Arc data controller in **direct** connectivity mode involves t
2929
> [!NOTE]
3030
> Currently, this step can only be performed from the portal. For details, see [Release notes](release-notes.md).
3131
32-
## Create an Azure Arc-enabled data services extension
32+
## Step 1: Create an Azure Arc-enabled data services extension
3333

3434
Use the k8s-extension CLI to create a data services extension.
3535

@@ -40,11 +40,15 @@ Set the following environment variables, which will be then used in next step.
4040
#### Linux
4141

4242
``` terminal
43-
# where you want the connected cluster resource to be created in Azure
43+
## variables for Azure location, extension and namespace
4444
export subscription=<Your subscription ID>
4545
export resourceGroup=<Your resource group>
46-
export resourceName=<name of your connected kubernetes cluster>
46+
export clusterName=<name of your connected kubernetes cluster>
4747
export location=<Azure location>
48+
export adsExtensionName="ads-ext"
49+
export namespace="arcds"
50+
51+
## variables for Metrics and Monitoring dashboard credentials
4852
export AZDATA_LOGSUI_USERNAME=<username for Kibana dashboard>
4953
export AZDATA_LOGSUI_PASSWORD=<password for Kibana dashboard>
5054
export AZDATA_METRICSUI_USERNAME=<username for Grafana dashboard>
@@ -53,11 +57,15 @@ export AZDATA_METRICSUI_PASSWORD=<password for Grafana dashboard>
5357

5458
#### Windows PowerShell
5559
``` PowerShell
56-
# where you want the connected cluster resource to be created in Azure
60+
## variables for Azure location, extension and namespace
5761
$ENV:subscription="<Your subscription ID>"
5862
$ENV:resourceGroup="<Your resource group>"
59-
$ENV:resourceName="<name of your connected kubernetes cluster>"
63+
$ENV:clusterName="<name of your connected kubernetes cluster>"
6064
$ENV:location="<Azure location>"
65+
$ENV:adsExtensionName="<name of Data controller extension"
66+
$ENV:namespace="namespace where extension and data controller will be deployed"
67+
68+
## variables for Metrics and Monitoring dashboard credentials
6169
$ENV:AZDATA_LOGSUI_USERNAME="<username for Kibana dashboard>"
6270
$ENV:AZDATA_LOGSUI_PASSWORD="<password for Kibana dashboard>"
6371
$ENV:AZDATA_METRICSUI_USERNAME="<username for Grafana dashboard>"
@@ -69,63 +77,62 @@ $ENV:AZDATA_METRICSUI_PASSWORD="<password for Grafana dashboard>"
6977
#### Linux
7078

7179
```bash
72-
az k8s-extension create -c ${resourceName} -g ${resourceGroup} --name ${ADSExtensionName} --cluster-type connectedClusters --extension-type microsoft.arcdataservices --auto-upgrade false --scope cluster --release-namespace arc --config Microsoft.CustomLocation.ServiceAccount=sa-bootstrapper
80+
az k8s-extension create --cluster-name ${clusterName} --resource-group ${resourceGroup} --name ${adsExtensionName} --cluster-type connectedClusters --extension-type microsoft.arcdataservices --auto-upgrade false --scope cluster --release-namespace ${namespace} --config Microsoft.CustomLocation.ServiceAccount=sa-arc-bootstrapper
7381

74-
az k8s-extension show -g ${resourceGroup} -c ${resourceName} --name ${ADSExtensionName} --cluster-type connectedclusters
82+
az k8s-extension show --resource-group ${resourceGroup} --cluster-name ${resourceName} --name ${adsExtensionName} --cluster-type connectedclusters
7583
```
7684

7785
#### Windows PowerShell
7886
```PowerShell
79-
$ENV:ADSExtensionName="ads-extension"
8087
81-
az k8s-extension create -c "$ENV:resourceName" -g "$ENV:resourceGroup" --name "$ENV:ADSExtensionName" --cluster-type connectedClusters --extension-type microsoft.arcdataservices --auto-upgrade false --scope cluster --release-namespace arc --config Microsoft.CustomLocation.ServiceAccount=sa-bootstrapper
88+
az k8s-extension create --cluster-name $ENV:clusterName --resource-group $ENV:resourceGroup --name $ENV:adsExtensionName --cluster-type connectedClusters --extension-type microsoft.arcdataservices --auto-upgrade false --scope cluster --release-namespace $ENV:namespace --config Microsoft.CustomLocation.ServiceAccount=sa-arc-bootstrapper
8289
83-
az k8s-extension show -g "$ENV:resourceGroup" -c "$ENV:resourceName" --name "$ENV:ADSExtensionName" --cluster-type connectedclusters
90+
az k8s-extension show --resource-group $ENV:resourceGroup --cluster-name $ENV:clusterName --name $ENV:adsExtensionName --cluster-type connectedclusters
8491
```
8592

8693
#### Deploy Azure Arc data services extension using private container registry and credentials
8794

8895
Use the below command if you are deploying from your private repository:
8996

9097
```azurecli
91-
az k8s-extension create -c "<connected cluster name>" -g "<resource group>" --name "<extension name>" --cluster-type connectedClusters --extension-type microsoft.arcdataservices --scope cluster --release-namespace "<namespace>" --config Microsoft.CustomLocation.ServiceAccount=sa-bootstrapper --config imageCredentials.registry=<registry info> --config imageCredentials.username=<username> --config systemDefaultValues.image=<registry/repo/arc-bootstrapper:<imagetag>> --config-protected imageCredentials.password=$ENV:DOCKER_PASSWORD --debug
98+
az k8s-extension create --cluster-name "<connected cluster name>" --resource-group "<resource group>" --name "<extension name>" --cluster-type connectedClusters --extension-type microsoft.arcdataservices --scope cluster --release-namespace "<namespace>" --config Microsoft.CustomLocation.ServiceAccount=sa-arc-bootstrapper --config imageCredentials.registry=<registry info> --config imageCredentials.username=<username> --config systemDefaultValues.image=<registry/repo/arc-bootstrapper:<imagetag>> --config-protected imageCredentials.password=$ENV:DOCKER_PASSWORD --debug
9299
```
93100

94101
For example
95102
```azurecli
96-
az k8s-extension create -c "my-connected-cluster" -g "my-resource-group" --name "arc-data-services" --cluster-type connectedClusters --extension-type microsoft.arcdataservices --scope cluster --release-namespace "arc" --config Microsoft.CustomLocation.ServiceAccount=sa-bootstrapper --config imageCredentials.registry=mcr.microsoft.com --config imageCredentials.username=arcuser --config systemDefaultValues.image=mcr.microsoft.com/arcdata/arc-bootstrapper:latest --config-protected imageCredentials.password=$ENV:DOCKER_PASSWORD --debug
103+
az k8s-extension create --cluster-name "my-connected-cluster" --resource-group "my-resource-group" --name "arc-data-services" --cluster-type connectedClusters --extension-type microsoft.arcdataservices --scope cluster --release-namespace "arc" --config Microsoft.CustomLocation.ServiceAccount=sa-bootstrapper --config imageCredentials.registry=mcr.microsoft.com --config imageCredentials.username=arcuser --config systemDefaultValues.image=mcr.microsoft.com/arcdata/arc-bootstrapper:latest --config-protected imageCredentials.password=$ENV:DOCKER_PASSWORD --debug
97104
```
98105

99106

100107
> [!NOTE]
101-
> The Arc data services extension install can take a couple of minutes to finish.
108+
> The Arc data services extension install can take a few minutes to complete.
102109
103110
### Verify the Arc data services extension is created
104111

105-
You can verify if the Azure Arc-enabled data services extension is created either from the portal or by connecting directly to the Azure Arc-enabled Kubernetes cluster.
112+
You can verify the status of the deployment of Azure Arc-enabled data services extension either from the portal or by connecting directly to the Azure Arc-enabled Kubernetes cluster.
106113

107-
#### Azure portal
114+
#### Check status from Azure portal
108115
1. Log in to the Azure portal and browse to the resource group where the Kubernetes connected cluster resource is located.
109116
1. Select the Azure Arc-enabled kubernetes cluster (Type = "Kubernetes - Azure Arc") where the extension was deployed.
110117
1. In the navigation on the left side, under **Settings**, select **Extensions**.
111118
1. You should see the extension that was created earlier in an installed state.
112119

113120
:::image type="content" source="media/deploy-data-controller-direct-mode-prerequisites/dc-extensions-dashboard.png" alt-text="Extensions dashboard":::
114121

115-
#### kubectl CLI
122+
#### Check status using kubectl CLI
116123

117124
1. Connect to your Kubernetes cluster via a Terminal window.
118125
1. Run the below command and ensure the (1) namespace mentioned above is created and (2) the `bootstrapper` pod is in 'running' state before proceeding to the next step.
119126

120127
``` console
121-
kubectl get pods -n <name of namespace used in the json template file above>
128+
kubectl get pods --name <name of namespace used in the json template file above>
122129
```
123130

124131
For example, the following example gets the pods from `arc` namespace.
125132

126133
```console
127134
#Example:
128-
kubectl get pods -n arc
135+
kubectl get pods --name arc
129136
```
130137

131138
## Retrieve the managed identity and grant roles
@@ -150,7 +157,7 @@ az role assignment create --assignee $Env:MSI_OBJECT_ID --role "Monitoring Metri
150157
151158
```
152159

153-
## Create a custom location using custom location CLI extension
160+
## Step 2: Create a custom location using ```customlocation``` CLI extension
154161

155162
A custom location is an Azure resource that is equivalent to a namespace in a Kubernetes cluster. Custom locations are used as a target to deploy resources to or from Azure. Learn more about custom locations in the [Custom locations on top of Azure Arc-enabled Kubernetes documentation](../kubernetes/conceptual-custom-locations.md).
156163

@@ -160,24 +167,22 @@ A custom location is an Azure resource that is equivalent to a namespace in a Ku
160167

161168
```bash
162169
export clName=mycustomlocation
163-
export clNamespace=arc
164-
export hostClusterId=$(az connectedk8s show -g ${resourceGroup} -n ${resourceName} --query id -o tsv)
165-
export extensionId=$(az k8s-extension show -g ${resourceGroup} -c ${resourceName} --cluster-type connectedClusters --name ${ADSExtensionName} --query id -o tsv)
166170

167-
az customlocation create -g ${resourceGroup} -n ${clName} --namespace ${clNamespace} \
168-
--host-resource-id ${hostClusterId} \
169-
--cluster-extension-ids ${extensionId} --location eastus
171+
export hostClusterId=$(az connectedk8s show --resource-group ${resourceGroup} --name ${clusterName} --query id -o tsv)
172+
export extensionId=$(az k8s-extension show --resource-group ${resourceGroup} --cluster-name ${clusterName} --cluster-type connectedClusters --name ${adsExtensionName} --query id -o tsv)
173+
174+
az customlocation create --resource-group ${resourceGroup} --name ${clName} --namespace ${namespace} --host-resource-id ${hostClusterId} --cluster-extension-ids ${extensionId} --location ${location}
170175
```
171176

172177
#### Windows PowerShell
173178
```PowerShell
174179
$ENV:clName="mycustomlocation"
175-
$ENV:clNamespace="arc"
176180
177-
$ENV:hostClusterId=(az connectedk8s show -g $ENV:resourceGroup -n $ENV:resourceName --query id -o tsv)
178-
$ENV:extensionId=(az k8s-extension show -g $ENV:resourceGroup -c $ENV:resourceName --cluster-type connectedClusters --name $ENV:ADSExtensionName --query id -o tsv)
179181
180-
az customlocation create -g $ENV:resourceGroup -n $ENV:clName --namespace $ENV:clNamespace --host-resource-id $ENV:hostClusterId --cluster-extension-ids $ENV:extensionId
182+
$ENV:hostClusterId=(az connectedk8s show --resource-group $ENV:resourceGroup --name $ENV:clusterName --query id -o tsv)
183+
$ENV:extensionId=(az k8s-extension show --resource-group $ENV:resourceGroup --cluster-name $ENV:clusterName --cluster-type connectedClusters --name $ENV:adsExtensionName --query id -o tsv)
184+
185+
az customlocation create --resource-group $ENV:resourceGroup --name $ENV:clName --namespace $ENV:namespace --host-resource-id $ENV:hostClusterId --cluster-extension-ids $ENV:extensionId
181186
```
182187

183188
## Validate the custom location is created
@@ -188,31 +193,30 @@ From the terminal, run the below command to list the custom locations, and valid
188193
az customlocation list -o table
189194
```
190195

191-
## Create the Azure Arc data controller
196+
## Step 3: Create the Azure Arc data controller
192197

193198
After the extension and custom location are created, proceed to deploy the Azure Arc data controller as follows.
194199

195200
```
196-
az arcdata dc create --name <name> --resource-group <resourcegroup> --location <location> --connectivity-mode direct --profile-name <profile name> --auto-upload-logs true --custom-location <name of custom location>
201+
az arcdata dc create --name <name> --resource-group <resourcegroup> --location <location> --connectivity-mode direct --profile-name <profile name> --auto-upload-logs true --auto-upload-metrics true --custom-location <name of custom location>
197202
# Example
198-
az arcdata dc create -n arc-dc1 --resource-group my-resource-group --location eastasia --connectivity-mode direct --profile-name azure-arc-aks-premium-storage --auto-upload-logs true --custom-location mycustomlocation
203+
az arcdata dc create --name arc-dc1 --resource-group my-resource-group --location eastasia --connectivity-mode direct --profile-name azure-arc-aks-premium-storage --auto-upload-logs true --auto-upload-metrics true --custom-location mycustomlocation
199204
```
200205

201206
If you want to create the Azure Arc data controller using a custom configuration template, follow the steps described in [Create custom configuration profile](create-custom-configuration-template.md) and provide the path to the file as follows:
202207

203208
```
204-
az arcdata dc create --name <name> --resource-group <resourcegroup> --location <location> --connectivity-mode direct --path ./azure-arc-custom --auto-upload-logs true --custom-location <name of custom location>
209+
az arcdata dc create --name <name> --resource-group <resourcegroup> --location <location> --connectivity-mode direct --path ./azure-arc-custom --auto-upload-logs true --auto-upload-metrics true --custom-location <name of custom location>
205210
# Example
206-
az arcdata dc create --name arc-dc1 --resource-group my-resource-group --location eastasia --connectivity-mode direct --path ./azure-arc-custom --auto-upload-logs true --custom-location mycustomlocation
211+
az arcdata dc create --name arc-dc1 --resource-group my-resource-group --location eastasia --connectivity-mode direct --path ./azure-arc-custom --auto-upload-logs true --auto-upload-metrics true --custom-location mycustomlocation
207212
```
208213

214+
## Monitor the status of Azure Arc data controller deployment
209215

210-
## Monitor the creation
211-
212-
When the Azure portal deployment status shows the deployment was successful, you can check the status of the Arc data controller deployment on the cluster as follows:
216+
The deployment status of the Arc data controller on the cluster can be monitored as follows:
213217

214218
```console
215-
kubectl get datacontrollers -n arc
219+
kubectl get datacontrollers --name arc
216220
```
217221

218222
## Next steps

0 commit comments

Comments
 (0)