Skip to content

Commit 37e92ed

Browse files
Merge pull request #248100 from robivictor/update-irt-doc
[operator-nexus] update IRT doc
2 parents 3c516b3 + 1351bd6 commit 37e92ed

File tree

1 file changed

+114
-47
lines changed

1 file changed

+114
-47
lines changed

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

Lines changed: 114 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.date: 07/13/2023
99
ms.custom: template-how-to
1010
---
1111

12-
# Instance readiness testing
12+
# Instance Readiness Testing
1313

1414
Instance Readiness Testing (IRT) is a framework built to orchestrate real-world workloads for testing of the Azure Operator Nexus Platform.
1515

@@ -20,7 +20,7 @@ Instance Readiness Testing (IRT) is a framework built to orchestrate real-world
2020
* Networks to use for the test are specified in a "networks-blueprint.yml" file, see [Input Configuration](#input-configuration).
2121
- curl to download IRT package
2222
- The User Access Admin & Contributor roles for the execution subscription
23-
- The ability to create security groups in your Active Directory tenant
23+
- The ability to create security groups in your Active Directory tenant
2424

2525
## Input configuration
2626

@@ -32,12 +32,12 @@ The network information is provided in either a `networks-blueprint.yml` file, s
3232
* Two of them with MTU 1500
3333
* One of them with MTU 9000 and shouldn't have a fabric_asn attribute
3434
* One (1) Trunked Network
35-
* All vlans should be greater than 500
35+
* All VLANs should be greater than 500
3636

3737
## One Time Setup
3838

39-
### Download IRT
40-
IRT is distributed via tarball, download it, extract it, and navigate to the `irt` directory
39+
### Download IRT
40+
IRT is distributed via tarball, download it, extract it, and navigate to the `irt` directory.
4141
1. From your Linux environment, download nexus-irt.tar.gz from aka.ms/nexus-irt `curl -Lo nexus-irt.tar.gz aka.ms/nexus-irt`
4242
1. Extract the tarball to the local file system: `mkdir -p irt && tar xf nexus-irt.tar.gz --directory ./irt`
4343
1. Switch to the new directory `cd irt`
@@ -49,97 +49,164 @@ There are multiple dependencies expected to be available during execution. Revie
4949
* `jq` version 1.6 or greater
5050
* `yq` version 4.33 or greater
5151
* `azcopy` version 10 or greater
52-
* `az` Azure CLI minimum version not known, stay up to date.
52+
* `az` Azure CLI, stay up to date. Minimum expected version: 2.11.0(supports self upgrade)
5353
* `elinks` - for viewing html files on the command line
5454
* `tree` - for viewing directory structures
55-
* `moreutils` - for viewing progress from the ACI container
55+
* `moreutils` - for viewing progress from the Azure Container Instance (ACI) container
5656

5757
The `setup.sh` script is provided to aid with installing the listed dependencies. It installs any dependencies that aren't available in PATH. It doesn't upgrade any dependencies that don't meet the minimum required versions.
5858

59-
> [!NOTE]
59+
> [!NOTE]
6060
> `setup.sh` assumes a nonroot user and attempts to use `sudo`
6161
6262
### All in one setup
6363

64-
`all-in-one-setup.sh` is provided to create all of the Azure resources required to run IRT. This process includes creating a managed identity, a service principal, a security group, isolation domains, and a storage account to archive the test results. These resources can be created during the all in one script, or they can be created step by step per the instructions in this document. Each of the script, individually and via the all in one script, writes updates to your `irt-input.yml` file with the key value pairs needed to utilize the resources you created. Review the `irt-input.example.yml` file for the required inputs needed for the script(s), regardless of the methodology you pursue. All of the scripts are idempotent, and also allow you to use existing resources if desired.
65-
64+
`all-in-one-setup.sh` is provided to create all of the Azure resources required to run IRT. This process includes creating a managed identity, a service principal, a security group, isolation domains, and a storage account to archive the test results. These resources can be created during the all in one script, or they can be created step by step per the instructions in this document. Each of the script, individually and via the all in one script, writes updates to your `irt-input.yml` file with the key value pairs needed to utilize the resources you created. Review the `irt-input.example.yml` file for the required inputs needed for one or more of the scripts, regardless of the methodology you pursue. All of the scripts are idempotent, and also allow you to use existing resources if desired.
6665
### Step-by-Step setup
6766

6867
> [!NOTE]
6968
> Only use this section if you're NOT using `all-in-one.sh`
7069
71-
If your workflow is incompatible with `all-in-one.sh`, each resource needed for IRT can be created manually with each supplemental script. Like `all-in-one.sh`, running these scripts writes key/value pairs to your `irt-input.yml` for you to use during your run. These five scripts make up the `all-in-one.sh`.
70+
If your workflow is incompatible with `all-in-one.sh`, each resource needed for IRT can be created manually with each supplemental script. Like `all-in-one.sh`, running these scripts writes key/value pairs to your `irt-input.yml` for you to use during your run. These four scripts make up the `all-in-one.sh`.
7271

73-
IRT makes commands against your resources, and needs permission to do so. IRT requires a Managed Identity and a Service Principal to execute. It also requires that the service principal is a member of the Azure AD Security Group that is also provided as input.
72+
IRT makes commands against your resources, and needs permission to do so. IRT requires a managed identity and a service principal to execute. It also requires that the service principal is a member of the Azure AD Security Group that is also provided as input.
7473

7574
#### Create managed identity
76-
A managed identity with the following role assignments is needed to execute tests. The supplemental script, `create-managed-identity.sh` creates a managed identity with these role assignments.
77-
* `Contributor` - For creating and manipulating resources
78-
* `Storage Blob Data Contributor` - For reading from and writing to the storage blob container
79-
* `Log Analytics Reader` - For reading metadata about the LAW
80-
75+
<details>
76+
<summary>Expand to see how to create managed identity.</summary>
8177

82-
Executing `create-managed-identity.sh` requires the following environment variables to be set;
83-
* **MI_RESOURCE_GROUP** - The resource group the Managed Identity is created in. The resource group is created in `eastus` if the resource group provided doesn't yet exist.
84-
* **MI_NAME** - The name of the Managed Identity to be created.
85-
* **[Optional] SUBSCRIPTION** - to set the subscription. Alternatively, the script uses az CLI context to look up the subscription.
78+
A managed identity with the following role assignments is needed to execute tests. The supplemental script, `create-managed-identity.sh` creates a managed identity with these role assignments.
79+
* `Contributor` - For creating and manipulating resources
80+
* `Storage Blob Data Contributor` - For reading from and writing to the storage blob container
81+
* `Log Analytics Reader` - For reading metadata about the LAW
82+
* `Kubernetes Connected Cluster Role` - For read/write operations on connected cluster
83+
84+
Executing `create-managed-identity.sh` requires the input yaml to have the following properties, all of them can be overridden by the corresponding environment variables:
85+
```yml
86+
MANAGED_IDENTITY:
87+
RESOURCE_GROUP: "<resource-group>" # env: MANAGED_IDENTITY_RESOURCE_GROUP
88+
NAME: "<name>" # env: MANAGED_IDENTITY_NAME
89+
SUBSCRIPTION: "<subscription>" # env: MANAGED_IDENTITY_SUBSCRIPTION
90+
LOCATION: "<location>" # env: MANAGED_IDENTITY_LOCATION
91+
```
92+
* `MANAGED_IDENTITY.RESOURCE_GROUP` - The resource group the managed identity is created in.
93+
* `MANAGED_IDENTITY.NAME` - The name of the managed identity to be created.
94+
* `MANAGED_IDENTITY.SUBSCRIPTION` - The subscription where the resource group should reside.
95+
* `MANAGED_IDENTITY.LOCATION` - The location to create the resource group.
8696

8797
```bash
8898
# Example execution of the script
89-
MI_RESOURCE_GROUP="<your resource group>" MI_NAME="<your managed identity name>" SUBSCRIPTION="<your subscription ID>" ./create-managed-identity.sh
99+
./create-managed-identity.sh irt-input.yml
90100
```
91101

92-
**RESULT:** This script prints a value for `MANAGED_IDENTITY_ID`. This key/value pair should be recorded in the irt-input.yml for use. See [Input Configuration](#input-configuration).
102+
> [!NOTE]
103+
> if `MANAGED_IDENTITY_ID` is set in the input yaml or as an environment variable the script won't create anything.
93104

105+
**RESULT:** This script prints a value for `MANAGED_IDENTITY_ID` and sets it to the input.yml.
106+
See [Input Configuration](#input-configuration).
107+
108+
```yml
109+
MANAGED_IDENTITY_ID: <generated_id>
110+
```
111+
</details>
94112

95113
#### Create service principal and security group
96-
A service principal with the following role assignments. The supplemental script, `create-service-principal.sh` creates a service principal with these role assignments, or add role assignments to an existing service principal.
97-
* `Contributor` - For creating and manipulating resources
98-
* `Storage Blob Data Contributor` - For reading from and writing to the storage blob container
99-
* `Azure ARC Kubernetes Admin` - For ARC enrolling the NAKS cluster
114+
<details>
115+
<summary>Expand to see how to create service principal and security group.</summary>
116+
117+
A service principal with the following role assignments. The supplemental script, `create-service-principal.sh` creates a service principal with these role assignments, or add role assignments to an existing service principal.
118+
119+
* `Contributor` - For creating and manipulating resources
120+
* `Storage Blob Data Contributor` - For reading from and writing to the storage blob container
121+
* `Azure ARC Kubernetes Admin` - For ARC enrolling the NAKS cluster
100122

101123
Additionally, the script creates the necessary security group, and adds the service principal to the security group. If the security group exists, it adds the service principal to the existing security group.
102124

103-
Executing `create-service-principal.sh` requires the following environment variables to be set:
104-
* SERVICE_PRINCIPAL_NAME - The name of the service principal, created with the `az ad sp create-for-rbac` command.
105-
* AAD_GROUP_NAME - The name of the security group.
125+
Executing `create-service-principal.sh` requires the input yaml to have the following properties, all of them can be overridden by the corresponding environment variables:
126+
```yml
127+
SERVICE_PRINCIPAL:
128+
NAME: "<name>" # env: SERVICE_PRINCIPAL_NAME
129+
AAD_GROUP_NAME: "<aad-group-name>" # env: SERVICE_PRINCIPAL_AAD_GROUP_NAME
130+
SUBSCRIPTION: "<subscription>" # env: SERVICE_PRINCIPAL_SUBSCRIPTION
131+
```
132+
* `SERVICE_PRINCIPAL.NAME` - The name of the service principal, created with the `az ad sp create-for-rbac` command.
133+
* `SERVICE_PRINCIPAL.AAD_GROUP_NAME` - The name of the security group.
134+
* `SERVICE_PRINCIPAL.SUBSCRIPTION` - The subscription of the service principal.
106135

107136
```bash
108137
# Example execution of the script
109-
SERVICE_PRINCIPAL_NAME="<your service principal name>" AAD_GROUP_NAME="<your security group name>" ./create-service-principal.sh
138+
./create-service-principal.sh irt-input.yml
110139
```
111140

112-
**RESULT:** This script prints values for `AAD_GROUP_ID`, `SP_ID`, `SP_PASSWORD`, and `SP_TENANT`. This key/value pair should be recorded in irt-input.yml for use. See [Input Configuration](#input-configuration).
141+
> [!NOTE]
142+
> if all `SP_ID`,`SP_PASSWORD`,`SP_TENANT_ID`,`AAD_GROUP_ID` are set in the yaml or as an environment variable the script skips creating them.
113143

144+
**RESULT:** This script prints values for `AAD_GROUP_ID`, `SP_ID`, `SP_PASSWORD`, and `SP_TENANT` and sets the values back to the input yaml.
145+
See [Input Configuration](#input-configuration).
114146

115-
#### Create isolation domains
116-
The testing framework doesn't create, destroy, or manipulate isolation domains. Therefore, existing Isolation Domains can be used. Each Isolation Domain requires at least one external network. The supplemental script, `create-l3-isolation-domains.sh`. Internal networks are created, manipulated, and destroy through the course of testing. They're created using the data provided in the networks blueprint.
147+
```yml
148+
SP_ID: "<generated-sp-id>"
149+
SP_PASSWORD: "<generated-sp-password>" # If SP already exists sp password is not retreivable, please fill it in.
150+
SP_TENANT_ID: "<generated-sp-tenant-id>"
151+
AAD_GROUP_ID: "generated-aad-group-id"
152+
```
153+
</details>
154+
155+
#### Create l3 isolation domains
156+
<details>
157+
<summary>Expand to see how to create l3 isolation.</summary>
158+
159+
The testing framework doesn't create, destroy, or manipulate isolation domains. Therefore, existing isolation domains can be used. Each isolation domain requires at least one external network. The supplemental script, `create-l3-isolation-domains.sh`. Internal networks are created, manipulated, and destroyed through the course of testing.
160+
161+
Executing `create-l3-isolation-domains.sh` requires one **parameter**, a path to a file containing the networks requirements. You can choose either the standalone network-blueprint.yml or the input.yml based on your workflow, both should contain the information needed.
162+
163+
```bash
164+
# Example of the script being invoked using networks-blueprint.yml:
165+
./create-l3-isolation-domains.sh networks-blueprint.yml
166+
```
117167

118-
Executing `create-l3-isolation-domains.sh` requires one **parameter**, a path to your networks blueprint file:
119-
120168
```bash
121-
# Example of the script being invoked:
122-
./create-l3-isolation-domains.sh ./networks-blueprint.yml
169+
# Example of the script being invoked using irt-input.yml:
170+
# the network-blueprint should exist under NETWORK_BLUEPRINT node.
171+
./create-l3-isolation-domains.sh irt-input.yml
123172
```
173+
</details>
124174

125175
#### Create archive storage
126-
IRT creates an html test report after running a test scenario. These reports can optionally be uploaded to a blob storage container. the supplementary script `create-archive-storage.sh` to create a storage container, storage account, and resource group if they don't already exist.
176+
<details>
177+
<summary>Expand to see how to create archive storage.</summary>
178+
179+
IRT creates an html test report after running a test scenario. These reports can optionally be uploaded to a blob storage container. The supplementary script `create-archive-storage.sh` to create a storage container, storage account, and resource group if they don't already exist.
127180

181+
Executing `create-archive-storage.sh` requires the input yaml to have the following properties, all of them can be overridden by the corresponding environment variables:
128182

129-
Executing `create-managed-identity.sh` requires the following environment variables to be set:
130-
* **RESOURCE_GROUP** - The resource group the Managed Identity is created in. The resource group is created in `eastus` if the resource group provided doesn't yet exist.
131-
* **STORAGE_ACCOUNT_NAME** - The name of the Azure storage account to be created.
132-
* **STORAGE_CONTAINER_NAME** - The name of the blob storage container to be created.
133-
* **[Optional] SUBSCRIPTION** - to set the subscription. Alternatively, the script uses the az CLI context to look up the subscription.
183+
```yml
184+
ARCHIVE_STORAGE:
185+
RESOURCE_GROUP: "<resource-group>" # env: ARCHIVE_STORAGE_RESOURCE_GROUP
186+
ACCOUNT_NAME: "<storage-account-name>" # env: ARCHIVE_STORAGE_ACCOUNT_NAME
187+
CONTAINER_NAME: "<storage-container-name>" # env: ARCHIVE_STORAGE_CONTAINER_NAME
188+
SUBSCRIPTION: "<subscription>" # env: ARCHIVE_STORAGE_SUBSCRIPTION
189+
LOCATION: "<location>" # env: ARCHIVE_STORAGE_LOCATION
190+
```
191+
* `ARCHIVE_STORAGE_RESOURCE_GROUP` - The resource group the managed identity is created in.
192+
* `ARCHIVE_STORAGE_ACCOUNT_NAME` - The name of the Azure storage account to be created.
193+
* `ARCHIVE_STORAGE_CONTAINER_NAME` - The name of the blob storage container to be created.
194+
* `SUBSCRIPTION` - The subscription where the resource group is created in.
195+
* `LOCATION` - The location where the resource group is created in.
134196

197+
> [!NOTE]
198+
> if `PUBLISH_RESULTS_TO` is set in the input yaml or as an environment variable the script skips creating a new one.
135199

136200
```bash
137201
# Example execution of the script
138-
RESOURCE_GROUP="<your resource group>" STORAGE_ACCOUNT_NAME="<your storage account name>" STORAGE_CONTAINER_NAME="<your container name>" ./create-archive-storage.sh
202+
./create-archive-storage.sh irt-input.yaml
139203
```
140204

141-
**RESULT:** This script prints a value for `PUBLISH_RESULTS_TO`. This key/value pair should be recorded in irt-input.yml for use. See [Input Configuration](#input-configuration).
142-
205+
**RESULT:** This script prints a value for `PUBLISH_RESULTS_TO` and sets the value in the input.yml. See [Input Configuration](#input-configuration).
206+
```yml
207+
PUBLISH_RESULTS_TO: <generated_id>
208+
```
209+
</details>
143210

144211
## Execution
145212

0 commit comments

Comments
 (0)