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

fix(applications): use correct scale configuration #1311

Merged
merged 2 commits into from
Oct 17, 2024
Merged
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
9 changes: 6 additions & 3 deletions .azure/applications/graphql/main.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
targetScope = 'resourceGroup'

import { Scale } from '../../modules/containerApp/main.bicep'

@description('The tag of the image to be used')
@minLength(3)
param imageTag string
Expand Down Expand Up @@ -106,24 +108,25 @@ var probes = [
}
]

var scale = {
@description('The scaling configuration for the container app')
param scale Scale = {
minReplicas: 2
maxReplicas: 10
rules: [
{
custom: {
type: 'cpu'
metricType: 'Utilization'
metadata: {
type: 'Utilization'
value: '70'
}
}
}
{
custom: {
type: 'memory'
metricType: 'Utilization'
metadata: {
type: 'Utilization'
value: '70'
}
}
Expand Down
10 changes: 7 additions & 3 deletions .azure/applications/web-api-eu/main.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
targetScope = 'resourceGroup'

import { Scale } from '../../modules/containerApp/main.bicep'

@description('The tag of the image to be used')
@minLength(3)
param imageTag string
Expand Down Expand Up @@ -77,30 +79,32 @@ var containerAppEnvVars = [
}
]

var scale = {
@description('The scaling configuration for the container app')
param scale Scale = {
minReplicas: 2
maxReplicas: 10
rules: [
{
custom: {
type: 'cpu'
metricType: 'Utilization'
metadata: {
type: 'Utilization'
value: '70'
}
}
}
{
custom: {
type: 'memory'
metricType: 'Utilization'
metadata: {
type: 'Utilization'
value: '70'
}
}
}
]
}

resource environmentKeyVaultResource 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
name: environmentKeyVaultName
}
Expand Down
24 changes: 22 additions & 2 deletions .azure/modules/containerApp/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,30 @@ param revisionSuffix string
@description('The probes for the container app')
param probes array = []

@export()
type ScaleRule = {
// add additional types as needed: https://keda.sh/docs/2.15/scalers/
custom: {
type: 'cpu' | 'memory'
metadata: {
type: 'Utilization'
value: string
}
}
}

arealmaas marked this conversation as resolved.
Show resolved Hide resolved
@export()
type Scale = {
minReplicas: int
maxReplicas: int
rules: ScaleRule[]
}

@description('The scaling configuration for the container app')
param scale object = {
param scale Scale = {
minReplicas: 1
maxReplicas: 1 // temp disable scaling by default for outbox scheduling
maxReplicas: 1
rules: []
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
}

// TODO: Refactor to make userAssignedIdentityId a required parameter once all container apps use user-assigned identities
Expand Down
Loading