File tree 1 file changed +23
-0
lines changed
apps/kubernetes-provider/src
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 |
37
37
const POD_EPHEMERAL_STORAGE_SIZE_LIMIT = process . env . POD_EPHEMERAL_STORAGE_SIZE_LIMIT || "10Gi" ;
38
38
const POD_EPHEMERAL_STORAGE_SIZE_REQUEST = process . env . POD_EPHEMERAL_STORAGE_SIZE_REQUEST || "2Gi" ;
39
39
40
+ const PRE_PULL_DISABLED = process . env . PRE_PULL_DISABLED === "true" ;
41
+
40
42
const logger = new SimpleLogger ( `[${ NODE_NAME } ]` ) ;
41
43
logger . log ( `running in ${ RUNTIME_ENV } mode` ) ;
42
44
@@ -301,6 +303,11 @@ class KubernetesTaskOperations implements TaskOperations {
301
303
}
302
304
303
305
async prePullDeployment ( opts : TaskOperationsPrePullDeploymentOptions ) {
306
+ if ( PRE_PULL_DISABLED ) {
307
+ logger . debug ( "Pre-pull is disabled, skipping." , { opts } ) ;
308
+ return ;
309
+ }
310
+
304
311
const metaName = this . #getPrePullContainerName( opts . shortCode ) ;
305
312
306
313
const metaLabels = {
@@ -332,6 +339,22 @@ class KubernetesTaskOperations implements TaskOperations {
332
339
spec : {
333
340
...this . #defaultPodSpec,
334
341
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
+ } ,
335
358
initContainers : [
336
359
{
337
360
name : "prepull" ,
You can’t perform that action at this time.
0 commit comments