Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
[Rest Server] Add node selector for user jobs in k8s (#3694)
Browse files Browse the repository at this point in the history
Add node selector for user jobs in k8s,
only run user pods on pai-worker nodes.
  • Loading branch information
abuccts authored Oct 9, 2019
1 parent 1016a98 commit cb6ca62
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/rest-server/src/models/v2/job/k8s.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,23 @@ const generateTaskRole = (taskRole, labels, config) => {
},
},
],
affinity: {
nodeAffinity: {
requiredDuringSchedulingIgnoredDuringExecution: {
nodeSelectorTerms: [
{
matchExpressions: [
{
key: 'pai-worker',
operator: 'In',
values: ['true'],
},
],
},
],
},
},
},
imagePullSecrets: [
{
name: launcherConfig.runtimeImagePullSecrets,
Expand Down

0 comments on commit cb6ca62

Please sign in to comment.