diff --git a/scaledobject.tf b/scaledobject.tf index c1efad7..af31458 100644 --- a/scaledobject.tf +++ b/scaledobject.tf @@ -14,7 +14,9 @@ resource "kubernetes_manifest" "scaledobject_cron" { "spec" = { "scaleTargetRef" = { - "name" = "bitbucket-${each.key}" + "name" = "bitbucket-${each.key}" + "apiVersion" = "apps/v1" + "kind" = "StatefulSet" } "minReplicaCount" = 0 "maxReplicaCount" = 1 @@ -22,8 +24,9 @@ resource "kubernetes_manifest" "scaledobject_cron" { for trigger in lookup(each.value, "triggers", []) : { "type" = "cron" "metadata" = { - "schedule" = trigger.cronSyntax - "timeZone" = trigger.timeZone + "start" = trigger.start + "end" = trigger.end + "timezone" = trigger.timezone "desiredReplicas" = tostring(trigger.desiredReplicas) } } diff --git a/variables.tf b/variables.tf index 9022786..cb0a205 100644 --- a/variables.tf +++ b/variables.tf @@ -28,8 +28,9 @@ variable "bitbucket_runners" { })) cron_scaling_enabled = optional(bool, false) triggers = optional(list(object({ - cronSyntax = string - timeZone = string + start = string + end = string + timezone = string desiredReplicas = number })), []) }))