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

chore: Add scale to service and webapi so #1321

Merged
merged 2 commits into from
Oct 18, 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
31 changes: 31 additions & 0 deletions .azure/applications/service/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 @@ -40,6 +42,34 @@ param appConfigurationName string
@minLength(3)
param environmentKeyVaultName string

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

var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/digdir/dialogporten-'
var tags = {
Expand Down Expand Up @@ -166,6 +196,7 @@ module containerApp '../../modules/containerApp/main.bicep' = {
port: port
revisionSuffix: revisionSuffix
userAssignedIdentityId: managedIdentity.id
scale: scale
// TODO: Once all container apps use user-assigned identities, remove this comment and ensure userAssignedIdentityId is always provided
}
dependsOn: [
Expand Down
31 changes: 31 additions & 0 deletions .azure/applications/web-api-so/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 @@ -43,6 +45,34 @@ param appConfigurationName string
@secure()
param environmentKeyVaultName string

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

var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/digdir/dialogporten-'
var tags = {
Expand Down Expand Up @@ -129,6 +159,7 @@ module containerApp '../../modules/containerApp/main.bicep' = {
probes: probes
port: port
revisionSuffix: revisionSuffix
scale: scale
}
}

Expand Down
Loading