Skip to content

Commit

Permalink
schema 1.6 changes (#96)
Browse files Browse the repository at this point in the history
* remove helm install
* increase depth
* schema 1.6 update
* readme update to 1.1.80.0 version
* fix return of Invoke-AideDeployment
  • Loading branch information
parameshbabu authored Mar 23, 2023
1 parent 2d21bff commit bb82536
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 66 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository is offered for tracking features and issues with the Azure Kuber

Support through issues on this repository is provided on a **best-effort basis** for issues that are reproducible following our **Bug Guidance** below. To receive urgent support, you must file a support request through official Azure support channels, as urgent support is explicitly out of the scope of this repository's objectives.

:warning: **IMPORTANT**: 02/21/2023 -  AKS Edge Essentials is now [Generally Available (GA)](https://aka.ms/aks-edge/ga-blog) - [Version 1.0.406.0](https://github.com/Azure/AKS-Edge/releases/tag/1.0.406.0).
:warning: **IMPORTANT**: 02/21/2023 -  AKS Edge Essentials is now [Generally Available (GA)](https://aka.ms/aks-edge/ga-blog) - [Latest Version 1.1.80.0](https://github.com/Azure/AKS-Edge/releases/tag/1.1.80.0).

## Important Links

Expand Down
2 changes: 1 addition & 1 deletion tools/aksedge-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"SchemaVersion": "1.5",
"SchemaVersion": "1.6",
"Version": "1.0",
"DeploymentType": "SingleMachineCluster",
"Init": {
Expand Down
45 changes: 0 additions & 45 deletions tools/modules/AksEdgeDeploy/AksEdgeDeploy-AEC.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,6 @@ New-Variable -Option Constant -ErrorAction SilentlyContinue -Name arcEdgeInstall
@{Name="Az.Accounts"; Version="2.11.2"; Flags="-AllowClobber"},
@{Name="Az.ConnectedKubernetes"; Version="0.9.0"; Flags="-AllowClobber"}
)
"Urls" = @{
helm = "https://k8connecthelm.azureedge.net/helm/helm-v3.6.3-windows-amd64.zip"
}
}
function Test-ArcEdgeAzModules {
Param
Expand All @@ -290,48 +287,6 @@ function Test-ArcEdgeAzModules {
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Confirm:$false
} else { Write-Host "NuGet found" -ForegroundColor Green }

Write-Host "Checking Helm"
$helmRoot = "$env:USERPROFILE\.Azure\helm"
$helmDir = "$helmRoot\windows-amd64"
if (!(($env:Path).Contains($helmDir))) {
$env:Path = "$helmDir;$env:Path"
[Environment]::SetEnvironmentVariable('Path', $env:Path,"Machine")
}
$cmd = Get-Command helm -ErrorAction SilentlyContinue
if ($null -eq $cmd)
{
Write-Host "- Helm not found. A helm version of at least 3.0 but less than 3.7 is required."
$installHelm = $true
$errCnt += 1
} else {
$version = helm version --template='{{.Version}}'
$version = ($version -split 'v')[1]
if (([version]$version -lt [version]"3.0.0") -Or ([version]$version -ge [version]"3.7.0"))
{
Write-Host "- Found $version. A helm version of at least 3.0 but less than 3.7 is required."
$installHelm = $true
$errCnt += 1
} else {
Write-Host "* Found helm version $version" -ForegroundColor Green
}
}
if ($installHelm -and $Install) {
$url = $arcEdgeInstallConfig.Urls.helm
$outFile = "$env:TEMP\helm.zip"
Write-Host "Installing helm from $url"
try {
Invoke-WebRequest -Uri $url -TimeoutSec 30 -OutFile $outFile
if (Test-Path $outFile) {
Expand-Archive -Path $outFile -DestinationPath $helmRoot -Force
$errCnt -=1
} else {
Write-Host "Download failed. Try again or install helm manually from $url"
}
} catch {
Write-Host "Error : Failed to install helm. try again or install helm manually from $url"
}
}

Write-Host "Checking Az Powershell modules....."
$reqmods = $arcEdgeInstallConfig.PSModules
foreach ($mod in $reqmods) {
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.230313.1200'
ModuleVersion = '1.0.230321.1200'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
13 changes: 7 additions & 6 deletions tools/modules/AksEdgeDeploy/AksEdgeDeploy.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ function UpgradeJsonFormat {
}
#upgrade from public preview format to GA format
$edgeCfg = $jsonObj.AksEdgeConfig
if ($edgeCfg.SchemaVersion -eq '1.5') {
$newVersions = @("1.5","1.6")
if ($newVersions -contains $edgeCfg.SchemaVersion) {
if (($azCfg.Auth.Password) -and ([string]::IsNullOrEmpty($($edgeCfg.Arc.ClientSecret)))) {
#Copy over the Azure parameters to Arc section
$edgeCfg | Add-Member -MemberType NoteProperty -Name 'Arc' -Value $arcdata -Force
Expand Down Expand Up @@ -355,9 +356,9 @@ function Save-AideUserConfig {
$ObjToSave = $aideSession.UserConfig
if ($aideSession.ReadFromFile) {
#we dont expect programatic changes to the aide-userconfig. Only in AksEdgeConfig
$ObjToSave.AksEdgeConfig | ConvertTo-Json -Depth 4 | Format-AideJson | Set-Content -Path "$($ObjToSave.AksEdgeConfigFile)" -Force
$ObjToSave.AksEdgeConfig | ConvertTo-Json -Depth 6 | Format-AideJson | Set-Content -Path "$($ObjToSave.AksEdgeConfigFile)" -Force
} else {
$ObjToSave | ConvertTo-Json -Depth 4 | Format-AideJson | Set-Content -Path "$($aideSession.UserConfigFile)" -Force
$ObjToSave | ConvertTo-Json -Depth 6 | Format-AideJson | Set-Content -Path "$($aideSession.UserConfigFile)" -Force
}
} else {
Write-Verbose "Error: Aide UserConfigFile not configured"
Expand Down Expand Up @@ -431,7 +432,7 @@ function Test-AideUserConfigNetwork {
}
}
}
$retval = Test-AksEdgeNetworkParameters -JsonConfigString ($akseeCfg | ConvertTo-Json -Depth 4)
$retval = Test-AksEdgeNetworkParameters -JsonConfigString ($akseeCfg | ConvertTo-Json -Depth 6)
return ($retval -and ($errCnt -eq 0))
}

Expand Down Expand Up @@ -890,7 +891,7 @@ function Invoke-AideDeployment {
}
if (-not (Test-AideUserConfigDeploy)) { return $false }
$akseeCfg = Get-AideAksEdgeConfig
$aksedgeDeployParams = $akseeCfg | ConvertTo-Json -Depth 4
$aksedgeDeployParams = $akseeCfg | ConvertTo-Json -Depth 6
Write-Verbose "AksEdge VM deployment parameters for New-AksEdgeDeployment..."
Write-Verbose "$aksedgeDeployParams"
Write-Host "Starting AksEdge VM deployment..."
Expand Down Expand Up @@ -1123,7 +1124,7 @@ function Start-AideWorkflow {
} else {
if (!(Test-AideVmSwitch -Create)) { return $false } #create switch if specified
# We are here.. all is good so far. Validate and deploy aksedge
if (!(Invoke-AideDeployment)) { return $false }
return Invoke-AideDeployment
}
return $true
}
Expand Down
Binary file modified tools/modules/AksEdgeDeploy/AksEdgeSchema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tools/modules/AksEdgeDeploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ The `Start-AideWorkflow` function in the modole does the following:
"Version": "1.0",
"AksEdgeProduct" : "AKS Edge Essentials - K3s",
"AksEdgeConfig": {
"SchemaVersion": "1.5",
"SchemaVersion": "1.6",
"Version": "1.0",
"DeploymentType": "SingleMachineCluster",
"Init": {
"ServiceIPRangeSize": 0
"ServiceIPRangeSize": 10
},
"Network": {
"NetworkPlugin": "flannel",
Expand Down
11 changes: 10 additions & 1 deletion tools/modules/AksEdgeDeploy/aksedge-dc.puml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jsonDiagram {
</style>
#highlight "SchemaVersion"
{
"SchemaVersion": "1.5",
"SchemaVersion": "1.6",
"Version": "1.0",
"DeploymentType": [
"SingleMachineCluster",
Expand Down Expand Up @@ -98,6 +98,15 @@ jsonDiagram {
"type": "int",
"default": 300
},
"TpmPassthrough": false,
"SecondaryNetworks": [
{
"VMSwitchName" : "string",
"Ip4Address": "ipv4",
"Ip4GatewayAddress": "ipv4",
"Ip4PrefixLength": "integer"
}
],
"Ip4Address": "ipv4",
"MacAddress": "string",
"Mtu": "integer",
Expand Down
6 changes: 3 additions & 3 deletions tools/scripts/AksEdgeAzureSetup/AksEdgeAzureSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Param(
)

#Requires -RunAsAdministrator
New-Variable -Name gAksEdgeAzureSetup -Value "1.0.230217.1200" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Name gAksEdgeAzureSetup -Value "1.0.230321.1200" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Option Constant -ErrorAction SilentlyContinue -Name cliMinVersions -Value @{
"azure-cli" = "2.41.0"
"azure-cli-core" = "2.41.0"
Expand Down Expand Up @@ -361,12 +361,12 @@ if ($ecFile) {
if (Test-Path -Path $ecFile) {
$edgeCfg = Get-Content $ecFile | ConvertFrom-Json
$edgeCfg | Add-Member -MemberType NoteProperty -Name 'Arc' -Value $arcdata -Force
$edgeCfg | ConvertTo-Json -Depth 5 | Format-Json | Set-Content -Path "$ecFile" -Force
$edgeCfg | ConvertTo-Json -Depth 6 | Format-Json | Set-Content -Path "$ecFile" -Force
}
} else {
$jsonContent | Add-Member -MemberType NoteProperty -Name 'Arc' -Value $arcdata -Force
}

$jsonContent | ConvertTo-Json -Depth 5 | Format-Json | Set-Content -Path "$jsonFile" -Force
$jsonContent | ConvertTo-Json -Depth 6 | Format-Json | Set-Content -Path "$jsonFile" -Force
az logout
exit 0
4 changes: 2 additions & 2 deletions tools/scripts/AksEdgeQuickStart/AksEdgeQuickStart.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param(
[string] $Tag
)
#Requires -RunAsAdministrator
New-Variable -Name gAksEdgeQuickStartVersion -Value "1.0.230224.1500" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Name gAksEdgeQuickStartVersion -Value "1.0.230321.1500" -Option Constant -ErrorAction SilentlyContinue

New-Variable -Option Constant -ErrorAction SilentlyContinue -Name arcLocations -Value @(
"westeurope", "eastus", "westcentralus", "southcentralus", "southeastasia", "uksouth",
Expand Down Expand Up @@ -78,7 +78,7 @@ $aideuserConfig = @"
"@
$aksedgeConfig = @"
{
"SchemaVersion": "1.5",
"SchemaVersion": "1.6",
"Version": "1.0",
"DeploymentType": "SingleMachineCluster",
"Init": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ param(
[string] $Tag
)
#Requires -RunAsAdministrator
New-Variable -Name gAksEdgeRemoteDeployVersion -Value "1.0.230221.1000" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Name gAksEdgeRemoteDeployVersion -Value "1.0.230321.1000" -Option Constant -ErrorAction SilentlyContinue
if (! [Environment]::Is64BitProcess) {
Write-Host "Error: Run this in 64bit Powershell session" -ForegroundColor Red
exit -1
Expand Down Expand Up @@ -50,7 +50,7 @@ $aideuserConfig = @"
"@
$aksedgeConfig = @"
{
"SchemaVersion": "1.5",
"SchemaVersion": "1.6",
"Version": "1.0",
"DeploymentType": "SingleMachineCluster",
"Init": {
Expand Down
4 changes: 2 additions & 2 deletions tools/scripts/AksEdgeRemoteDeploy/AksEdgeRemoteDeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param(
[string] $Tag
)
#Requires -RunAsAdministrator
New-Variable -Name gAksEdgeRemoteDeployVersion -Value "1.0.230221.1000" -Option Constant -ErrorAction SilentlyContinue
New-Variable -Name gAksEdgeRemoteDeployVersion -Value "1.0.230321.1000" -Option Constant -ErrorAction SilentlyContinue
if (! [Environment]::Is64BitProcess) {
Write-Host "Error: Run this in 64bit Powershell session" -ForegroundColor Red
exit -1
Expand Down Expand Up @@ -45,7 +45,7 @@ $aideuserConfig = @"
"@
$aksedgeConfig = @"
{
"SchemaVersion": "1.5",
"SchemaVersion": "1.6",
"Version": "1.0",
"DeploymentType": "SingleMachineCluster",
"Init": {
Expand Down

0 comments on commit bb82536

Please sign in to comment.