Kubernetes Cronjob
Type: Submodule
Providers
The following providers are needed by this module:
- kubernetes (2.27.0)
Required Inputs
The following input variables are required:
containers
Description: A list of container configurations for the pod
Type:
list(object({
name = string
init = optional(bool, false)
image = string
version = string
command = list(string)
minimum_memory = optional(number, 100) #The minimum amount of memory in megabytes
minimum_cpu = optional(number, 10) # The minimum amount of cpu millicores
run_as_root = optional(bool, false) # Whether to run the container as root
uid = optional(number, 1000) # user to use when running the container if not root
linux_capabilities = optional(list(string), []) # Default is drop ALL
readonly = optional(bool, true) # Whether to use a readonly file system
env = optional(map(string), {}) # Environment variables specific to the container
}))
name
Description: The name of this cronjob
Type: string
namespace
Description: The namespace the cluster is in
Type: string
schedule
Description: The cronjob schedule
Type: string
timeout_seconds
Description: Number of seconds the job is allowed to run
Type: number
Optional Inputs
The following input variables are optional (have default values):
common_env
Description: Key pair values of the environment variables for each container
Type: map(string)
Default: {}
concurrency_policy
Description: Allow or Forbid. Controls whether multiple jobs can be running concurrently.
Type: string
Default: "Forbid"
dynamic_secrets
Description: Dynamic variable secrets
Type:
list(object({ // key is the secret provider class
secret_provider_class = string // name of the secret provider class
mount_path = string // absolute path of where to mount the secret
env_var = string // name of the env var that will have a path to the secret mount
}))
Default: []
is_local
Description: Whether this module is a part of a local development cronjob
Type: bool
Default: false
mount_owner
Description: The ID of the group that owns the mounted volumes
Type: number
Default: 1000
node_preferences
Description: Node label preferences for the pods
Type: map(object({ weight = number, operator = string, values = list(string) }))
Default: {}
node_requirements
Description: Node label requirements for the pods
Type: map(list(string))
Default: {}
pod_annotations
Description: Annotations to add to the pods in the cronjob
Type: map(string)
Default: {}
priority_class_name
Description: The priority class to use for pods in the cronjob
Type: string
Default: null
restart_policy
Description: The pod restart policy
Type: string
Default: "OnFailure"
secret_mounts
Description: A mapping of Kubernetes secret names to their absolute mount paths in the containers of the cronjob
Type: map(string)
Default: {}
secrets
Description: Key pair values of secrets to add to the containers as environment variables
Type: map(string)
Default: {}
service_account
Description: The name of the service account to use for this cronjob
Type: string
Default: null
tmp_directories
Description: A list of paths that contain empty temporary directories
Type:
map(object({
size_gb = optional(number, 1)
}))
Default: {}
tolerations
Description: A list of tolerations for the pods
Type:
list(object({
key = string
operator = string
value = string
effect = string
}))
Default: []
vpa_enabled
Description: Whether to enable the vertical pod autoscaler
Type: bool
Default: true
Outputs
The following outputs are exported:
match_labels
Description: The labels unique to this cronjob that can be used to select the pods in this cronjob
Usage
No notes