Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 12 additions & 4 deletions tools/modules/AksEdgeDeploy/AksEdgeDeploy-AES.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ New-Variable -Option Constant -ErrorAction SilentlyContinue -Name azcmagentexe -
New-Variable -Option Constant -ErrorAction SilentlyContinue -Name arciotEnvConfig -Value @{
"ArcIotSchema" = @("SubscriptionName", "SubscriptionId", "TenantId", "ResourceGroupName", "Location", "Auth")
}
<# Azure Regions where Arc enabled Kubernetes is supported.
$data = (az provider show --namespace "Microsoft.Kubernetes" --output json) | ConvertFrom-Json
$resourceInfo = $data.resourceTypes | Where-Object { $_.resourceType -eq "connectedclusters" } # lists the displaynames
$arcLocations = $resourceInfo.locations.toLower().replace(" ","") # gives the locations unsorted.
$arcLocations = $arcLocations | Sort-Object # Sort the list.
#Mapping of names to displaynames : az account list-locations -o table
#>
New-Variable -option Constant -ErrorAction SilentlyContinue -Name arcLocations -Value @(
"westeurope", "eastus", "westcentralus", "southcentralus", "southeastasia", "uksouth",
"eastus2", "westus2", "australiaeast", "northeurope", "francecentral", "centralus",
"westus", "northcentralus", "koreacentral", "japaneast", "eastasia", "westus3",
"canadacentral", "eastus2euap"
"australiaeast","brazilsouth","canadacentral","canadaeast","centralindia","centralus","centraluseuap",
"eastasia","eastus","eastus2","eastus2euap","francecentral","germanywestcentral","israelcentral",
"italynorth","japaneast","koreacentral","northcentralus","northeurope","norwayeast","southafricanorth",
"southcentralus","southeastasia","southindia","swedencentral","switzerlandnorth","uaenorth","uksouth",
"ukwest","westcentralus","westeurope","westus","westus2","westus3"
)
function Get-AideArcUserConfig {
return (Get-AideUserConfig).Azure
Expand Down
2 changes: 1 addition & 1 deletion tools/modules/AksEdgeDeploy/AksEdgeDeploy.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AksEdgeDeploy.psm1'

# Version number of this module.
ModuleVersion = '1.0.241002.1000'
ModuleVersion = '1.0.250225.1400'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
11 changes: 6 additions & 5 deletions tools/scripts/AksEdgeAzureSetup/AksEdgeAzureSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ Param(
)

#Requires -RunAsAdministrator
New-Variable -Name gAksEdgeAzureSetup -Value "1.0.230829.1100" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Name gAksEdgeAzureSetup -Value "1.0.250225.1400" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Option Constant -ErrorAction SilentlyContinue -Name cliMinVersions -Value @{
"azure-cli" = "2.41.0"
"azure-cli-core" = "2.41.0"
}
New-Variable -Option Constant -ErrorAction SilentlyContinue -Name arcLocations -Value @(
"westeurope", "eastus", "westcentralus", "southcentralus", "southeastasia", "uksouth",
"eastus2", "westus2", "australiaeast", "northeurope", "francecentral", "centralus",
"westus", "northcentralus", "koreacentral", "japaneast", "eastasia", "westus3",
"canadacentral", "eastus2euap"
"australiaeast","brazilsouth","canadacentral","canadaeast","centralindia","centralus","centraluseuap",
"eastasia","eastus","eastus2","eastus2euap","francecentral","germanywestcentral","israelcentral",
"italynorth","japaneast","koreacentral","northcentralus","northeurope","norwayeast","southafricanorth",
"southcentralus","southeastasia","southindia","swedencentral","switzerlandnorth","uaenorth","uksouth",
"ukwest","westcentralus","westeurope","westus","westus2","westus3"
)
function Test-AzVersions {
#Function to check if the installed az versions are greater or equal to minVersions
Expand Down
15 changes: 6 additions & 9 deletions tools/scripts/AksEdgeQuickStart/AksEdgeQuickStart-v2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ param(
[string] $Tag
)
#Requires -RunAsAdministrator
New-Variable -Name gAksEdgeQuickStartVersion-v2 -Value "1.0.240904.1500" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Name gAksEdgeQuickStartVersion-v2 -Value "1.0.250225.1400" -Option Constant -ErrorAction SilentlyContinue

New-Variable -Option Constant -ErrorAction SilentlyContinue -Name arcLocations -Value @(
"southcentralus", "westus", "westus2", "westus3", "centralus", "eastus", "eastus2", "eastus3", "westcentralus", "northcentralus", "brazilsouth",
"brazilsoutheast", "canadacentral", "canadaeast", "chilenorthcentral", "mexicocentral", "usgovvirginia", "usdodcentral", "usdodeast", "usgovarizona",
"usgovtexas", "usseceast", "ussecwest", "ussecwestcentral", "eastasia", "southeastasia", "australiaeast", "australiasoutheast", "australiacentral",
"australiacentral2", "chinaeast", "chinaeast2", "chinanorth", "chinanorth2", "chinanorth3", "centralindia", "southindia", "westindia", "indonesiacentral",
"japaneast", "japanwest", "koreacentral", "koreasouth", "malaysiawest", "newzealandnorth", "taiwan", "austriaeast", "belgiumcentral", "denmarkeast",
"northeurope", "westeurope", "finlandcentral", "francecentral", "francesouth", "germanywestcentral", "germanynortheast", "germanycentral", "germanynorth",
"greece", "italynorth", "norwayeast", "norwaywest", "polandcentral", "spaincentral", "swedencentral", "swedensouth", "switzerlandnorth",
"switzerlandwest", "uksouth", "ukwest", "southafricanorth", "southafricawest", "israelcentral", "qatarcentral", "uaenorth", "uaecentral"
"australiaeast","brazilsouth","canadacentral","canadaeast","centralindia","centralus","centraluseuap",
"eastasia","eastus","eastus2","eastus2euap","francecentral","germanywestcentral","israelcentral",
"italynorth","japaneast","koreacentral","northcentralus","northeurope","norwayeast","southafricanorth",
"southcentralus","southeastasia","southindia","swedencentral","switzerlandnorth","uaenorth","uksouth",
"ukwest","westcentralus","westeurope","westus","westus2","westus3"
)

New-Variable -Option Constant -ErrorAction SilentlyContinue -Name AksEdgeProductType -Value @(
Expand Down
15 changes: 6 additions & 9 deletions tools/scripts/AksEdgeQuickStart/AksEdgeQuickStart.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ param(
[string] $Tag
)
#Requires -RunAsAdministrator
New-Variable -Name gAksEdgeQuickStartVersion -Value "1.0.241002.1000" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Name gAksEdgeQuickStartVersion -Value "1.0.250225.1400" -Option Constant -ErrorAction SilentlyContinue

New-Variable -Option Constant -ErrorAction SilentlyContinue -Name arcLocations -Value @(
"southcentralus", "westus", "westus2", "westus3", "centralus", "eastus", "eastus2", "eastus3", "westcentralus", "northcentralus", "brazilsouth",
"brazilsoutheast", "canadacentral", "canadaeast", "chilenorthcentral", "mexicocentral", "usgovvirginia", "usdodcentral", "usdodeast", "usgovarizona",
"usgovtexas", "usseceast", "ussecwest", "ussecwestcentral", "eastasia", "southeastasia", "australiaeast", "australiasoutheast", "australiacentral",
"australiacentral2", "chinaeast", "chinaeast2", "chinanorth", "chinanorth2", "chinanorth3", "centralindia", "southindia", "westindia", "indonesiacentral",
"japaneast", "japanwest", "koreacentral", "koreasouth", "malaysiawest", "newzealandnorth", "taiwan", "austriaeast", "belgiumcentral", "denmarkeast",
"northeurope", "westeurope", "finlandcentral", "francecentral", "francesouth", "germanywestcentral", "germanynortheast", "germanycentral", "germanynorth",
"greece", "italynorth", "norwayeast", "norwaywest", "polandcentral", "spaincentral", "swedencentral", "swedensouth", "switzerlandnorth",
"switzerlandwest", "uksouth", "ukwest", "southafricanorth", "southafricawest", "israelcentral", "qatarcentral", "uaenorth", "uaecentral"
"australiaeast","brazilsouth","canadacentral","canadaeast","centralindia","centralus","centraluseuap",
"eastasia","eastus","eastus2","eastus2euap","francecentral","germanywestcentral","israelcentral",
"italynorth","japaneast","koreacentral","northcentralus","northeurope","norwayeast","southafricanorth",
"southcentralus","southeastasia","southindia","swedencentral","switzerlandnorth","uaenorth","uksouth",
"ukwest","westcentralus","westeurope","westus","westus2","westus3"
)

if (! [Environment]::Is64BitProcess) {
Expand Down
78 changes: 39 additions & 39 deletions tools/scripts/AksEdgeQuickStart/AksEdgeQuickStartForAio.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ param(
[string] $Tag
)
#Requires -RunAsAdministrator
New-Variable -Name gAksEdgeQuickStartForAioVersion -Value "1.0.240904.1500" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Name gAksEdgeQuickStartForAioVersion -Value "1.0.250225.1400" -Option Constant -ErrorAction SilentlyContinue

# Specify only AIO supported regions
New-Variable -Option Constant -ErrorAction SilentlyContinue -Name arcLocations -Value @(
Expand All @@ -41,7 +41,7 @@ function Wait-ApiServerReady

if ($retries -eq 0)
{
exit -1
exit -1
}
}

Expand All @@ -60,7 +60,7 @@ param(
Invoke-AksEdgeNodeCommand -command "sudo cat /etc/kubernetes/manifests/kube-apiserver.yaml | tee /home/aksedge-user/kube-apiserver.yaml | tee /home/aksedge-user/kube-apiserver.yaml.working > /dev/null"
Invoke-AksEdgeNodeCommand -command "sudo sed -i 's|service-account-issuer.*|service-account-issuer=$serviceAccountIssuer|' /home/aksedge-user/kube-apiserver.yaml"
Invoke-AksEdgeNodeCommand -command "sudo cp /home/aksedge-user/kube-apiserver.yaml /etc/kubernetes/manifests/kube-apiserver.yaml"
& kubectl delete pod -n kube-system -l component=kube-apiserver
& kubectl delete pod -n kube-system -l component=kube-apiserver
}
else
{
Expand Down Expand Up @@ -104,18 +104,18 @@ param(
if ((-Not $enableWorkloadIdentity) -Or ($connectedCluster.arcAgentProfile.agentState -eq "Succeeded"))
{
Write-Host "Cluster reached connected status"
break
break
}
}

Write-Host "Arc connection status is $($connectedCluster.ConnectivityStatus). Waiting for status to be connected..."
Start-Sleep -Seconds 10
}
}

if ($retries -eq 0)
{
exit -1
}
exit -1
}
}

function New-ConnectedCluster
Expand Down Expand Up @@ -154,15 +154,15 @@ param(
{
if (-Not [string]::IsNullOrEmpty($proxyArgs.Http))
{
$k8sConnectArgs += @("--proxy-http", $proxyArgs.Http)
$k8sConnectArgs += @("--proxy-http", $proxyArgs.Http)
}
if (-Not [string]::IsNullOrEmpty($proxyArgs.Https))
{
$k8sConnectArgs += @("--proxy-https", $proxyArgs.Https)
$k8sConnectArgs += @("--proxy-https", $proxyArgs.Https)
}
if (-Not [string]::IsNullOrEmpty($proxyArgs.No))
{
$k8sConnectArgs += @("--proxy-skip-range", $proxyArgs.No)
$k8sConnectArgs += @("--proxy-skip-range", $proxyArgs.No)
}
}

Expand All @@ -173,13 +173,13 @@ param(

if (-Not [string]::IsNullOrEmpty($arcArgs.GatewayResourceId))
{
$k8sConnectArgs += @("--gateway-resource-id", $arcArgs.GatewayResourceId)
$k8sConnectArgs += @("--gateway-resource-id", $arcArgs.GatewayResourceId)
}

Write-Host "Connect cmd args - $k8sConnectArgs"
$errOut = $($retVal = & {az connectedk8s connect $k8sConnectArgs}) 2>&1
if ($LASTEXITCODE -ne 0)
{
if ($LASTEXITCODE -ne 0)
{
throw "Arc Connection failed with error : $errOut"
}

Expand Down Expand Up @@ -220,11 +220,11 @@ if ($arcLocations -inotcontains $Location) {
}

# Validate az cli version.
$azVersion = (az version)[1].Split(":")[1].Split('"')[1]
$azMinRequiredVersion = "2.64.0"
if ($azVersion -lt $azMinRequiredVersion){
Write-Host "Installed Azure CLI version $azVersion is older than $azMinRequiredVersion. Please upgrade Azure CLI and retry." -ForegroundColor Red
exit -1
$azVersion = (az version)[1].Split(":")[1].Split('"')[1]
$azMinRequiredVersion = "2.64.0"
if ($azVersion -lt $azMinRequiredVersion){
Write-Host "Installed Azure CLI version $azVersion is older than $azMinRequiredVersion. Please upgrade Azure CLI and retry." -ForegroundColor Red
exit -1
}

# Ensure logged into Azure
Expand All @@ -236,8 +236,8 @@ if ( $null -eq $azureLogin){

# Ensure `connectedk8s` az cli extension is installed and up to date.
$errOut = $($retVal = & {az extension add --upgrade --name connectedk8s -y}) 2>&1
if ($LASTEXITCODE -ne 0)
{
if ($LASTEXITCODE -ne 0)
{
throw "Error upgrading extension connecktedk8s : $errOut"
}

Expand Down Expand Up @@ -289,10 +289,10 @@ $aksedgeConfig = @"
"Network": {
"NetworkPlugin": "$networkplugin",
"InternetDisabled": false,
"Proxy": {
"Http": null,
"Https": null,
"No": null
"Proxy": {
"Http": null,
"Https": null,
"No": null
}
},
"User": {
Expand Down Expand Up @@ -380,8 +380,8 @@ if ($retval) {
Write-Host "Step 3: Connect the cluster to Azure" -ForegroundColor Cyan
# Set the azure subscription
$errOut = $($retVal = & {az account set -s $SubscriptionId}) 2>&1
if ($LASTEXITCODE -ne 0)
{
if ($LASTEXITCODE -ne 0)
{
throw "Error setting Subscription ($SubscriptionId): $errOut"
}

Expand All @@ -390,8 +390,8 @@ $errOut = $($rgExists = & {az group show --resource-group $ResourceGroupName}) 2
if ($null -eq $rgExists) {
Write-Host "Creating resource group: $ResourceGroupName" -ForegroundColor Cyan
$errOut = $($retVal = & {az group create --location $Location --resource-group $ResourceGroupName --subscription $SubscriptionId}) 2>&1
if ($LASTEXITCODE -ne 0)
{
if ($LASTEXITCODE -ne 0)
{
throw "Error creating ResourceGroup ($ResourceGroupName): $errOut"
}
}
Expand All @@ -407,21 +407,21 @@ $resourceProviders =
foreach($rp in $resourceProviders)
{
$errOut = $($obj = & {az provider show -n $rp | ConvertFrom-Json}) 2>&1
if ($LASTEXITCODE -ne 0)
{
if ($LASTEXITCODE -ne 0)
{
throw "Error querying provider $rp : $errOut"
}

if ($obj.registrationState -eq "Registered")
{
continue
continue
}
$errOut = $($retVal = & {az provider register -n $rp}) 2>&1
if ($LASTEXITCODE -ne 0)
{

$errOut = $($retVal = & {az provider register -n $rp}) 2>&1
if ($LASTEXITCODE -ne 0)
{
throw "Error registering provider $rp : $errOut"
}
}
}

# Arc-enable the Kubernetes cluster
Expand All @@ -438,12 +438,12 @@ if ([string]::IsNullOrEmpty($objectId))
$errOut = $($objectId = & {az ad sp show --id $customLocationsAppId --query id -o tsv}) 2>&1
if ($null -eq $objectId)
{
throw "Error querying ObjectId for CustomLocationsAppId : $errOut"
throw "Error querying ObjectId for CustomLocationsAppId : $errOut"
}
}
$errOut = $($retVal = & {az connectedk8s enable-features -n $ClusterName -g $ResourceGroupName --custom-locations-oid $objectId --features cluster-connect custom-locations}) 2>&1
if ($LASTEXITCODE -ne 0)
{
if ($LASTEXITCODE -ne 0)
{
throw "Error enabling feature CustomLocations : $errOut"
}

Expand Down