Overview
The CronJob Guardian operator can be configured via:- Config file (YAML) -
/etc/cronjob-guardian/config.yamlor via--configflag - Environment variables - Prefix with
GUARDIAN_and replace dots/hyphens with underscores - Command-line flags - Direct flags to the operator binary
Configuration File Format
Configuration Options
log-level
Logging level for operator output.Valid values:
debug, info, warn, errorEnvironment variable: GUARDIAN_LOG_LEVELCLI flag: --log-levelScheduler Configuration
Controls background task execution intervals.How often to check dead-man’s switches across all monitors.Environment variable:
GUARDIAN_SCHEDULER_DEAD_MAN_SWITCH_INTERVALCLI flag: --scheduler.dead-man-switch-intervalHow often to recalculate SLA metrics (success rates, duration percentiles).Environment variable:
GUARDIAN_SCHEDULER_SLA_RECALCULATION_INTERVALCLI flag: --scheduler.sla-recalculation-intervalHow often to prune old execution history based on retention policies.Environment variable:
GUARDIAN_SCHEDULER_PRUNE_INTERVALCLI flag: --scheduler.prune-intervalDelay after operator startup before sending alerts. Prevents alert floods when the operator restarts and reconciles existing resources.Environment variable:
GUARDIAN_SCHEDULER_STARTUP_GRACE_PERIODCLI flag: --scheduler.startup-grace-periodStorage Configuration
Configures the database backend for execution history and metrics.Storage backend type.Valid values:
sqlite, postgres, mysqlEnvironment variable: GUARDIAN_STORAGE_TYPECLI flag: --storage.typeSQLite Configuration
Used whenstorage.type is sqlite.
Path to the SQLite database file. Requires a persistent volume in Kubernetes.Environment variable:
GUARDIAN_STORAGE_SQLITE_PATHCLI flag: --storage.sqlite.pathPostgreSQL Configuration
Used whenstorage.type is postgres.
PostgreSQL server hostname.Environment variable:
GUARDIAN_STORAGE_POSTGRES_HOSTCLI flag: --storage.postgres.hostPostgreSQL server port.Environment variable:
GUARDIAN_STORAGE_POSTGRES_PORTCLI flag: --storage.postgres.portPostgreSQL database name.Environment variable:
GUARDIAN_STORAGE_POSTGRES_DATABASECLI flag: --storage.postgres.databasePostgreSQL username.Environment variable:
GUARDIAN_STORAGE_POSTGRES_USERNAMECLI flag: --storage.postgres.usernamePostgreSQL password. Recommend using environment variable instead of config file.Environment variable:
GUARDIAN_STORAGE_POSTGRES_PASSWORDCLI flag: --storage.postgres.passwordPostgreSQL SSL mode.Valid values:
disable, require, verify-ca, verify-fullEnvironment variable: GUARDIAN_STORAGE_POSTGRES_SSL_MODECLI flag: --storage.postgres.ssl-modeMaximum number of idle connections in the pool.Environment variable:
GUARDIAN_STORAGE_POSTGRES_POOL_MAX_IDLE_CONNSCLI flag: --storage.postgres.pool.max-idle-connsMaximum number of open connections.Environment variable:
GUARDIAN_STORAGE_POSTGRES_POOL_MAX_OPEN_CONNSCLI flag: --storage.postgres.pool.max-open-connsMaximum lifetime of a connection.Environment variable:
GUARDIAN_STORAGE_POSTGRES_POOL_CONN_MAX_LIFETIMECLI flag: --storage.postgres.pool.conn-max-lifetimeMaximum idle time for a connection before it’s closed.Environment variable:
GUARDIAN_STORAGE_POSTGRES_POOL_CONN_MAX_IDLE_TIMECLI flag: --storage.postgres.pool.conn-max-idle-timeMySQL Configuration
Used whenstorage.type is mysql.
MySQL server hostname.Environment variable:
GUARDIAN_STORAGE_MYSQL_HOSTCLI flag: --storage.mysql.hostMySQL server port.Environment variable:
GUARDIAN_STORAGE_MYSQL_PORTCLI flag: --storage.mysql.portMySQL database name.Environment variable:
GUARDIAN_STORAGE_MYSQL_DATABASECLI flag: --storage.mysql.databaseMySQL username.Environment variable:
GUARDIAN_STORAGE_MYSQL_USERNAMECLI flag: --storage.mysql.usernameMySQL password. Recommend using environment variable instead of config file.Environment variable:
GUARDIAN_STORAGE_MYSQL_PASSWORDCLI flag: --storage.mysql.passwordMaximum number of idle connections in the pool.Environment variable:
GUARDIAN_STORAGE_MYSQL_POOL_MAX_IDLE_CONNSCLI flag: --storage.mysql.pool.max-idle-connsMaximum number of open connections.Environment variable:
GUARDIAN_STORAGE_MYSQL_POOL_MAX_OPEN_CONNSCLI flag: --storage.mysql.pool.max-open-connsMaximum lifetime of a connection.Environment variable:
GUARDIAN_STORAGE_MYSQL_POOL_CONN_MAX_LIFETIMECLI flag: --storage.mysql.pool.conn-max-lifetimeMaximum idle time for a connection before it’s closed.Environment variable:
GUARDIAN_STORAGE_MYSQL_POOL_CONN_MAX_IDLE_TIMECLI flag: --storage.mysql.pool.conn-max-idle-timeStorage Features
Cluster-wide defaults for log and event storage. Can be overridden per-monitor.Cluster-wide default for storing job logs in the database. Individual monitors can override this via
dataRetention.storeLogs.Environment variable: GUARDIAN_STORAGE_LOG_STORAGE_ENABLEDCLI flag: --storage.log-storage-enabledCluster-wide default for storing Kubernetes events in the database. Individual monitors can override via
dataRetention.storeEvents.Environment variable: GUARDIAN_STORAGE_EVENT_STORAGE_ENABLEDCLI flag: --storage.event-storage-enabledMaximum log size to store per execution in KB. Logs exceeding this size are truncated.Environment variable:
GUARDIAN_STORAGE_MAX_LOG_SIZE_KBCLI flag: --storage.max-log-size-kbHow long to keep stored logs. If
0, uses history-retention.default-days value.Environment variable: GUARDIAN_STORAGE_LOG_RETENTION_DAYSCLI flag: --storage.log-retention-daysHistory Retention
Cluster-wide defaults for execution history retention.Default retention period in days for execution history. Individual monitors can override via
dataRetention.retentionDays.Environment variable: GUARDIAN_HISTORY_RETENTION_DEFAULT_DAYSCLI flag: --history-retention.default-daysMaximum allowed retention period. Prevents monitors from retaining data indefinitely.Environment variable:
GUARDIAN_HISTORY_RETENTION_MAX_DAYSCLI flag: --history-retention.max-daysRate Limits
Global rate limits to prevent alert storms.Maximum alerts per minute across all channels and monitors.Environment variable:
GUARDIAN_RATE_LIMITS_MAX_ALERTS_PER_MINUTECLI flag: --rate-limits.max-alerts-per-minuteMaximum burst of alerts allowed in a short window.Environment variable:
GUARDIAN_RATE_LIMITS_BURST_LIMITCLI flag: --rate-limits.burst-limitDefault duration to suppress duplicate alerts. Individual monitors can override via
alerting.suppressDuplicatesFor.Environment variable: GUARDIAN_RATE_LIMITS_DEFAULT_SUPPRESS_DUPLICATES_FORCLI flag: --rate-limits.default-suppress-duplicates-forUI Server
Configures the web UI and REST API server.Enable the UI server (serves both web UI and REST API).Environment variable:
GUARDIAN_UI_ENABLEDCLI flag: --ui.enabledPort for the UI server.Environment variable:
GUARDIAN_UI_PORTCLI flag: --ui.portMetrics Server
Configures Prometheus metrics endpoint.Address to bind the metrics endpoint. Use
"0" to disable metrics, or ":8443" to bind to port 8443 on all interfaces.Environment variable: GUARDIAN_METRICS_BIND_ADDRESSCLI flag: --metrics.bind-addressEnable HTTPS for the metrics endpoint.Environment variable:
GUARDIAN_METRICS_SECURECLI flag: --metrics.secureDirectory containing TLS certificates for metrics endpoint.Environment variable:
GUARDIAN_METRICS_CERT_PATHCLI flag: --metrics.cert-pathCertificate file name within
cert-path.Environment variable: GUARDIAN_METRICS_CERT_NAMECLI flag: --metrics.cert-namePrivate key file name within
cert-path.Environment variable: GUARDIAN_METRICS_CERT_KEYCLI flag: --metrics.cert-keyHealth Probes
Configures liveness and readiness probe endpoints.Address to bind health probe endpoints (
/healthz and /readyz).Environment variable: GUARDIAN_PROBES_BIND_ADDRESSCLI flag: --probes.bind-addressLeader Election
Configures leader election for high-availability deployments.Enable leader election. Required when running multiple operator replicas.Environment variable:
GUARDIAN_LEADER_ELECTION_ENABLEDCLI flag: --leader-election.enabledDuration that non-leader candidates will wait to force acquire leadership.Environment variable:
GUARDIAN_LEADER_ELECTION_LEASE_DURATIONCLI flag: --leader-election.lease-durationDuration the leader will retry refreshing leadership before giving up.Environment variable:
GUARDIAN_LEADER_ELECTION_RENEW_DEADLINECLI flag: --leader-election.renew-deadlineDuration candidates should wait between leadership acquisition attempts.Environment variable:
GUARDIAN_LEADER_ELECTION_RETRY_PERIODCLI flag: --leader-election.retry-periodWebhook Server
Configures the validating/mutating webhook server.Directory containing TLS certificates for the webhook server.Environment variable:
GUARDIAN_WEBHOOK_CERT_PATHCLI flag: --webhook.cert-pathCertificate file name within
cert-path.Environment variable: GUARDIAN_WEBHOOK_CERT_NAMECLI flag: --webhook.cert-namePrivate key file name within
cert-path.Environment variable: GUARDIAN_WEBHOOK_CERT_KEYCLI flag: --webhook.cert-keyEnable HTTP/2 for the webhook server. Disabled by default for security.Environment variable:
GUARDIAN_WEBHOOK_ENABLE_HTTP2CLI flag: --webhook.enable-http2