chore: always run the maximum amount of usage services#7924
Conversation
| replicas: isProduction || isStaging ? 6 : 1, | ||
| cpuLimit: isProduction ? '1000m' : '100m', | ||
| maxReplicas: isProduction || isStaging ? 6 : 1, |
There was a problem hiding this comment.
While this change correctly sets the initial number of replicas to match the maximum, it introduces a maintenance concern because the values for replicas and maxReplicas are now identical but not programmatically linked.
If maxReplicas is changed in the future, replicas would also need to be updated manually to ensure the service continues to run at its maximum capacity, as intended. Forgetting to do so would re-introduce auto-scaling.
To make this more robust and prevent configuration drift, consider defining a constant for the replica count and using it for both properties.
const usageServiceReplicas = isProduction || isStaging ? 6 : 1;
usageService: {
replicas: usageServiceReplicas,
cpuLimit: isProduction ? '1000m' : '100m',
maxReplicas: usageServiceReplicas,
cpuAverageToScale: 60,
}|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tag: |
We are not scaling nodes, so I see no need to scale individual pods if we have the resources anyways.