Cron Installation

Description

For YTsaurus, there is a set of cron jobs that are useful for cluster operations, such as cleaning up temporary directories or removing inactive nodes. Both built-in and custom jobs are supported.

List of built-in scripts:

  • clear_tmp – a script that cleans temporary files on the cluster. The script’s source code lives here.
  • prune_offline_cluster_nodes – a script that removes offline nodes from Cypress. The script’s source code lives here.

Prerequisites

At this point, you should have:

  • Helm 3.x
  • a running YTsaurus cluster and the HTTP proxy address (http_proxy)
  • a dedicated robot user for Cron with a token issued to it (see Token Management)

Basic Installation

helm install ytsaurus-cron oci://ghcr.io/ytsaurus/cron-chart \
  --version 0.0.3 \
  --set yt.proxy="http_proxy" \
  --set yt.token="<ROBOT-CRON-TOKEN>"

Configuration

All chart parameters can be set via values.yaml or overridden with --set on the command line.

Authentication in YTsaurus

Specify the token directly:

yt:
  proxy: yt.company.com
  token: Qwerty123!

Or configure it via a Kubernetes Secret:

unmanagedSecret:
  enabled: true
  secretKeyRef:
    name: ytadminsec
    key: token

Built-in Jobs

Each job is defined by the following structure:

  • enabled: whether the job is enabled
  • args: command-line arguments
  • schedule: cron-format schedule
  • restartPolicy: restart policy (recommended: Never)

Example of enabling a job:

helm upgrade --install ytsaurus-cron oci://ghcr.io/ytsaurus/cron-chart \
  --version 0.0.3 \
  --set jobs.clear_tmp_location.enabled=true \
  --set jobs.clear_tmp_location.schedule="*/30 * * * *"

Custom Jobs

You can define your own jobs:

additionalJobs:
  my_cleanup:
    enabled: true
    args:
      - clear_tmp
      - --directory "//my/custom/path"
    schedule: "0 */6 * * *"
    restartPolicy: Never

Example values.yaml

yt:
  proxy: yt.mycompany.com
  token: my-secret-token

jobs:
  clear_tmp_files:
    enabled: true
    args:
      - clear_tmp
      - --directory "//tmp/yt_wrapper/file_storage"
      - --account "tmp_files"
    schedule: "*/30 * * * *"
    restartPolicy: Never

unmanagedSecret:
  enabled: false

To deploy:

helm upgrade --install ytsaurus-cron oci://ghcr.io/ytsaurus/cron-chart \
  --version 0.0.3 \
  -f my-values.yaml

Commonly Used Parameters

Parameter Description
yt.proxy HTTP proxy for accessing YTsaurus
yt.token Access token (if unmanagedSecret is disabled)
unmanagedSecret Use a Kubernetes Secret
image.repository Docker image repository
image.tag Docker image tag
schedule Default schedule (if not specified per job)
concurrencyPolicy Allow, Forbid, or Replace
successfulJobsHistoryLimit Number of successful job records to keep
failedJobsHistoryLimit Number of failed job records to keep
Previous
Next