Skip to content

Commit

Permalink
feat: added option to set backendpooltype. - `avm/res/container-servi…
Browse files Browse the repository at this point in the history
…ce/managed-cluster` (#1709)

## Description
This adds the option to change the backendpooltype.
<!--
>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=feat-rh-backendpooltype)](https://github.com/PixelRobots/bicep-registry-modules/actions/workflows/avm.res.container-service.managed-cluster.yml)
|

## Type of Change

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

- [ ] Update to CI Environment or utlities (Non-module effecting
changes)
- [X] 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

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

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

---------

Signed-off-by: PixelRobots <[email protected]>
  • Loading branch information
PixelRobots authored Apr 19, 2024
1 parent 950223f commit 7c25f74
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 11 deletions.
16 changes: 16 additions & 0 deletions avm/res/container-service/managed-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,7 @@ module managedCluster 'br/public:avm/res/container-service/managed-cluster:<vers
| [`autoUpgradeProfileUpgradeChannel`](#parameter-autoupgradeprofileupgradechannel) | string | Auto-upgrade channel on the AKS cluster. |
| [`azurePolicyEnabled`](#parameter-azurepolicyenabled) | bool | Specifies whether the azurepolicy add-on is enabled or not. For security reasons, this setting should be enabled. |
| [`azurePolicyVersion`](#parameter-azurepolicyversion) | string | Specifies the azure policy version to use. |
| [`backendPoolType`](#parameter-backendpooltype) | string | The type of the managed inbound Load Balancer BackendPool. |
| [`costAnalysisEnabled`](#parameter-costanalysisenabled) | bool | Specifies whether the cost analysis add-on is enabled or not. If Enabled `enableStorageProfileDiskCSIDriver` is set to true as it is needed. |
| [`customerManagedKey`](#parameter-customermanagedkey) | object | The customer managed key definition. |
| [`diagnosticSettings`](#parameter-diagnosticsettings) | array | The diagnostic settings of the service. |
Expand Down Expand Up @@ -2241,6 +2242,21 @@ Specifies the azure policy version to use.
- Type: string
- Default: `'v2'`

### Parameter: `backendPoolType`

The type of the managed inbound Load Balancer BackendPool.

- Required: No
- Type: string
- Default: `'NodeIPConfiguration'`
- Allowed:
```Bicep
[
'NodeIP'
'NodeIPConfiguration'
]
```

### Parameter: `costAnalysisEnabled`

Specifies whether the cost analysis add-on is enabled or not. If Enabled `enableStorageProfileDiskCSIDriver` is set to true as it is needed.
Expand Down
20 changes: 14 additions & 6 deletions avm/res/container-service/managed-cluster/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ param loadBalancerSku string = 'standard'
@description('Optional. Outbound IP Count for the Load balancer.')
param managedOutboundIPCount int = 0

@description('Optional. The type of the managed inbound Load Balancer BackendPool.')
@allowed([
'NodeIP'
'NodeIPConfiguration'
])
param backendPoolType string = 'NodeIPConfiguration'

@description('Optional. Specifies outbound (egress) routing method.')
@allowed([
'loadBalancer'
Expand Down Expand Up @@ -630,14 +637,15 @@ resource managedCluster 'Microsoft.ContainerService/managedClusters@2023-07-02-p
dnsServiceIP: dnsServiceIP
outboundType: outboundType
loadBalancerSku: loadBalancerSku
loadBalancerProfile: managedOutboundIPCount != 0
? {
managedOutboundIPs: {
loadBalancerProfile: {
managedOutboundIPs: managedOutboundIPCount != 0
? {
count: managedOutboundIPCount
}
effectiveOutboundIPs: []
}
: null
: null
effectiveOutboundIPs: []
backendPoolType: backendPoolType
}
}
publicNetworkAccess: publicNetworkAccess
aadProfile: {
Expand Down
25 changes: 20 additions & 5 deletions avm/res/container-service/managed-cluster/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "2318180309482229247"
"version": "0.26.170.59819",
"templateHash": "12648833747007968061"
},
"name": "Azure Kubernetes Service (AKS) Managed Clusters",
"description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.",
Expand Down Expand Up @@ -775,6 +775,17 @@
"description": "Optional. Outbound IP Count for the Load balancer."
}
},
"backendPoolType": {
"type": "string",
"defaultValue": "NodeIPConfiguration",
"allowedValues": [
"NodeIP",
"NodeIPConfiguration"
],
"metadata": {
"description": "Optional. The type of the managed inbound Load Balancer BackendPool."
}
},
"outboundType": {
"type": "string",
"defaultValue": "loadBalancer",
Expand Down Expand Up @@ -1597,7 +1608,11 @@
"dnsServiceIP": "[parameters('dnsServiceIP')]",
"outboundType": "[parameters('outboundType')]",
"loadBalancerSku": "[parameters('loadBalancerSku')]",
"loadBalancerProfile": "[if(not(equals(parameters('managedOutboundIPCount'), 0)), createObject('managedOutboundIPs', createObject('count', parameters('managedOutboundIPCount')), 'effectiveOutboundIPs', createArray()), null())]"
"loadBalancerProfile": {
"managedOutboundIPs": "[if(not(equals(parameters('managedOutboundIPCount'), 0)), createObject('count', parameters('managedOutboundIPCount')), null())]",
"effectiveOutboundIPs": [],
"backendPoolType": "[parameters('backendPoolType')]"
}
},
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"aadProfile": {
Expand Down Expand Up @@ -1899,8 +1914,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "8772299678418708256"
"version": "0.26.170.59819",
"templateHash": "4264461851737541966"
},
"name": "Azure Kubernetes Service (AKS) Managed Cluster Agent Pools",
"description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster Agent Pool.",
Expand Down

0 comments on commit 7c25f74

Please sign in to comment.