File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
apps/kubernetes-provider/src Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ const UPTIME_MAX_PENDING_ERRORS = Number(process.env.UPTIME_MAX_PENDING_ERRORS |
3737const POD_EPHEMERAL_STORAGE_SIZE_LIMIT = process . env . POD_EPHEMERAL_STORAGE_SIZE_LIMIT || "10Gi" ;
3838const POD_EPHEMERAL_STORAGE_SIZE_REQUEST = process . env . POD_EPHEMERAL_STORAGE_SIZE_REQUEST || "2Gi" ;
3939
40+ const PRE_PULL_DISABLED = process . env . PRE_PULL_DISABLED === "true" ;
41+
4042const logger = new SimpleLogger ( `[${ NODE_NAME } ]` ) ;
4143logger . log ( `running in ${ RUNTIME_ENV } mode` ) ;
4244
@@ -301,6 +303,11 @@ class KubernetesTaskOperations implements TaskOperations {
301303 }
302304
303305 async prePullDeployment ( opts : TaskOperationsPrePullDeploymentOptions ) {
306+ if ( PRE_PULL_DISABLED ) {
307+ logger . debug ( "Pre-pull is disabled, skipping." , { opts } ) ;
308+ return ;
309+ }
310+
304311 const metaName = this . #getPrePullContainerName( opts . shortCode ) ;
305312
306313 const metaLabels = {
@@ -332,6 +339,22 @@ class KubernetesTaskOperations implements TaskOperations {
332339 spec : {
333340 ...this . #defaultPodSpec,
334341 restartPolicy : "Always" ,
342+ affinity : {
343+ nodeAffinity : {
344+ requiredDuringSchedulingIgnoredDuringExecution : {
345+ nodeSelectorTerms : [
346+ {
347+ matchExpressions : [
348+ {
349+ key : "trigger.dev/pre-pull-disabled" ,
350+ operator : "DoesNotExist" ,
351+ } ,
352+ ] ,
353+ } ,
354+ ] ,
355+ } ,
356+ } ,
357+ } ,
335358 initContainers : [
336359 {
337360 name : "prepull" ,
You can’t perform that action at this time.
0 commit comments