Skip to content

Commit d4ee930

Browse files
Merge pull request #296565 from kroyburman/main
[operator-nexus] Updated instructions for running IRT
2 parents c36cc2f + 100e1bb commit d4ee930

File tree

1 file changed

+61
-13
lines changed

1 file changed

+61
-13
lines changed

articles/operator-nexus/howto-run-instance-readiness-testing.md

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ The Instance Readiness Test (IRT) framework is an optional/add-on tool for the N
5050
Every average metric should be greater than 0.
5151
- Validate that KubeletRunningPods metric data is present within the last 10 minutes.
5252
Every average metric should be greater than 0.
53+
- Validate that ControllerRuntimeReconcileTotal2 metric data is present within the last 10 minutes.
54+
Every average metric should be greater than 0.
55+
This metric needs to be filtered on namespace until the deprecated metric ControllerRuntimeReconcileTotal is removed.
5356
- Validate that CpuUtilizationMax metric data for fabric network device is present within the last 10 minutes.
5457
At least one non-zero metric should exist.
5558
- Validate that MemoryAvailable metric data is present within the last 10 minutes.
@@ -117,9 +120,9 @@ IRT requires gaining access to the software package hosted in the GitHub Nexus-S
117120

118121
For access to the nexus-samples GitHub repository
119122

120-
1. Link your GitHub account to the Microsoft GitHub Org <https://repos.opensource.microsoft.com/link>
123+
1. Link your GitHub account to the Microsoft GitHub Org <https://repos.opensource.microsoft.com/link>
121124

122-
2. Join the Microsoft Org <https://repos.opensource.microsoft.com/orgs/Microsoft/join>
125+
2. Join the Microsoft Org <https://repos.opensource.microsoft.com/orgs/Microsoft/join>
123126

124127
3. Send an email request to be added to nexus-samples GitHub repo to afoncamalgamatesall\@microsoft.com
125128

@@ -132,12 +135,13 @@ For access to the nexus-samples GitHub repository
132135
* Networks to use for the test are specified in a "networks-blueprint.yml" file, see [Input Configuration](#input-configuration).
133136
- A way to download the IRT release package, for example, curl, wget, etc.
134137
- The ability to create a service principal with the correct roles.
138+
- The ability to create a managed identity with the correct roles.
135139
- The ability to read secrets from the KeyVault, see [Service Principal](#create-service-principal-and-security-group) section for more details.
136140
- The ability to create security groups in your Active Directory tenant.
137141

138142
## Input configuration
139143

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.
144+
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.
141145

142146
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:
143147

@@ -151,7 +155,7 @@ You can provide the network information in a `networks-blueprint.yml` file, simi
151155

152156
### Download IRT
153157

154-
IRT is distributed via tarball from the release section of the nexus-samples GitHub repo.
158+
IRT is distributed via tarball from the release section of the nexus-samples GitHub repo.
155159

156160
1. Find the release package marked with 'Latest', download it, extract it, and navigate to the `irt` directory.
157161
1. Extract the tarball to the local file system: `mkdir -p irt && tar xf nexus-irt.tar.gz --directory ./irt`.
@@ -221,7 +225,7 @@ SERVICE_PRINCIPAL:
221225
```
222226

223227
> [!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.
228+
> 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.
225229

226230
**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.
227231
See [Input Configuration](#input-configuration).
@@ -234,17 +238,51 @@ ADMIN_GROUP_OBJECT_ID: "<generated-aad-group-id>"
234238
KV_NAME: "<provided-key-vault-name>" # If SP already exists please fill it in to retrieve the SP Password.
235239
KV_ID: "<provided-key-vault-secret>" # If SP already exists please fill it in to retrieve the SP Password.
236240
```
241+
#### Create managed identity and security group
242+
243+
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.
244+
245+
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:
246+
```yml
247+
UAMI:
248+
NAME: "<name>" # env: UAMI_NAME
249+
SUBSCRIPTION: "<subscription>" # env: UAMI_SUBSCRIPTION
250+
RESOURCE_GROUP: "<resourcegroup" # env: UAMI_RESOURCE_GROUP
251+
```
252+
* `UAMI.NAME` - The name of the managed identity, created with the `az identity create` command.
253+
* `UAMI.SUBSCRIPTION` - The subscription of the managed identity.
254+
* `UAMI.RESOURCE_GROUP` - The Resource Group where the managed identity is created.
255+
256+
> [!NOTE]
257+
> 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.
258+
259+
```bash
260+
# Example execution of the script
261+
./create-user-assigned-managed-identity.sh irt-input.yml
262+
```
263+
264+
> [!NOTE]
265+
> 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.
266+
267+
**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.
268+
See [Input Configuration](#input-configuration).
269+
270+
```yml
271+
UAMI_ID: "<generated-uami-id>"
272+
UAMI_RESOURCE_ID: "<generated-uami-resource-id>"
273+
UAMI_TENANT_ID: "<generated-uami-tenant-id>"
274+
```
237275

238276
#### Creating a custom role for execution
239277

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.
278+
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.
241279

242280
##### Prerequisites
243281

244282
- Azure Subscription
245-
- Ensure you have access to an Azure subscription.
283+
- Ensure you have access to an Azure subscription.
246284
- Azure CLI
247-
- Ensure Azure CLI exists on your local machine
285+
- Ensure Azure CLI exists on your local machine
248286

249287
##### Steps
250288

@@ -271,7 +309,7 @@ If you have an existing service principal and would like the convenience of only
271309
# Set our variable values, these values are for the sake of example. Replace these values with your own as needed.
272310
location="eastus"
273311
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
312+
templatePathSPRole="service-principal-roles.jsonc" # Path to the template file assuming the PWD is the root of the artifact tar
275313
roleName="Nexus Instance Readiness Tester"
276314
277315
# run deployment
@@ -282,15 +320,18 @@ If you have an existing service principal and would like the convenience of only
282320
--parameters roleName="$roleName"
283321
```
284322

285-
1. Assign Role to Application Service Principal used for testing
323+
1. Assign Role to Application Service Principal and Managed Identity used for testing
286324

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.
325+
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.
288326

289327
```bash
290328
# The Application ID of your Service Principal for your application
291329
appId="00001111-aaaa-2222-bbbb-3333cccc4444"
330+
# The Object(principal) ID of your Managed Identity for your application
331+
principalId="00001111-aaaa-2222-bbbb-3333cccc5555"
292332
# this MUST match the deployment name used above.
293-
deploymentName="IRTRoleDefinitionDeployment"
333+
roleName="Nexus Instance Readiness Tester"
334+
294335
295336
# This command gets the name of GUID of the role
296337
# az role definition list --name "$roleName" --query "[0].id" --output tsv | awk -F'/' '{print $NF}'
@@ -305,6 +346,13 @@ If you have an existing service principal and would like the convenience of only
305346
--role "$(az role definition list --name "$roleName" --query "[0].id" --output tsv | awk -F'/' '{print $NF}')" \
306347
--scope "/subscriptions/$(az account show --query id --output tsv --only-show-errors)"
307348
349+
az role assignment create \
350+
--assignee "$principalId" \
351+
--subscription "$(az account show --query id --output tsv --only-show-errors)" \
352+
--role "$(az role definition list --name "$roleName" --query "[0].id" --output tsv | awk -F'/' '{print $NF}')" \
353+
--scope "/subscriptions/$(az account show --query id --output tsv --only-show-errors)"
354+
```
355+
308356
#### Create L3 isolation domains
309357

310358
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 +429,7 @@ description of it under standard log.
381429
An example of an Asserter:
382430

383431
*Asserters \[It\] res-test-dpdk-naks-84f5b - network: \'l3network-704\'
384-
(*_PMD) average of Rx-pps \[17668558\] should be greater than 8000000_.
432+
(**PMD) average of Rx-pps \[17668558\] should be greater than 8000000*.
385433

386434
The above example of an assert reads as the Rx (receive)-pps (packets
387435
per seconds) for l3network-704 is 17668558, which is greater than the

0 commit comments

Comments
 (0)