Skip to content

Commit

Permalink
feat: Update avm/res/container-service/managed-cluster - Added supp…
Browse files Browse the repository at this point in the history
…ort for secureboot and vptm (#4263)

Signed-off-by: PixelRobots
<[email protected]>

## Description

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes #123
Fixes #456
Closes #123
Closes #456
-->

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.container-service.managed-cluster](https://github.com/PixelRobots/bicep-registry-modules/actions/workflows/avm.res.container-service.managed-cluster.yml/badge.svg?branch=rh-aks-vptm)](https://github.com/PixelRobots/bicep-registry-modules/actions/workflows/avm.res.container-service.managed-cluster.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [ ] I'm sure there are no other open Pull Requests for the same
update/change
- [ ] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [ ] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->

---------

Signed-off-by: PixelRobots <[email protected]>
  • Loading branch information
PixelRobots authored Feb 25, 2025
1 parent 749ec54 commit 7d91a88
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 12 deletions.
34 changes: 33 additions & 1 deletion avm/res/container-service/managed-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.ContainerService/managedClusters` | [2024-09-02-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2024-09-02-preview/managedClusters) |
| `Microsoft.ContainerService/managedClusters/agentPools` | [2024-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2024-08-01/managedClusters/agentPools) |
| `Microsoft.ContainerService/managedClusters/agentPools` | [2024-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2024-09-01/managedClusters/agentPools) |
| `Microsoft.ContainerService/managedClusters/maintenanceConfigurations` | [2023-10-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2023-10-01/managedClusters/maintenanceConfigurations) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.KubernetesConfiguration/extensions` | [2022-03-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KubernetesConfiguration/2022-03-01/extensions) |
Expand Down Expand Up @@ -2837,7 +2837,9 @@ Properties of the primary agent pool.
| [`enableEncryptionAtHost`](#parameter-primaryagentpoolprofilesenableencryptionathost) | bool | Whether to enable encryption at host for the agent pool. |
| [`enableFIPS`](#parameter-primaryagentpoolprofilesenablefips) | bool | Whether to enable FIPS for the agent pool. |
| [`enableNodePublicIP`](#parameter-primaryagentpoolprofilesenablenodepublicip) | bool | Whether to enable node public IP for the agent pool. |
| [`enableSecureBoot`](#parameter-primaryagentpoolprofilesenablesecureboot) | bool | Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. |
| [`enableUltraSSD`](#parameter-primaryagentpoolprofilesenableultrassd) | bool | Whether to enable Ultra SSD for the agent pool. |
| [`enableVTPM`](#parameter-primaryagentpoolprofilesenablevtpm) | bool | vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. |
| [`gpuInstanceProfile`](#parameter-primaryagentpoolprofilesgpuinstanceprofile) | string | The GPU instance profile of the agent pool. |
| [`kubeletDiskType`](#parameter-primaryagentpoolprofileskubeletdisktype) | string | The kubelet disk type of the agent pool. |
| [`maxCount`](#parameter-primaryagentpoolprofilesmaxcount) | int | The maximum number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). |
Expand Down Expand Up @@ -2923,13 +2925,27 @@ Whether to enable node public IP for the agent pool.
- Required: No
- Type: bool

### Parameter: `primaryAgentPoolProfiles.enableSecureBoot`

Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch.

- Required: No
- Type: bool

### Parameter: `primaryAgentPoolProfiles.enableUltraSSD`

Whether to enable Ultra SSD for the agent pool.

- Required: No
- Type: bool

### Parameter: `primaryAgentPoolProfiles.enableVTPM`

vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch.

- Required: No
- Type: bool

### Parameter: `primaryAgentPoolProfiles.gpuInstanceProfile`

The GPU instance profile of the agent pool.
Expand Down Expand Up @@ -3306,7 +3322,9 @@ Define one or more secondary/additional agent pools.
| [`enableEncryptionAtHost`](#parameter-agentpoolsenableencryptionathost) | bool | Whether to enable encryption at host for the agent pool. |
| [`enableFIPS`](#parameter-agentpoolsenablefips) | bool | Whether to enable FIPS for the agent pool. |
| [`enableNodePublicIP`](#parameter-agentpoolsenablenodepublicip) | bool | Whether to enable node public IP for the agent pool. |
| [`enableSecureBoot`](#parameter-agentpoolsenablesecureboot) | bool | Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. |
| [`enableUltraSSD`](#parameter-agentpoolsenableultrassd) | bool | Whether to enable Ultra SSD for the agent pool. |
| [`enableVTPM`](#parameter-agentpoolsenablevtpm) | bool | vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. |
| [`gpuInstanceProfile`](#parameter-agentpoolsgpuinstanceprofile) | string | The GPU instance profile of the agent pool. |
| [`kubeletDiskType`](#parameter-agentpoolskubeletdisktype) | string | The kubelet disk type of the agent pool. |
| [`maxCount`](#parameter-agentpoolsmaxcount) | int | The maximum number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). |
Expand Down Expand Up @@ -3392,13 +3410,27 @@ Whether to enable node public IP for the agent pool.
- Required: No
- Type: bool

### Parameter: `agentPools.enableSecureBoot`

Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch.

- Required: No
- Type: bool

### Parameter: `agentPools.enableUltraSSD`

Whether to enable Ultra SSD for the agent pool.

- Required: No
- Type: bool

### Parameter: `agentPools.enableVTPM`

vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch.

- Required: No
- Type: bool

### Parameter: `agentPools.gpuInstanceProfile`

The GPU instance profile of the agent pool.
Expand Down
24 changes: 23 additions & 1 deletion avm/res/container-service/managed-cluster/agent-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module deploys an Azure Kubernetes Service (AKS) Managed Cluster Agent Pool

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.ContainerService/managedClusters/agentPools` | [2024-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2024-08-01/managedClusters/agentPools) |
| `Microsoft.ContainerService/managedClusters/agentPools` | [2024-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2024-09-01/managedClusters/agentPools) |

## Parameters

Expand All @@ -38,7 +38,9 @@ This module deploys an Azure Kubernetes Service (AKS) Managed Cluster Agent Pool
| [`enableEncryptionAtHost`](#parameter-enableencryptionathost) | bool | This is only supported on certain VM sizes and in certain Azure regions. For more information, see: /azure/aks/enable-host-encryption. For security reasons, this setting should be enabled. |
| [`enableFIPS`](#parameter-enablefips) | bool | See Add a FIPS-enabled node pool (https://learn.microsoft.com/en-us/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. |
| [`enableNodePublicIP`](#parameter-enablenodepublicip) | bool | Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see assigning a public IP per node (https://learn.microsoft.com/en-us/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). |
| [`enableSecureBoot`](#parameter-enablesecureboot) | bool | Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. |
| [`enableUltraSSD`](#parameter-enableultrassd) | bool | Whether to enable UltraSSD. |
| [`enableVTPM`](#parameter-enablevtpm) | bool | vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. |
| [`gpuInstanceProfile`](#parameter-gpuinstanceprofile) | string | GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. |
| [`kubeletDiskType`](#parameter-kubeletdisktype) | string | Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. |
| [`maxCount`](#parameter-maxcount) | int | The maximum number of nodes for auto-scaling. |
Expand Down Expand Up @@ -146,6 +148,16 @@ Some scenarios may require nodes in a node pool to receive their own dedicated p
- MinValue: 0
- MaxValue: 1000

### Parameter: `enableSecureBoot`

Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch.

- Required: No
- Type: bool
- Default: `False`
- MinValue: 0
- MaxValue: 1000

### Parameter: `enableUltraSSD`

Whether to enable UltraSSD.
Expand All @@ -156,6 +168,16 @@ Whether to enable UltraSSD.
- MinValue: 0
- MaxValue: 1000

### Parameter: `enableVTPM`

vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch.

- Required: No
- Type: bool
- Default: `False`
- MinValue: 0
- MaxValue: 1000

### Parameter: `gpuInstanceProfile`

GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
Expand Down
14 changes: 12 additions & 2 deletions avm/res/container-service/managed-cluster/agent-pool/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ param scaleSetEvictionPolicy string = 'Delete'
])
param scaleSetPriority string?

@description('Optional. Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch.')
param enableSecureBoot bool = false

@description('Optional. vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch.')
param enableVTPM bool = false

@description('Optional. Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see spot VMs pricing (https://learn.microsoft.com/en-us/azure/virtual-machines/spot-vms#pricing).')
param spotMaxPrice int?

Expand All @@ -145,11 +151,11 @@ param vnetSubnetResourceId string?
@description('Optional. Determines the type of workload a node can run.')
param workloadRuntime string?

resource managedCluster 'Microsoft.ContainerService/managedClusters@2024-03-02-preview' existing = {
resource managedCluster 'Microsoft.ContainerService/managedClusters@2024-09-01' existing = {
name: managedClusterName
}

resource agentPool 'Microsoft.ContainerService/managedClusters/agentPools@2024-08-01' = {
resource agentPool 'Microsoft.ContainerService/managedClusters/agentPools@2024-09-01' = {
name: name
parent: managedCluster
properties: {
Expand Down Expand Up @@ -184,6 +190,10 @@ resource agentPool 'Microsoft.ContainerService/managedClusters/agentPools@2024-0
scaleDownMode: scaleDownMode
scaleSetEvictionPolicy: scaleSetEvictionPolicy
scaleSetPriority: scaleSetPriority
securityProfile: {
enableSecureBoot: enableSecureBoot
enableVTPM: enableVTPM
}
spotMaxPrice: spotMaxPrice
tags: tags
type: type
Expand Down
24 changes: 21 additions & 3 deletions avm/res/container-service/managed-cluster/agent-pool/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.33.93.31351",
"templateHash": "3323013309772683046"
"templateHash": "7049305712242986495"
},
"name": "Azure Kubernetes Service (AKS) Managed Cluster Agent Pools",
"description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster Agent Pool."
Expand Down Expand Up @@ -256,6 +256,20 @@
"description": "Optional. The Virtual Machine Scale Set priority."
}
},
"enableSecureBoot": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch."
}
},
"enableVTPM": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch."
}
},
"spotMaxPrice": {
"type": "int",
"nullable": true,
Expand Down Expand Up @@ -310,12 +324,12 @@
"managedCluster": {
"existing": true,
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2024-03-02-preview",
"apiVersion": "2024-09-01",
"name": "[parameters('managedClusterName')]"
},
"agentPool": {
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"apiVersion": "2024-08-01",
"apiVersion": "2024-09-01",
"name": "[format('{0}/{1}', parameters('managedClusterName'), parameters('name'))]",
"properties": {
"availabilityZones": "[map(coalesce(parameters('availabilityZones'), createArray()), lambda('zone', format('{0}', lambdaVariables('zone'))))]",
Expand Down Expand Up @@ -345,6 +359,10 @@
"scaleDownMode": "[parameters('scaleDownMode')]",
"scaleSetEvictionPolicy": "[parameters('scaleSetEvictionPolicy')]",
"scaleSetPriority": "[parameters('scaleSetPriority')]",
"securityProfile": {
"enableSecureBoot": "[parameters('enableSecureBoot')]",
"enableVTPM": "[parameters('enableVTPM')]"
},
"spotMaxPrice": "[parameters('spotMaxPrice')]",
"tags": "[parameters('tags')]",
"type": "[parameters('type')]",
Expand Down
11 changes: 11 additions & 0 deletions avm/res/container-service/managed-cluster/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@ resource managedCluster 'Microsoft.ContainerService/managedClusters@2024-09-02-p
scaleDownMode: profile.?scaleDownMode ?? 'Delete'
scaleSetEvictionPolicy: profile.?scaleSetEvictionPolicy ?? 'Delete'
scaleSetPriority: profile.?scaleSetPriority
securityProfile: {
enableSecureBoot: profile.?enableSecureBoot ?? false
enableVTPM: profile.?enableVTPM ?? false
sshAccess: skuName == 'Automatic' ? 'Disabled' : 'LocalUser'
}
spotMaxPrice: profile.?spotMaxPrice
tags: profile.?tags
type: profile.?type
Expand Down Expand Up @@ -1171,6 +1176,12 @@ type agentPoolType = {
@description('Optional. The scale set priority of the agent pool.')
scaleSetPriority: ('Low' | 'Regular' | 'Spot')?

@description('Optional. Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch.')
enableSecureBoot: bool?

@description('Optional. vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch.')
enableVTPM: bool?

@description('Optional. The spot max price of the agent pool.')
spotMaxPrice: int?

Expand Down
Loading

0 comments on commit 7d91a88

Please sign in to comment.