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/operator-nexus/howto-run-instance-readiness-testing.md
+60-13Lines changed: 60 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,8 @@ The Instance Readiness Test (IRT) framework is an optional/add-on tool for the N
50
50
Every average metric should be greater than 0.
51
51
- Validate that KubeletRunningPods metric data is present within the last 10 minutes.
52
52
Every average metric should be greater than 0.
53
+
- Validate that ControllerRuntimeReconcileTotal metric data is present within the last 10 minutes.
54
+
Every average metric should be greater than 0.
53
55
- Validate that CpuUtilizationMax metric data for fabric network device is present within the last 10 minutes.
54
56
At least one non-zero metric should exist.
55
57
- Validate that MemoryAvailable metric data is present within the last 10 minutes.
@@ -117,9 +119,9 @@ IRT requires gaining access to the software package hosted in the GitHub Nexus-S
117
119
118
120
For access to the nexus-samples GitHub repository
119
121
120
-
1. Link your GitHub account to the Microsoft GitHub Org<https://repos.opensource.microsoft.com/link>
122
+
1. Link your GitHub account to the Microsoft GitHub Org<https://repos.opensource.microsoft.com/link>
121
123
122
-
2. Join the Microsoft Org<https://repos.opensource.microsoft.com/orgs/Microsoft/join>
124
+
2. Join the Microsoft Org<https://repos.opensource.microsoft.com/orgs/Microsoft/join>
123
125
124
126
3. Send an email request to be added to nexus-samples GitHub repo to afoncamalgamatesall\@microsoft.com
125
127
@@ -132,12 +134,13 @@ For access to the nexus-samples GitHub repository
132
134
* Networks to use for the test are specified in a "networks-blueprint.yml" file, see [Input Configuration](#input-configuration).
133
135
- A way to download the IRT release package, for example, curl, wget, etc.
134
136
- The ability to create a service principal with the correct roles.
137
+
- The ability to create a managed identity with the correct roles.
135
138
- The ability to read secrets from the KeyVault, see [Service Principal](#create-service-principal-and-security-group) section for more details.
136
139
- The ability to create security groups in your Active Directory tenant.
137
140
138
141
## Input configuration
139
142
140
-
Start by building your input file. The IRT tarball provides `irt-input.example.yml` as an example. Download the tarball by following the [instructions](#download-irt). The example values **will not work for your instances**. You need to manually change them and rename the file to `irt-input.yml`. We provide the example input file as a stub to help you configure new input files. The example outlines overridable values and their usage. The **[One Time Setup](#one-time-setup)** assists you in setting input values by writing key/value pairs to the config file as they execute.
143
+
Start by building your input file. The IRT tarball provides `irt-input.example.yml` as an example. Download the tarball by following the [instructions](#download-irt). The placeholder values **will need to be updated with valid values for your instance to work**. You need to manually change them and rename the file to `irt-input.yml`. We provide the example input file as a stub to help you configure new input files. The example outlines overridable values and their usage. The **[One Time Setup](#one-time-setup)** assists you in setting input values by writing key/value pairs to the config file as they execute.
141
144
142
145
You can provide the network information in a `networks-blueprint.yml` file, similar to the `networks-blueprint.example.yml` that we provide, or append it to the `irt-input.yml` file. The `networks-blueprint.example.yml` defines the schema for IRT. The test creates the networks, so provide network details that aren't in use. Currently, IRT has the following network requirements:
143
146
@@ -151,7 +154,7 @@ You can provide the network information in a `networks-blueprint.yml` file, simi
151
154
152
155
### Download IRT
153
156
154
-
IRT is distributed via tarball from the release section of the nexus-samples GitHub repo.
157
+
IRT is distributed via tarball from the release section of the nexus-samples GitHub repo.
155
158
156
159
1. Find the release package marked with 'Latest', download it, extract it, and navigate to the `irt` directory.
157
160
1. Extract the tarball to the local file system: `mkdir -p irt && tar xf nexus-irt.tar.gz --directory ./irt`.
@@ -221,7 +224,7 @@ SERVICE_PRINCIPAL:
221
224
```
222
225
223
226
> [!NOTE]
224
-
> If all `SP_ID`,`SP_OBJECT_ID`,`SP_TENANT_ID`,`ADMIN_GROUP_OBJECT_ID`,`KV_NAME`,`KV_ID` are set in the yaml or as an environment variable the script skips creating them.
227
+
> If all `SP_ID`,`SP_OBJECT_ID`,`SP_TENANT_ID`,`ADMIN_GROUP_OBJECT_ID`,`KV_NAME`,`KV_ID` are set in the yaml or as an environment variable the script skips creating them. Please comment them out if you want the script to create and populate the values.
225
228
226
229
**RESULT:** This script prints values for `ADMIN_GROUP_OBJECT_ID`, `SP_ID`, `SP_OBJECT_ID`, `SP_TENANT`, `KV_NAME`, and `KV_ID`. The script sets the values back to the input yaml.
KV_NAME: "<provided-key-vault-name>" # If SP already exists please fill it in to retrieve the SP Password.
235
238
KV_ID: "<provided-key-vault-secret>" # If SP already exists please fill it in to retrieve the SP Password.
236
239
```
240
+
#### Create managed identity and security group
241
+
242
+
The supplemental script, `create-user-assigned-managed-identity.sh` creates a managed identity with the custom role `NRT Roles` associates the role `NRT Roles` to an existing managed identity.
243
+
244
+
Executing `create-user-assigned-managed-identity.sh` requires the input yaml to have the following values. All values can be overridden by setting the corresponding environment variables:
* `UAMI.NAME` - The name of the managed identity, created with the `az identity create` command.
252
+
* `UAMI.SUBSCRIPTION` - The subscription of the managed identity.
253
+
* `UAMI.RESOURCE_GROUP` - The Resource Group where the managed identity is created.
254
+
255
+
> [!NOTE]
256
+
> Please ensure that you have already created a KeyVault (KV_NAME) and/or a Secret (KV_ID) with a dummy value prior to executing `create-service-principal.sh`. The `az login` user (person executing IRT) should also be granted access to this KeyVault so secrets can be pulled at runtime.
> If all `UAMI_ID`,`UAMI_RESOURCE_ID`,`UAMI_TENANT_ID` are set in the yaml or as an environment variable the script skips creating them. Please comment them out if you want the script to create and populate the values.
265
+
266
+
**RESULT:** This script prints values for `UAMI_ID`, `UAMI_RESOURCE_ID` and `UAMI_TENANT_ID`. The script sets the values back to the input yaml.
267
+
See [Input Configuration](#input-configuration).
268
+
269
+
```yml
270
+
UAMI_ID: "<generated-uami-id>"
271
+
UAMI_RESOURCE_ID: "<generated-uami-resource-id>"
272
+
UAMI_TENANT_ID: "<generated-uami-tenant-id>"
273
+
```
237
274
238
275
#### Creating a custom role for execution
239
276
240
-
If you have an existing service principal and would like the convenience of only having to assign one role for IRT execution, you can follow the directions in this section.
277
+
If you have an existing managed identity and would like the convenience of only having to assign the custom roles for IRT execution, you can follow the directions in this section.
241
278
242
279
##### Prerequisites
243
280
244
281
- Azure Subscription
245
-
- Ensure you have access to an Azure subscription.
282
+
- Ensure you have access to an Azure subscription.
246
283
- Azure CLI
247
-
- Ensure Azure CLI exists on your local machine
284
+
- Ensure Azure CLI exists on your local machine
248
285
249
286
##### Steps
250
287
@@ -271,7 +308,7 @@ If you have an existing service principal and would like the convenience of only
271
308
# Set our variable values, these values are for the sake of example. Replace these values with your own as needed.
272
309
location="eastus"
273
310
deploymentName="IRTRoleDefinitionDeployment"
274
-
templatePath="framework-templates/service-principal-roles.jsonc" # Path to the template file assuming the PWD is the root of the artifact tar
311
+
templatePathSPRole="service-principal-roles.jsonc" # Path to the template file assuming the PWD is the root of the artifact tar
275
312
roleName="Nexus Instance Readiness Tester"
276
313
277
314
# run deployment
@@ -282,15 +319,18 @@ If you have an existing service principal and would like the convenience of only
282
319
--parameters roleName="$roleName"
283
320
```
284
321
285
-
1. Assign Role to Application Service Principal used for testing
322
+
1. Assign Role to Application Service Principal and Managed Identity used for testing
286
323
287
-
Weather created via the all-in-one setup, or using your own, assign the newly created role to your identity. This single role provides all the necessary authorizations to run Instance Readiness Testing.
324
+
Weather created via the all-in-one setup, or using your own, assign the newly created role to your service principal and managed identity. These two roles provides all the necessary authorizations to run Instance Readiness Testing.
288
325
289
326
```bash
290
327
# The Application ID of your Service Principal for your application
291
328
appId="00001111-aaaa-2222-bbbb-3333cccc4444"
329
+
# The Object(principal) ID of your Managed Identity for your application
# az role definition list --name "$roleName" --query "[0].id" --output tsv | awk -F'/' '{print $NF}'
@@ -305,6 +345,13 @@ If you have an existing service principal and would like the convenience of only
305
345
--role "$(az role definition list --name "$roleName" --query "[0].id" --output tsv | awk -F'/' '{print $NF}')" \
306
346
--scope "/subscriptions/$(az account show --query id --output tsv --only-show-errors)"
307
347
348
+
az role assignment create \
349
+
--assignee "$principalId" \
350
+
--subscription "$(az account show --query id --output tsv --only-show-errors)" \
351
+
--role "$(az role definition list --name "$roleName" --query "[0].id" --output tsv | awk -F'/' '{print $NF}')" \
352
+
--scope "/subscriptions/$(az account show --query id --output tsv --only-show-errors)"
353
+
```
354
+
308
355
#### Create L3 isolation domains
309
356
310
357
The testing framework doesn't create, destroy, or manipulate isolation domains. Therefore, existing isolation domains can be used for execution. Each isolation domain requires at least one external network. The supplemental script, `create-l3-isolation-domains.sh`. Internal networks, for example, L3, trunked, etc. are created, manipulated, and destroyed through the course of testing.
@@ -381,7 +428,7 @@ description of it under standard log.
0 commit comments