terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

Implement `timeZone` field in `CronJob`

Open SPodjasek opened this issue 3 years ago • 0 comments

Description

Latest Alpha feature introduced by CronJobTimeZone feature gate allows you to set desired time zone in which CronJob should be scheduled. This field is missing in current provider.

Potential Terraform Configuration

resource "kubernetes_cron_job_v1" "time_zone_test" {
  metadata {
    name      = "time-zone-test"
    namespace = kubernetes_namespace.namespace.metadata[0].name
  }
  spec {
    schedule                  = "10 1 * * *"
    time_zone                 = "Etc/UTC"
    job_template {
      metadata {}
      spec {
        template {
          metadata {}
          spec {
            container {
              name  = "test"
              image = "busybox:stable"

              command = ["/bin/sh", "-c", "echo hello world"]
            }
          }
        }
      }
    }
  }
}

References

https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones

https://github.com/kubernetes/api/blob/988d7a1d2141e6cdb6b4d3c1a0652471928351aa/batch/v1/types.go#L378-L382

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

SPodjasek avatar Jul 04 '22 23:07 SPodjasek