Skip to content

Commit

Permalink
AIO patch (#2717)
Browse files Browse the repository at this point in the history
* add new images

* removing --no-block

* add wait for extension
  • Loading branch information
sebassem authored Sep 17, 2024
1 parent 15a1a6a commit ff8adae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ az extension add --name connectedk8s --version 1.3.17

# Making extension install dynamic
if ($aioConfig.AzCLIExtensions.Count -ne 0) {
Write-Host "[$(Get-Date -Format t)] INFO: Installing Azure CLI extensions: " ($aioConfig.AzCLIExtensions -join ', ') -ForegroundColor DarkGray
Write-Host "[$(Get-Date -Format t)] INFO: Installing Azure CLI extensions" -ForegroundColor DarkGray
az config set extension.use_dynamic_install=yes_without_prompt --only-show-errors
# Installing Azure CLI extensions
foreach ($extension in $aioConfig.AzCLIExtensions) {
Expand Down Expand Up @@ -413,7 +413,7 @@ $maxRetries = 5
$aioStatus = "notDeployed"

do {
az iot ops init --cluster $arcClusterName.toLower() -g $resourceGroup --kv-id $keyVaultId --sp-app-id $spnClientId --sp-secret $spnClientSecret --sp-object-id $spnObjectId --mq-service-type loadBalancer --mq-insecure true --simulate-plc false --no-block --only-show-errors
az iot ops init --cluster $arcClusterName.toLower() -g $resourceGroup --kv-id $keyVaultId --sp-app-id $spnClientId --sp-secret $spnClientSecret --sp-object-id $spnObjectId --mq-service-type loadBalancer --mq-insecure true --simulate-plc false --only-show-errors
if ($? -eq $false) {
$aioStatus = "notDeployed"
Write-Host "`n"
Expand Down Expand Up @@ -448,7 +448,6 @@ if ($retryCount -eq $maxRetries) {
exit 1 # Exit the script
}


Write-Host "[$(Get-Date -Format t)] INFO: Started Event Grid role assignment process" -ForegroundColor DarkGray
$extensionPrincipalId = (az k8s-extension list --cluster-name $arcClusterName --resource-group $resourceGroup --cluster-type "connectedClusters" --query "[?extensionType=='microsoft.iotoperations.mq']" --output json | ConvertFrom-Json).identity.principalId
#$extensionPrincipalId = (az k8s-extension show --cluster-name $arcClusterName --name "mq" --resource-group $resourceGroup --cluster-type "connectedClusters" --output json | ConvertFrom-Json).identity.principalId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: mqtt-listener
image: jumpstartprod.azurecr.io/mqtt-listener:latest
image: jumpstartprod.azurecr.io/contoso-bakeries-mqtt-listener:latest
resources:
limits:
memory: "512Mi"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: mqtt-simulator
image: jumpstartprod.azurecr.io/mqtt-simulator:latest
image: jumpstartprod.azurecr.io/contoso-bakeries-mqtt-simulator:latest
resources:
limits:
cpu: "1"
Expand Down
13 changes: 10 additions & 3 deletions azure_jumpstart_ag/artifacts/PowerShell/Modules/manufacturing.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,17 @@ function Deploy-AIO {
Write-Host "[$(Get-Date -Format t)] ERROR: AIO deployment failed. Exiting..." -ForegroundColor White -BackgroundColor Red
exit 1 # Exit the script
}
#Write-Host "AIO deployed successfully on the $clusterName cluster" -ForegroundColor Green
#Write-Host "`n"

do{
$extensionPrincipalId = (az k8s-extension list --cluster-name $arcClusterName --resource-group $resourceGroup --cluster-type "connectedClusters" --query "[?extensionType=='microsoft.iotoperations.mq']" --output json | ConvertFrom-Json).identity.principalId
if($null -eq $extensionPrincipalId){
Write-Host "Waiting for the mq extension to be installed...waiting for 60 seconds" -ForegroundColor DarkGray
Start-Sleep -Seconds 60
}
}until($null -ne $extensionPrincipalId)

Write-Host "[$(Get-Date -Format t)] INFO: Started Event Grid role assignment process" -ForegroundColor DarkGray
$extensionPrincipalId = (az k8s-extension list --cluster-name $arcClusterName --resource-group $resourceGroup --cluster-type "connectedClusters" --query "[?extensionType=='microsoft.iotoperations.mq']" --output json | ConvertFrom-Json).identity.principalId
#$extensionPrincipalId = (az k8s-extension list --cluster-name $arcClusterName --resource-group $resourceGroup --cluster-type "connectedClusters" --query "[?extensionType=='microsoft.iotoperations.mq']" --output json | ConvertFrom-Json).identity.principalId
#$extensionPrincipalId = (az k8s-extension show --cluster-name $arcClusterName --name "mq" --resource-group $resourceGroup --cluster-type "connectedClusters" --output json | ConvertFrom-Json).identity.principalId
$eventGridTopicId = (az eventgrid topic list --resource-group $resourceGroup --query "[0].id" -o tsv --only-show-errors)
$eventGridNamespaceName = (az eventgrid namespace list --resource-group $resourceGroup --query "[0].name" -o tsv --only-show-errors)
Expand Down

0 comments on commit ff8adae

Please sign in to comment.