Skip to content

Commit

Permalink
Use K8up's built-in randomizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Mainberger committed Jul 21, 2021
1 parent 748bf6d commit db9562d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,15 @@ local k8up_s3_secret_ref = {
};

local k8up_schedule =
local minute = std.foldl(function(x, y) x + y, std.encodeUTF8(std.md5(inv.parameters.cluster.name + params.namespace)), 0) % 60;
k8up.Schedule(
'backup',
'%d * * * *' % minute,
'@hourly-random',
keep_jobs=params.k8up.keepjobs,
bucket=params.k8up.s3.bucket,
backupkey=k8up_repo_secret_ref,
s3secret=k8up_s3_secret_ref,
create_bucket=false,
).schedule + k8up.PruneSpec('10 */4 * * *', 30, 20);
).schedule + k8up.PruneSpec('@daily-random', 30, 20);

// Define outputs below
{
Expand Down

0 comments on commit db9562d

Please sign in to comment.