Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arcbox 3.0 - update data ops issue #2592

Merged
merged 34 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f83e02b
replace capi
zaidmohd May 29, 2024
25238a3
fix az login
zaidmohd May 29, 2024
4f05383
update to managed identity
zaidmohd May 30, 2024
1334251
enable system assigned identity
zaidmohd May 30, 2024
e67a636
remove debugging
zaidmohd May 30, 2024
af8d36b
comment resource provider, this will be part of pre-req
zaidmohd Jun 5, 2024
d5e59bb
update ip address
zaidmohd Jun 5, 2024
c6cba69
remove kv extension
zaidmohd Jun 5, 2024
f846010
add kubevip for service ip
zaidmohd Jun 5, 2024
541d526
fix kube config
zaidmohd Jun 6, 2024
905f555
fix nic name
zaidmohd Jun 6, 2024
246b7d3
fix nic name
zaidmohd Jun 6, 2024
2cfb09b
fix kube config
zaidmohd Jun 6, 2024
18cd0b2
Add role assignment dependency
zaidmohd Jun 6, 2024
8d81c2b
add kubeconfig
zaidmohd Jun 6, 2024
866e104
update https
zaidmohd Jun 6, 2024
e3e4d91
remove kube vip rbac url
zaidmohd Jun 6, 2024
0866319
remove spn details
zaidmohd Jun 7, 2024
6e832f8
Merge branch 'arcbox_3.0' of https://github.com/microsoft/azure_arc i…
zaidmohd Jun 7, 2024
7eb8d7c
update k3s scripts
zaidmohd Jun 7, 2024
0a0b5bb
k3s reset script changes
zaidmohd Jun 10, 2024
f368c43
Fix resource name
zaidmohd Jun 12, 2024
d00752e
update icon names
zaidmohd Jun 12, 2024
9841453
fix format
zaidmohd Jun 13, 2024
ac20698
fix format
zaidmohd Jun 13, 2024
26e47c0
fix inline kubectl format
zaidmohd Jun 13, 2024
7995479
add retry for k3s gitops
zaidmohd Jun 14, 2024
5cf9318
update github account
zaidmohd Jun 14, 2024
49d6fab
Merge branch 'arcbox_3.0' of https://github.com/microsoft/azure_arc i…
zaidmohd Jun 14, 2024
04d864f
Merge branch 'microsoft:arcbox_3.0' into arcbox_3.0
zaidmohd Jul 4, 2024
124622b
fix custom location issue
zaidmohd Jul 4, 2024
e356c03
fix install k3s and k3s nodes
zaidmohd Jul 4, 2024
443c8f4
fix k3s issue
zaidmohd Jul 5, 2024
d70be40
Merge branch 'arcbox_3.0' into arcbox_3.0
zaidmohd Jul 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions azure_jumpstart_arcbox/artifacts/DataOpsAppDRScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Add-DnsServerResourceRecord -ComputerName $dcInfo.HostName -ZoneName $dcInfo.Dom
Add-DnsServerResourceRecordCName -Name $CName -ComputerName $dcInfo.HostName -HostNameAlias "$CName-$sqlInstance.jumpstart.local" -ZoneName jumpstart.local -TimeToLive 00:05:00

# Deploy the App and service
$appCAPI = @"
$appK3s = @"
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -67,7 +67,7 @@ spec:

"@
Write-Header "Deploying App Resource"
$appCAPI | kubectl apply -n $appNamespace -f -
$appK3s | kubectl apply -n $appNamespace -f -

# Deploy an Ingress Resource for the app
$appIngress = @"
Expand Down
8 changes: 4 additions & 4 deletions azure_jumpstart_arcbox/artifacts/DataOpsAppScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ foreach ($cluster in @('k3s', 'aks-dr')) {
helm install dataops-ingress nginx-stable/nginx-ingress
}

# Switch kubectl context to capi
# Switch kubectl context to k3s
kubectx $sqlInstance

Write-Header "Adding CName Record for App"
Expand All @@ -52,7 +52,7 @@ Add-DnsServerResourceRecord -ComputerName $dcInfo.HostName -ZoneName $dcInfo.Dom
Add-DnsServerResourceRecordCName -Name $CName -ComputerName $dcInfo.HostName -HostNameAlias "$CName-$sqlInstance.jumpstart.local" -ZoneName jumpstart.local -TimeToLive 00:05:00

# Deploy the App and service
$appCAPI = @"
$appK3s = @"
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -98,7 +98,7 @@ spec:

"@
Write-Header "Deploying App Resource"
$appCAPI | kubectl apply -n $appNamespace -f -
$appK3s | kubectl apply -n $appNamespace -f -

# Deploy an Ingress Resource for the app
$appIngress = @"
Expand Down Expand Up @@ -135,7 +135,7 @@ Do {
$podStatus = $(if(kubectl get pods -n $appNamespace | Select-String "web-app" | Select-String "Running" -Quiet){"Ready!"}Else{"Nope"})
} while ($podStatus -eq "Nope")

# Creating CAPI Bookstore Arc Icon on Desktop
# Creating K3s Bookstore Arc Icon on Desktop
$shortcutLocation = "$Env:Public\Desktop\Bookstore.lnk"
$wScriptShell = New-Object -ComObject WScript.Shell
$shortcut = $wScriptShell.CreateShortcut($shortcutLocation)
Expand Down
73 changes: 38 additions & 35 deletions azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $Env:ArcBoxIconDir = "C:\ArcBox\Icons"
$Env:ArcBoxTestsDir = "$Env:ArcBoxDir\Tests"

$clusters = @(
[pscustomobject]@{clusterName = $Env:k3sArcDataClusterName; dataController = "$Env:k3sArcDataClusterName-dc" ; customLocation = "$Env:k3sArcDataClusterName-cl" ; storageClassName = 'managed-premium' ; licenseType = 'LicenseIncluded' ; context = 'k3s' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-k3s" }
[pscustomobject]@{clusterName = $Env:k3sArcDataClusterName; dataController = "$Env:k3sArcDataClusterName-dc" ; customLocation = "$Env:k3sArcDataClusterName-cl" ; storageClassName = 'longhorn' ; licenseType = 'LicenseIncluded' ; context = 'k3s' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-datasvc-k3s" }
[pscustomobject]@{clusterName = $Env:aksArcClusterName ; dataController = "$Env:aksArcClusterName-dc" ; customLocation = "$Env:aksArcClusterName-cl" ; storageClassName = 'managed-premium' ; licenseType = 'LicenseIncluded' ; context = 'aks' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-aks" }
[pscustomobject]@{clusterName = $Env:aksdrArcClusterName ; dataController = "$Env:aksdrArcClusterName-dc" ; customLocation = "$Env:aksdrArcClusterName-cl" ; storageClassName = 'managed-premium' ; licenseType = 'DisasterRecovery' ; context = 'aks-dr'; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-aksdr" }
)
Expand Down Expand Up @@ -96,21 +96,21 @@ Write-Host "`n"

# Downloading k3s Kubernetes cluster kubeconfig file
Write-Header "Downloading k3s Kubeconfig"
$sourceFile = "https://$Env:stagingStorageAccountName.blob.core.windows.net/staging-k3s/config"
$sourceFile = "https://$Env:stagingStorageAccountName.blob.core.windows.net/$($Env:k3sArcDataClusterName.ToLower())/config"
$context = (Get-AzStorageAccount -ResourceGroupName $Env:resourceGroup).Context
$sas = New-AzStorageAccountSASToken -Context $context -Service Blob -ResourceType Object -Permission racwdlup
$sas = New-AzStorageAccountSASToken -Context $context -Service Blob -ResourceType Container,Object -Permission racwdlup
$sourceFile = $sourceFile + "?" + $sas
azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "C:\Users\$Env:adminUsername\.kube\config-k3s"
azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "C:\Users\$Env:adminUsername\.kube\config-datasvc-k3s"
azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "C:\Users\$Env:adminUsername\.kube\config"

$addsDomainNetBiosName = $Env:addsDomainName.Split(".")[0]
azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "C:\Users\$Env:adminUsername.$addsDomainNetBiosName\.kube\config"

# Downloading 'installk3s.log' log file
Write-Header "Downloading k3s Install Logs"
$sourceFile = "https://$Env:stagingStorageAccountName.blob.core.windows.net/staging-k3s/installK3s-$Env:k3sArcDataClusterName.log"
$sourceFile = "https://$Env:stagingStorageAccountName.blob.core.windows.net/$($Env:k3sArcDataClusterName.ToLower())/*"
$sourceFile = $sourceFile + "?" + $sas
azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "$Env:ArcBoxLogsDir\installk3s.log"
azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "$Env:ArcBoxLogsDir\" --include-pattern "*.log"

Start-Sleep -Seconds 10

Expand Down Expand Up @@ -157,20 +157,19 @@ foreach ($cluster in $clusters) {
}

foreach ($cluster in $clusters) {
if ($cluster.context -eq 'k3s') {
Write-Host "Enabling custom-locations feature on k3s cluster"
az connectedk8s enable-features -n $cluster.clusterName `
-g $Env:resourceGroup `
--custom-locations-oid $Env:customLocationRPOID `
--features cluster-connect custom-locations `
--kube-config $cluster.kubeConfig --only-show-errors

Write-Header "Configuring kube-vip on K3s cluster"
kubectx k3s
$k3sVIP = az network nic ip-config list --resource-group $Env:resourceGroup --nic-name $Env:k3sArcDataClusterName-NIC --query "[?primary == ``true``].privateIPAddress" -otsv

Write-Host "Assignin kube-vip-role on k3s cluster"

if ($cluster.context -eq 'k3s') {
Write-Host "Enabling custom-locations feature on k3s cluster"
az connectedk8s enable-features -n $cluster.clusterName `
-g $Env:resourceGroup `
--custom-locations-oid $Env:customLocationRPOID `
--features cluster-connect custom-locations `
--kube-config $cluster.kubeConfig --only-show-errors

Write-Header "Configuring kube-vip on K3s cluster"
kubectx k3s
$k3sVIP = az network nic ip-config list --resource-group $Env:resourceGroup --nic-name $Env:k3sArcDataClusterName-NIC --query "[?primary == ``true``].privateIPAddress" -otsv

Write-Host "Assignin kube-vip-role on k3s cluster"
$kubeVipRBAC = @"
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -215,7 +214,7 @@ subjects:
namespace: kube-system
"@

$kubeVipRBAC | kubectl apply -f -
$kubeVipRBAC | kubectl apply -f -

$kubeVipDaemonset = @"
apiVersion: apps/v1
Expand Down Expand Up @@ -308,24 +307,23 @@ status:
numberReady: 0
"@

Write-Host "Deploying Kube vip cloud controller on k3s cluster"
$kubeVipDaemonset | kubectl apply -f -
$kubeVipDaemonset | kubectl apply -f -

# Kube vip cloud controller
kubectl apply -f https://raw.githubusercontent.com/kube-vip/kube-vip-cloud-provider/main/manifest/kube-vip-cloud-controller.yaml
Write-Host "Deploying Kube vip cloud controller on k3s cluster"
kubectl apply -f https://raw.githubusercontent.com/kube-vip/kube-vip-cloud-provider/main/manifest/kube-vip-cloud-controller.yaml

$serviceIpRange = az network nic ip-config list --resource-group $Env:resourceGroup --nic-name $Env:k3sArcDataClusterName-NIC --query "[?primary == ``false``].privateIPAddress" -otsv
$sortedIps = $serviceIpRange | Sort-Object {[System.Version]$_}
$lowestServiceIp = $sortedIps[0]
$highestServiceIp = $sortedIps[-1]
$serviceIpRange = az network nic ip-config list --resource-group $Env:resourceGroup --nic-name $Env:k3sArcDataClusterName-NIC --query "[?primary == ``false``].privateIPAddress" -otsv
$sortedIps = $serviceIpRange | Sort-Object {[System.Version]$_}
$lowestServiceIp = $sortedIps[0]
$highestServiceIp = $sortedIps[-1]

kubectl create configmap -n kube-system kubevip --from-literal range-global=$lowestServiceIp-$highestServiceIp
Start-Sleep -Seconds 30
kubectl create configmap -n kube-system kubevip --from-literal range-global=$lowestServiceIp-$highestServiceIp
Start-Sleep -Seconds 30

Write-Host "Creating longhorn storage on K3scluster"
kubectl apply -f "$Env:ArcBoxDir\longhorn.yaml" --kubeconfig $cluster.kubeConfig
Start-Sleep -Seconds 30
Write-Host "`n"
Write-Host "Creating longhorn storage on K3scluster"
kubectl apply -f "$Env:ArcBoxDir\longhorn.yaml" --kubeconfig $cluster.kubeConfig
Start-Sleep -Seconds 30
Write-Host "`n"
}
}

Expand All @@ -334,6 +332,10 @@ Stop-Transcript
# - Deploying data services on k3s cluster
################################################

Start-Process pwsh.exe -ArgumentList "-NoExit", "-Command", "[System.Console]::Title = 'k3s Cluster'; for (0 -lt 1) { kubectl get pods -n arc --kubeconfig ""C:\Users\$Env:USERNAME\.kube\config-datasvc-k3s"" ; Start-Sleep -Seconds 5; Clear-Host }"
Start-Process pwsh.exe -ArgumentList "-NoExit", "-Command", "[System.Console]::Title = 'AKS Cluster'; for (0 -lt 1) { kubectl get pods -n arc --kubeconfig ""C:\Users\$Env:USERNAME\.kube\config-aks"" ; Start-Sleep -Seconds 5; Clear-Host }"
Start-Process pwsh.exe -ArgumentList "-NoExit", "-Command", "[System.Console]::Title = 'AKS-DR Cluster'; for (0 -lt 1) { kubectl get pods -n arc --kubeconfig ""C:\Users\$Env:USERNAME\.kube\config-aksdr"" ; Start-Sleep -Seconds 5; Clear-Host }"

wt --% --maximized new-tab pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:USERNAME\.kube\config-k3s" -clusterName 'k3s Cluster'; split-pane -p "PowerShell" pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:USERNAME\.kube\config-aks" -clusterName 'AKS Cluster'; split-pane -H pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:USERNAME\.kube\config-aksdr" -clusterName 'AKS-DR Cluster'

Write-Header "Deploying Azure Arc Data Controllers on Kubernetes cluster"
Expand Down Expand Up @@ -395,6 +397,7 @@ $clusters | Foreach-Object -ThrottleLimit 5 -Parallel {
(Get-Content -Path $dataControllerParams) -replace 'subscriptionId-stage', $Env:subscriptionId | Set-Content -Path $dataControllerParams
(Get-Content -Path $dataControllerParams) -replace 'logAnalyticsWorkspaceId-stage', $workspaceId | Set-Content -Path $dataControllerParams
(Get-Content -Path $dataControllerParams) -replace 'logAnalyticsPrimaryKey-stage', $workspaceKey | Set-Content -Path $dataControllerParams
(Get-Content -Path $dataControllerParams) -replace 'storageClass-stage', $cluster.storageClassName | Set-Content -Path $dataControllerParams

Write-Host "Deploying arc data controller on $clusterName"
Write-Host "`n"
Expand Down
8 changes: 4 additions & 4 deletions azure_jumpstart_arcbox/artifacts/DataOpsTestAppScript.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$Env:ArcBoxLogsDir = "C:\ArcBox\Logs"

$appNamespace = "arc"
$sqlInstance = "capi"
$sqlInstance = "k3s"

Start-Transcript -Path $Env:ArcBoxLogsDir\DataOpsTestAppScript.log

# Switch kubectl context to capi
# Switch kubectl context to k3s
kubectx $sqlInstance
# Deploy the App and service
$appCAPI = @"
$appK3s = @"
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -37,7 +37,7 @@ spec:

"@
Write-Header "Deploying DB Connect Test App"
$appCAPI | kubectl apply -n $appNamespace -f -
$appK3s | kubectl apply -n $appNamespace -f -

Do {
Write-Host "Waiting for App pod, hold tight..."
Expand Down
2 changes: 1 addition & 1 deletion azure_jumpstart_arcbox/artifacts/DeployAPIM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ az config set extension.use_dynamic_install=yes_without_prompt
################################################
# Retrive SQL Managed Instances
################################################
kubectx arcbox-capi
kubectx arcbox-datasvc-k3s
kubectl get nodes

# Retrieving SQL MI connection endpoints
Expand Down
2 changes: 1 addition & 1 deletion azure_jumpstart_arcbox/artifacts/DeployPostgreSQL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $coordinatorCoresLimit = "4"
$coordinatorMemoryLimit = "8Gi"

# Storage
$StorageClassName = "managed-premium"
$StorageClassName = "longhorn"
$dataStorageSize = "5Gi"
$logsStorageSize = "5Gi"

Expand Down
4 changes: 2 additions & 2 deletions azure_jumpstart_arcbox/artifacts/DeploySQLMI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Write-Host "Deploying Azure Arc SQL Managed Instance"
Write-Host "`n"

$dataControllerId = $(az resource show --resource-group $Env:resourceGroup --name $controllerName --resource-type "Microsoft.AzureArcData/dataControllers" --query id -o tsv)
$customLocationId = $(az customlocation show --name "$Env:capiArcDataClusterName-cl" --resource-group $Env:resourceGroup --query id -o tsv)
$customLocationId = $(az customlocation show --name "$Env:k3sArcDataClusterName-cl" --resource-group $Env:resourceGroup --query id -o tsv)

################################################
# Localize ARM template
Expand All @@ -28,7 +28,7 @@ $vCoresLimit = "4"
$memoryLimit = "8Gi"

# Storage
$StorageClassName = "managed-premium"
$StorageClassName = "longhorn"
$dataStorageSize = "5Gi"
$logsStorageSize = "5Gi"
$dataLogsStorageSize = "5Gi"
Expand Down
4 changes: 2 additions & 2 deletions azure_jumpstart_arcbox/artifacts/DeploySQLMIADAuth.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ else {

$sqlInstances = @(

[pscustomobject]@{instanceName = 'capi-sql'; dataController = "$Env:capiArcDataClusterName-dc"; customLocation = "$Env:capiArcDataClusterName-cl" ; storageClassName = 'managed-premium' ; licenseType = 'LicenseIncluded' ; context = 'capi' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-capi" }
[pscustomobject]@{instanceName = 'k3s-sql'; dataController = "$Env:k3sArcDataClusterName-dc"; customLocation = "$Env:k3sArcDataClusterName-cl" ; storageClassName = 'longhorn' ; licenseType = 'LicenseIncluded' ; context = 'k3s' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-datasvc-k3s" }

[pscustomobject]@{instanceName = 'aks-sql'; dataController = "$Env:aksArcClusterName-dc" ; customLocation = "$Env:aksArcClusterName-cl" ; storageClassName = 'managed-premium' ; licenseType = 'LicenseIncluded' ; context = 'aks'; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-aks" }

Expand Down Expand Up @@ -278,7 +278,7 @@ $sqlInstances | Foreach-Object -ThrottleLimit 5 -Parallel {
Write-Host "Granted sysadmin role to user account ${domain_netbios_name}\$env:AZDATA_USERNAME in SQLMI instance."

# Downloading demo database and restoring onto SQL MI
if ($sqlMIName -eq "capi-sql") {
if ($sqlMIName -eq "k3s-sql") {
Write-Host "`n"
Write-Host "Downloading AdventureWorks database for MS SQL... (1/2)"
kubectl exec $podname -n arc --kubeconfig $sqlInstance.kubeConfig -c arc-sqlmi -- wget https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks2019.bak -O /var/opt/mssql/data/AdventureWorks2019.bak 2>&1 | Out-Null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"value": "arc-private-registry"
},
"dataStorageClass": {
"value": "managed-premium"
"value": "storageClass-stage"
},
"dataStorageSize": {
"value": "15Gi"
},
"logsStorageClass": {
"value": "managed-premium"
"value": "storageClass-stage"
},
"logsStorageSize": {
"value": "10Gi"
Expand Down
1 change: 0 additions & 1 deletion azure_jumpstart_arcbox/artifacts/installK3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ if [[ "$k3sControlPlane" == "true" ]]; then
sudo -u $adminUsername az extension add --upgrade -n storage-preview
storageAccountRG=$(sudo -u $adminUsername az storage account show --name $stagingStorageAccountName --query 'resourceGroup' | sed -e 's/^"//' -e 's/"$//')
storageAccountKey=$(sudo -u $adminUsername az storage account keys list --resource-group $storageAccountRG --account-name $stagingStorageAccountName --query [0].value | sed -e 's/^"//' -e 's/"$//')
storageContainerName="staging-k3s"
sudo -u $adminUsername az storage container create -n $storageContainerName --account-name $stagingStorageAccountName --account-key $storageAccountKey
sudo -u $adminUsername az storage azcopy blob upload --container $storageContainerName --account-name $stagingStorageAccountName --account-key $storageAccountKey --source $localPath
sudo -u $adminUsername az storage azcopy blob upload --container $storageContainerName --account-name $stagingStorageAccountName --account-key $storageAccountKey --source $k3sClusterNodeConfig
Expand Down
22 changes: 22 additions & 0 deletions azure_jumpstart_arcbox/bicep/kubernetes/ubuntuRancherNodes.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,25 @@ resource vmRoleAssignment_Owner 'Microsoft.Authorization/roleAssignments@2022-04
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
}
}

resource vmInstallscriptK3s 'Microsoft.Compute/virtualMachines/extensions@2022-03-01' = {
parent: vm
name: 'installscript_k3s'
location: azureLocation
properties: {
publisher: 'Microsoft.Azure.Extensions'
type: 'CustomScript'
typeHandlerVersion: '2.1'
autoUpgradeMinorVersion: true
settings: {}
protectedSettings: {
commandToExecute: 'bash installK3s.sh ${adminUsername} ${subscription().subscriptionId} ${vmName} ${azureLocation} ${stagingStorageAccountName} ${logAnalyticsWorkspace} ${templateBaseUrl} ${storageContainerName}'
fileUris: [
'${templateBaseUrl}artifacts/installK3s.sh'
]
}
}
dependsOn: [
vmRoleAssignment_Owner
]
}