Skip to content

Commit

Permalink
feat: add option for keda addon container-service - `avm/res/containe…
Browse files Browse the repository at this point in the history
…r-service/managed-cluster` (Azure#1691)

## Description

This is adding in the option to enable Keda on an AKS cluster. 

I would probably do this one after
Azure#1682 as i used my
main branch that has the cost anlayasis changes in it.


<!--
>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 Azure#123
Fixes Azure#456
Closes Azure#123
Closes Azure#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-Keda)](https://github.com/PixelRobots/bicep-registry-modules/actions/workflows/avm.res.container-service.managed-cluster.yml?query=branch%3Afeat-Keda)
|

## 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 and DonKoning committed Apr 29, 2024
1 parent b8996d1 commit ceb9467
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
9 changes: 9 additions & 0 deletions avm/res/container-service/managed-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,7 @@ module managedCluster 'br/public:avm/res/container-service/managed-cluster:<vers
| [`httpProxyConfig`](#parameter-httpproxyconfig) | object | Configurations for provisioning the cluster with HTTP proxy servers. |
| [`identityProfile`](#parameter-identityprofile) | object | Identities associated with the cluster. |
| [`ingressApplicationGatewayEnabled`](#parameter-ingressapplicationgatewayenabled) | bool | Specifies whether the ingressApplicationGateway (AGIC) add-on is enabled or not. |
| [`kedaAddon`](#parameter-kedaaddon) | bool | Enables Kubernetes Event-driven Autoscaling (KEDA). |
| [`kubeDashboardEnabled`](#parameter-kubedashboardenabled) | bool | Specifies whether the kubeDashboard add-on is enabled or not. |
| [`kubernetesVersion`](#parameter-kubernetesversion) | string | Version of Kubernetes specified when creating the managed cluster. |
| [`loadBalancerSku`](#parameter-loadbalancersku) | string | Specifies the sku of the load balancer used by the virtual machine scale sets used by nodepools. |
Expand Down Expand Up @@ -2794,6 +2795,14 @@ Specifies whether the ingressApplicationGateway (AGIC) add-on is enabled or not.
- Type: bool
- Default: `False`

### Parameter: `kedaAddon`

Enables Kubernetes Event-driven Autoscaling (KEDA).

- Required: No
- Type: bool
- Default: `False`

### Parameter: `kubeDashboardEnabled`

Specifies whether the kubeDashboard add-on is enabled or not.
Expand Down
8 changes: 8 additions & 0 deletions avm/res/container-service/managed-cluster/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ param httpProxyConfig object?
@description('Optional. Identities associated with the cluster.')
param identityProfile object?

@description('Optional. Enables Kubernetes Event-driven Autoscaling (KEDA).')
param kedaAddon bool = false

@description('Optional. The customer managed key definition.')
param customerManagedKey customerManagedKeyType

Expand Down Expand Up @@ -612,6 +615,11 @@ resource managedCluster 'Microsoft.ContainerService/managedClusters@2023-07-02-p
disableLocalAccounts: disableLocalAccounts
nodeResourceGroup: nodeResourceGroup
enablePodSecurityPolicy: enablePodSecurityPolicy
workloadAutoScalerProfile: {
keda: {
enabled: kedaAddon
}
}
networkProfile: {
networkDataplane: networkDataplane
networkPlugin: networkPlugin
Expand Down
14 changes: 13 additions & 1 deletion avm/res/container-service/managed-cluster/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "3806996475520060110"
"templateHash": "2318180309482229247"
},
"name": "Azure Kubernetes Service (AKS) Managed Clusters",
"description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.",
Expand Down Expand Up @@ -1378,6 +1378,13 @@
"description": "Optional. Identities associated with the cluster."
}
},
"kedaAddon": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. Enables Kubernetes Event-driven Autoscaling (KEDA)."
}
},
"customerManagedKey": {
"$ref": "#/definitions/customerManagedKeyType",
"metadata": {
Expand Down Expand Up @@ -1575,6 +1582,11 @@
"disableLocalAccounts": "[parameters('disableLocalAccounts')]",
"nodeResourceGroup": "[parameters('nodeResourceGroup')]",
"enablePodSecurityPolicy": "[parameters('enablePodSecurityPolicy')]",
"workloadAutoScalerProfile": {
"keda": {
"enabled": "[parameters('kedaAddon')]"
}
},
"networkProfile": {
"networkDataplane": "[parameters('networkDataplane')]",
"networkPlugin": "[parameters('networkPlugin')]",
Expand Down

0 comments on commit ceb9467

Please sign in to comment.