File tree 3 files changed +8
-24
lines changed
3 files changed +8
-24
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export class InitializerService {
55
55
driver : 'kubernetes' ,
56
56
kubeconfig : null ,
57
57
npmInstallFlags : '' ,
58
+ runtimeAffinity : { } ,
58
59
} ,
59
60
databaseConf : {
60
61
driver : 'mongodb' ,
Original file line number Diff line number Diff line change @@ -6,12 +6,7 @@ import {
6
6
} from '@kubernetes/client-node'
7
7
import { Injectable , Logger } from '@nestjs/common'
8
8
import { GetApplicationNamespace } from 'src/utils/getter'
9
- import {
10
- LABEL_KEY_APP_ID ,
11
- LABEL_KEY_NODE_TYPE ,
12
- MB ,
13
- NodeType ,
14
- } from '../constants'
9
+ import { LABEL_KEY_APP_ID , MB } from '../constants'
15
10
import { StorageService } from '../storage/storage.service'
16
11
import { DatabaseService } from 'src/database/database.service'
17
12
import { ClusterService } from 'src/region/cluster/cluster.service'
@@ -398,27 +393,14 @@ export class InstanceService {
398
393
} ,
399
394
} ,
400
395
] ,
401
- affinity : {
402
- nodeAffinity : {
403
- // required to schedule on runtime node
404
- requiredDuringSchedulingIgnoredDuringExecution : {
405
- nodeSelectorTerms : [
406
- {
407
- matchExpressions : [
408
- {
409
- key : LABEL_KEY_NODE_TYPE ,
410
- operator : 'In' ,
411
- values : [ NodeType . Runtime ] ,
412
- } ,
413
- ] ,
414
- } ,
415
- ] ,
416
- } ,
417
- } , // end of nodeAffinity {}
418
- } , // end of affinity {}
419
396
} , // end of spec {}
420
397
} , // end of template {}
421
398
}
399
+
400
+ if ( region . clusterConf . runtimeAffinity ) {
401
+ spec . template . spec . affinity = region . clusterConf . runtimeAffinity
402
+ }
403
+
422
404
return spec
423
405
}
424
406
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export type RegionClusterConf = {
16
16
driver : string
17
17
kubeconfig : string
18
18
npmInstallFlags : string
19
+ runtimeAffinity : any
19
20
}
20
21
21
22
export type RegionDatabaseConf = {
You can’t perform that action at this time.
0 commit comments