From fd0904ae5116ed1dae5ed57dfae100cd97781f2a Mon Sep 17 00:00:00 2001 From: Lucas Rodriguez Date: Tue, 17 Oct 2023 23:26:56 -0500 Subject: [PATCH] Expose Cron schedule as deploy-time variable Default set to run once every hour at the beginning of the hour --- manifests/zarf-ecr-credential-helper.yaml | 2 +- zarf-config.toml | 1 + zarf.yaml | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifests/zarf-ecr-credential-helper.yaml b/manifests/zarf-ecr-credential-helper.yaml index ad6a26c..0f8fdfe 100644 --- a/manifests/zarf-ecr-credential-helper.yaml +++ b/manifests/zarf-ecr-credential-helper.yaml @@ -39,7 +39,7 @@ metadata: name: zarf-ecr-credential-helper namespace: zarf spec: - schedule: "*/1 * * * *" + schedule: "###ZARF_VAR_ECR_CREDENTIAL_HELPER_CRON_SCHEDULE###" jobTemplate: spec: template: diff --git a/zarf-config.toml b/zarf-config.toml index 19490de..f34ba3f 100644 --- a/zarf-config.toml +++ b/zarf-config.toml @@ -26,3 +26,4 @@ aws_region = 'us-east-1' registry_type = '' ecr_hook_role_arn = '' ecr_credential_helper_role_arn = '' +ecr_credential_helper_cron_schedule = '*/1 * * * *' diff --git a/zarf.yaml b/zarf.yaml index adbf554..6794bb7 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -33,6 +33,11 @@ variables: description: "The ARN of an IAM role to give the zarf-ecr-credential-helper necessary permissions to fetch ECR tokens" prompt: true + - name: ECR_CREDENTIAL_HELPER_CRON_SCHEDULE + description: "The schedule on which the ECR credential helper CronJob will run. https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#schedule-syntax" + # Run once an hour at the beginning of the hour + default: "0 * * * *" + components: - name: ecr-bootstrap description: "Bootstrap the deployment by creating an ECR repository for the Pepr controller image"