@@ -23,6 +23,9 @@ export function prepareEnvironment(input: {
23
23
24
24
const appDns = `app.${ input . rootDns } ` ;
25
25
const apiDns = `api.${ input . rootDns } ` ;
26
+ const isProduction = env === 'production' ;
27
+ const isStaging = env === 'staging' ;
28
+ const isDev = env === 'dev' ;
26
29
27
30
return {
28
31
envVars : {
@@ -33,14 +36,50 @@ export function prepareEnvironment(input: {
33
36
RELEASE : input . release ,
34
37
} ,
35
38
envName : env ,
36
- isProduction : env === 'production' ,
37
- isStaging : env === 'staging' ,
38
- isDev : env === 'dev' ,
39
+ isProduction,
40
+ isStaging,
41
+ isDev,
39
42
encryptionSecret,
40
43
release : input . release ,
41
44
appDns,
42
45
apiDns,
43
46
rootDns : input . rootDns ,
47
+ podsConfig : {
48
+ general : {
49
+ replicas : isProduction ? 3 : isStaging ? 2 : 1 ,
50
+ } ,
51
+ supertokens : {
52
+ replicas : isProduction ? 3 : 1 ,
53
+ } ,
54
+ envoy : {
55
+ replicas : isProduction ? 3 : 1 ,
56
+ cpuLimit : isProduction ? '800m' : '150m' ,
57
+ memoryLimit : isProduction ? '1Gi' : '200Mi' ,
58
+ } ,
59
+ schemaService : {
60
+ memoryLimit : isProduction ? '2Gi' : '1Gi' ,
61
+ } ,
62
+ usageService : {
63
+ replicas : isProduction ? 3 : isStaging ? 2 : 1 ,
64
+ cpuLimit : isProduction ? '900m' : '300m' ,
65
+ maxReplicas : isProduction ? 6 : isStaging ? 3 : 1 ,
66
+ cpuAverageToScale : 60 ,
67
+ } ,
68
+ usageIngestorService : {
69
+ replicas : isProduction ? 6 : isStaging ? 2 : 1 ,
70
+ cpuLimit : isProduction ? '900m' : '300m' ,
71
+ maxReplicas : isProduction ? /* numberOfPartitions */ 16 : 2 ,
72
+ cpuAverageToScale : 60 ,
73
+ } ,
74
+ redis : {
75
+ memoryLimit : isProduction ? '4Gi' : '100Mi' ,
76
+ cpuLimit : isProduction ? '1000m' : '50m' ,
77
+ } ,
78
+ internalObservability : {
79
+ cpuLimit : isProduction ? '512m' : '150m' ,
80
+ memoryLimit : isProduction ? '1000Mi' : '300Mi' ,
81
+ } ,
82
+ } ,
44
83
} ;
45
84
}
46
85
0 commit comments