This repository is archived and no longer maintained. All helm charts have been moved to the DND-IT/helm-charts repository.
You can find how to update to the new repository here
Contains the generic helm chart that run kubernetes cron job. It is used by Prometheus & Disco projects
To deploy a k8s cronjob simply create a helm value file and refer it in the terraform code. Here it is an example with a value file accepting some parameters set from the terraform code
File example.yaml
image_repo: curlimages/curl
image_tag: ${image_tag}
metadata:
labels:
datadog:
env: ${datadog_env}
service: ${service_name}
version: v${image_tag}
port: 3200
service:
name: ${service_name}
env:
URL: ${url_env}
cronjob:
schedule: ${cronjob_schedule}
File example.tf
resource "helm_release" "trigger_url" {
name = "trigger-a-google-search"
chart = "https://github.com/DND-IT/cron-helm-chart/archive/v1.1.0.tar.gz"
namespace = lower(var.branch)
create_namespace = true
max_history = 10
values = [
templatefile("${path.module}/example.yaml", {
service_name = "search"
image_tag = "8.2.1"
datadog_env = "disco-sbx"
url_env = "https://www.google.com"
cronjob_schedule = "*/10 * * * *" # Every 10 minutes
}),
yamlencode({
args = ["https://www.google.com"]
})
]
}