Skip to content

Commit

Permalink
Use fixed values for minReplicas and maxReplicas to avoid private dep…
Browse files Browse the repository at this point in the history
…loyment issues
  • Loading branch information
mburumaxwell committed Sep 25, 2023
1 parent 13b7274 commit 10bef48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 34 deletions.
2 changes: 0 additions & 2 deletions docs/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ The deployment exposes the following parameters that can be tuned to suit the se
|projectSetups|A JSON array string representing the projects to be setup on startup. This is useful when running your own setup. Example: `[{\"url\":\"https://dev.azure.com/tingle/dependabot\",\"token\":\"dummy\",\"AutoComplete\":true}]`|
|githubToken|Access token for authenticating requests to GitHub. Required for vulnerability checks and to avoid rate limiting on free requests|No|<empty>|
|imageTag|The image tag to use when pulling the docker containers. A tag also defines the version. You should avoid using `latest`. Example: `1.1.0`|No|<version-downloaded>|
|minReplicas|The minimum number of replicas to required for the deployment. Given that scheduling runs in process, this value cannot be less than `1`. This may change in the future.|No|1|
|maxReplicas|The maximum number of replicas when automatic scaling engages. In most cases, you do not need more than 1.|No|1|

> The template includes a User Assigned Managed Identity, which is used when performing Azure Resource Manager operations such as deletions. In the deployment it creates the role assignments that it needs. These role assignments are on the resource group that you deploy to.
Expand Down
14 changes: 2 additions & 12 deletions server/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ param githubToken string = ''
@description('Tag of the docker images.')
param imageTag string = '#{GITVERSION_NUGETVERSIONV2}#'

@minValue(1)
@maxValue(2)
@description('The minimum number of replicas')
param minReplicas int = 1 // necessary for in-memory scheduling

@minValue(1)
@maxValue(5)
@description('The maximum number of replicas')
param maxReplicas int = 1

var fileShares = [
{ name: 'certs' }
{ name: 'distributed-locks', writeable: true }
Expand Down Expand Up @@ -309,8 +299,8 @@ resource app 'Microsoft.App/containerApps@2023-05-01' = {
{ name: 'distributed-locks', storageName: 'distributed-locks', storageType: 'AzureFile' }
]
scale: {
minReplicas: minReplicas
maxReplicas: maxReplicas
minReplicas: 1 // necessary for in-memory scheduling
maxReplicas: 1 // no need to scale beyond one instance, yet
rules: concat(
[ { name: 'http', http: { metadata: { concurrentRequests: '1000' } } } ],
queueScaleRules)
Expand Down
22 changes: 2 additions & 20 deletions server/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,6 @@
"metadata": {
"description": "Tag of the docker images."
}
},
"minReplicas": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"maxValue": 2,
"metadata": {
"description": "The minimum number of replicas"
}
},
"maxReplicas": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"maxValue": 5,
"metadata": {
"description": "The maximum number of replicas"
}
}
},
"variables": {
Expand Down Expand Up @@ -509,8 +491,8 @@
}
],
"scale": {
"minReplicas": "[parameters('minReplicas')]",
"maxReplicas": "[parameters('maxReplicas')]",
"minReplicas": 1,
"maxReplicas": 1,
"rules": "[concat(createArray(createObject('name', 'http', 'http', createObject('metadata', createObject('concurrentRequests', '1000')))), variables('queueScaleRules'))]"
}
}
Expand Down

0 comments on commit 10bef48

Please sign in to comment.