Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat: use aks windows vhds by default (#2048)
Browse files Browse the repository at this point in the history
* Use aks windows vhds by default

* add .txt extension to windows release notes

* fixing file encoding for release noes

* Moving image related defaults to azenvtypes.go to align with linux image defaults

* go fmt files
  • Loading branch information
marosset authored and acs-bot committed Oct 1, 2019
1 parent 53d7498 commit 7a6981d
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 115 deletions.
78 changes: 41 additions & 37 deletions docs/topics/clusterdefinitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ format for `sourceVault.id`, can be obtained in cli, or found in the portal: /su
format for `vaultCertificates.certificateUrl`, can be obtained in cli, or found in the portal:
https://{keyvaultname}.vault.azure.net:443/secrets/{secretName}/{version}


### windowsProfile

`windowsProfile` provides configuration specific to Windows nodes in the cluster
Expand All @@ -649,10 +648,10 @@ https://{keyvaultname}.vault.azure.net:443/secrets/{secretName}/{version}
| -------------------------------- | -------- | ------------------------------------------------------------------------ |
| adminUsername | yes | Username for the Windows adminstrator account created on each Windows node |
| adminPassword | yes | Password for the Windows adminstrator account created on each Windows node |
| windowsPublisher | no | Publisher used to find Windows VM to deploy from marketplace. Default: `MicrosoftWindowsServer` |
| windowsOffer | no | Offer used to find Windows VM to deploy from marketplace. Default: `WindowsServer` |
| windowsSku | no | SKU usedto find Windows VM to deploy from marketplace. Default: `2019-Datacenter-Core-with-Containers-smalldisk` |
| imageVersion | no | Specific image version to deploy from marketplace. Default: `17763.737.1909062324`. This default is incremented as new versions are tested to avoid unexpected breaks. |
| windowsPublisher | no | Publisher used to find Windows VM to deploy from marketplace. Default: `microsoft-aks` |
| windowsOffer | no | Offer used to find Windows VM to deploy from marketplace. Default: `aks-windows` |
| windowsSku | no | SKU usedto find Windows VM to deploy from marketplace. Default: `2019-datacenter-core-smalldisk` |
| imageVersion | no | Specific image version to deploy from marketplace. Default: `17763.737.190923`. This default is incremented to include the latest Windows patches after being validated by the AKS Engine team. |
| windowsImageSourceURL | no | Path to an existing Azure storage blob with a sysprepped VHD. This is used to test pre-release or customized VHD files that you have uploaded to Azure. If provided, the above 4 parameters are ignored. |
| imageReference.name | no | Name of an Image. |
| imageReference.resourceGroup | no | Resource group that contains the Image. |
Expand All @@ -663,10 +662,43 @@ https://{keyvaultname}.vault.azure.net:443/secrets/{secretName}/{version}

#### Windows Images

You can configure the image used for all Windows nodes one of the following ways (listed in order of precedence based on what is specified in the api model):
You can configure the image used for all Windows nodes one of the following ways:

##### Defaults

The AKS Engine team produces images that are optimized for and validated with aks-engine.
The latest latest version of these images are used as the default images for Windows nodes.

These images are published to the Azure Marketplace under the `microsoft-aks` publisher and `aks-windows` offer.
Release notes for these images can be found under [releases/vhd-notes/aks-windows](../../releases/vhd-notes/aks-windows).

##### Marketplace Images

##### Custom VHD
Aks-engine also supports running 'vanilla' Windows Server images published by Microsoft.
These can be used by advanced users if a release other than Winders Server 2019 is needed.

If you want to choose a specific Windows image, but automatically use the latest - set `windowsPublisher`, `windowsOffer`, and `windowsSku`. If you need a specific version, then add `imageVersion` too.

You can find all available images with `az vm image list --all --publisher MicrosoftWindowsServer --offer WindowsServer --output table`, and the contents of these images are described in the knowledge base article [Windows Server release on Azure Marketplace update history](https://support.microsoft.com/en-us/help/4497947).

If you want to use a specific image then `windowsPublisher`, `windowsOffer`, `windowsSku`, and `imageVersion` must all be set:

```json
"windowsProfile": {
"adminUsername": "...",
"adminPassword": "...",
"windowsPublisher": "MicrosoftWindowsServer",
"windowsOffer": "WindowsServer",
"windowsSku": "2019-Datacenter-Core-with-Containers-smalldisk",
"imageVersion": "2019.0.20181107"
},
```

##### Custom Images

Listed in order of precedence based on what is specified in the api model:

###### VHD

To use an image uploaded to an Azure storage account (or any other accessible location) specify `windowsImageSourceURL`.

Expand All @@ -680,7 +712,7 @@ To use an image uploaded to an Azure storage account (or any other accessible lo
},
```

##### Shared Image Gallery
###### Shared Image Gallery

To use an Image from a Shared Image Gallery specify `imageReference.name`, `imageReference.resourceGroup`, `imageReference.subscriptionId`, `imageReference.galllery`, and `imageReference.version`.

Expand All @@ -698,7 +730,7 @@ To use an Image from a Shared Image Gallery specify `imageReference.name`, `imag
},
```

##### Azure Image
###### Azure Image

To use a pre-existing Azure Image specify `imageReference.name` and `imageReference.resourceGroup`.

Expand All @@ -713,34 +745,6 @@ To use a pre-existing Azure Image specify `imageReference.name` and `imageRefere
},
```

##### Marketplace image (Default)

By default AKS engine will use a recently known good Windows image from the Azure marketplace (See [windowsProfile](#windowsProfile) table for specific values).

```json
"windowsProfile": {
"adminUsername": "...",
"adminPassword": "..."
},
```

If you want to choose a specific Windows image, but automatically use the latest - set `windowsPublisher`, `windowsOffer`, and `windowsSku`. If you need a specific version, then add `imageVersion` too.

You can find all available images with `az vm image list --all --publisher MicrosoftWindowsServer --offer WindowsServer --output table`, and the contents of these images are described in the knowledge base article [Windows Server release on Azure Marketplace update history](https://support.microsoft.com/en-us/help/4497947).

If you want to use a specific image then `windowsPublisher`, `windowsOffer`, `windowsSku`, and `imageVersion` must all be set:

```json
"windowsProfile": {
"adminUsername": "...",
"adminPassword": "...",
"windowsPublisher": "MicrosoftWindowsServer",
"windowsOffer": "WindowsServer",
"windowsSku": "2019-Datacenter-Core-with-Containers-smalldisk",
"imageVersion": "2019.0.20181107"
},
```

### servicePrincipalProfile

`servicePrincipalProfile` describes an Azure Service credentials to be used by the cluster for self-configuration. See [service principal](service-principals.md) for more details on creation.
Expand Down
24 changes: 24 additions & 0 deletions pkg/api/azenvtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,30 @@ var (
ImageVersion: "2019.09.24",
}

// AKSWindowsServer2019OSImageConfig is the AKS image based on Windows Server 2019
AKSWindowsServer2019OSImageConfig = AzureOSImageConfig{
ImageOffer: "aks-windows",
ImageSku: "2019-datacenter-core-smalldisk",
ImagePublisher: "microsoft-aks",
ImageVersion: "17763.737.190923",
}

// AzureStackWindowsServer2019OSImageConfig is the 'vanilla' Windows Server 2019 image to be used to with Azure Stack deployments
AzureStackWindowsServer2019OSImageConfig = AzureOSImageConfig{
ImageOffer: "WindowsServer",
ImageSku: "2019-Datacenter-Core-with-Containers",
ImagePublisher: "MicrosoftWindowsServer",
ImageVersion: "latest",
}

// WindowsServer2019OSImageConfig is the 'vanilla' Windows Server 2019 image
WindowsServer2019OSImageConfig = AzureOSImageConfig{
ImageOffer: "WindowsServer",
ImageSku: "2019-Datacenter-Core-with-Containers-smalldisk",
ImagePublisher: "MicrosoftWindowsServer",
ImageVersion: "17763.737.1909062324",
}

// ACC1604OSImageConfig is the ACC image based on Ubuntu 16.04.
ACC1604OSImageConfig = AzureOSImageConfig{
ImageOffer: "confidential-compute-preview",
Expand Down
21 changes: 0 additions & 21 deletions pkg/api/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,27 +265,6 @@ const (

// MaxAzureStackManagedDiskSize = size for Kubernetes master etcd disk volumes in GB if > 10 nodes as this is max what Azure Stack supports today.
MaxAzureStackManagedDiskSize = "1023"

// DefaultAzureStackWindowsOffer sets the default WindowsOffer value in WindowsProfile for Azure Stack
DefaultAzureStackWindowsOffer = "WindowsServer"

// DefaultAzureStackWindowsSku sets the default WindowsSku value in WindowsProfile for Azure Stack
DefaultAzureStackWindowsSku = "2019-Datacenter-Core-with-Containers"

// DefaultAzureStackImageVersion sets the default ImageVersion value in WindowsProfile for Azure Stack
DefaultAzureStackImageVersion = "latest"
)

// WindowsProfile defaults
const (
// DefaultWindowsPublisher sets the default WindowsPublisher value in WindowsProfile
DefaultWindowsPublisher = "MicrosoftWindowsServer"
// DefaultWindowsOffer sets the default WindowsOffer value in WindowsProfile
DefaultWindowsOffer = "WindowsServer"
// DefaultWindowsSku sets the default WindowsSku value in WindowsProfile
DefaultWindowsSku = "2019-Datacenter-Core-with-Containers-smalldisk"
// DefaultImageVersion sets the default ImageVersion value in WindowsProfile
DefaultImageVersion = "17763.737.1909062324"
)

const (
Expand Down
29 changes: 20 additions & 9 deletions pkg/api/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,29 +701,40 @@ func (p *Properties) setAgentProfileDefaults(isUpgrade, isScale bool, cloudName
func (p *Properties) setWindowsProfileDefaults(isUpgrade, isScale bool) {
windowsProfile := p.WindowsProfile
if !isUpgrade && !isScale {
if windowsProfile.WindowsPublisher == "" {
windowsProfile.WindowsPublisher = DefaultWindowsPublisher
}

if p.IsAzureStackCloud() {
if windowsProfile.WindowsPublisher == "" {
windowsProfile.WindowsPublisher = AzureStackWindowsServer2019OSImageConfig.ImagePublisher
}
if windowsProfile.WindowsOffer == "" {
windowsProfile.WindowsOffer = DefaultAzureStackWindowsOffer
windowsProfile.WindowsOffer = AzureStackWindowsServer2019OSImageConfig.ImageOffer
}
if windowsProfile.WindowsSku == "" {
windowsProfile.WindowsSku = DefaultAzureStackWindowsSku
windowsProfile.WindowsSku = AzureStackWindowsServer2019OSImageConfig.ImageSku
}
if windowsProfile.ImageVersion == "" {
windowsProfile.ImageVersion = DefaultAzureStackImageVersion
windowsProfile.ImageVersion = AzureStackWindowsServer2019OSImageConfig.ImageVersion
}
} else {
if windowsProfile.WindowsPublisher == "" {
windowsProfile.WindowsPublisher = AKSWindowsServer2019OSImageConfig.ImagePublisher
}
if windowsProfile.WindowsOffer == "" {
windowsProfile.WindowsOffer = DefaultWindowsOffer
windowsProfile.WindowsOffer = AKSWindowsServer2019OSImageConfig.ImageOffer
}
if windowsProfile.WindowsSku == "" {
windowsProfile.WindowsSku = DefaultWindowsSku
windowsProfile.WindowsSku = AKSWindowsServer2019OSImageConfig.ImageSku
}

if windowsProfile.ImageVersion == "" {
windowsProfile.ImageVersion = DefaultImageVersion
// default versions are specific to a publisher/offer/sku
if windowsProfile.WindowsPublisher == AKSWindowsServer2019OSImageConfig.ImagePublisher && windowsProfile.WindowsOffer == AKSWindowsServer2019OSImageConfig.ImageOffer && windowsProfile.WindowsSku == AKSWindowsServer2019OSImageConfig.ImageSku {
windowsProfile.ImageVersion = AKSWindowsServer2019OSImageConfig.ImageVersion
} else if windowsProfile.WindowsPublisher == WindowsServer2019OSImageConfig.ImagePublisher && windowsProfile.WindowsOffer == WindowsServer2019OSImageConfig.ImageOffer && windowsProfile.WindowsSku == WindowsServer2019OSImageConfig.ImageSku {
windowsProfile.ImageVersion = WindowsServer2019OSImageConfig.ImageVersion
} else {
windowsProfile.ImageVersion = "latest"
}
}
}
}
Expand Down
Loading

0 comments on commit 7a6981d

Please sign in to comment.