Skip to content

Commit 6746d2d

Browse files
authored
Merge pull request #1183 from prestist/add-kola-argument-azure-managed
kola-azure: add azure_managed_identity to jenkins
2 parents 1870caf + b606d6a commit 6746d2d

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

HACKING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,19 @@ oc annotate secret/azure-kola-tests-config \
212212
jenkins.io/credentials-description="Azure kola tests credentials config"
213213
```
214214

215+
If you want to establish an authorized identity to pre-emptively grant access
216+
to other Azure resources, enabling the startup process to leverage Azure's default
217+
credentials, use the azure-kola-managed-identity:
218+
219+
```
220+
oc create secret generic azure-kola-managed-identity \
221+
--from-file=text="${MANAGED_IDENTITY_ID}"
222+
oc label secret/azure-kola-managed-identity \
223+
jenkins.io/credentials-type=secretText
224+
oc annotate secret/azure-kola-managed-identity \
225+
jenkins.io/credentials-description="Azure managed identity credentials"
226+
```
227+
215228
NOTE: For the prod pipeline these secrets can be found in BitWarden
216229

217230
### [OPTIONAL] Creating OpenStack credentials configs

jobs/kola-azure.Jenkinsfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ cosaPod(memory: "${cosa_memory_request_mb}Mi", kvm: false,
8888
}
8989
}
9090

91-
withCredentials([file(variable: 'AZURE_KOLA_TESTS_CONFIG',
92-
credentialsId: 'azure-kola-tests-config')]) {
91+
withCredentials([
92+
file(variable: 'AZURE_KOLA_TESTS_CONFIG', credentialsId: 'azure-kola-tests-config'),
93+
string(variable: 'AZURE_KOLA_MANAGED_IDENTITY', credentialsId: 'azure-kola-managed-identity')
94+
]) {
9395

9496
def azure_testing_resource_group = pipecfg.clouds?.azure?.test_resource_group
9597
def azure_testing_storage_account = pipecfg.clouds?.azure?.test_storage_account
@@ -149,6 +151,7 @@ cosaPod(memory: "${cosa_memory_request_mb}Mi", kvm: false,
149151
platformArgs: """-p=azure \
150152
--azure-credentials \${AZURE_KOLA_TESTS_CONFIG} \
151153
--azure-location $region \
154+
--azure-managed-identity \${AZURE_KOLA_MANAGED_IDENTITY} \
152155
--azure-disk-uri /subscriptions/${azure_subscription}/resourceGroups/${azure_testing_resource_group}/providers/Microsoft.Compute/galleries/${azure_testing_gallery}/images/${azure_image_name}/versions/1.0.0""")
153156
} finally {
154157
parallel "Delete Image": {

0 commit comments

Comments
 (0)