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

feat: Update avm/res/container-service/managed-cluster - Added support for secureboot and vptm #4263

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
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-03-02-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ContainerService/2024-03-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 @@ -2820,7 +2820,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 @@ -2906,13 +2908,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 @@ -3289,7 +3305,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 @@ -3375,13 +3393,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.32.4.45862",
"templateHash": "17003976301716291586"
"templateHash": "5317863145934794833"
},
"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 @@ -580,6 +580,11 @@ resource managedCluster 'Microsoft.ContainerService/managedClusters@2024-03-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 @@ -1149,6 +1154,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
Loading