Links

CronJobs

Schedule a Kubernetes Job in AWS and GCP by creating a CronJob in the DuploCloud Portal
A Kubernetes CronJob is a variant of a Kubernetes Job, with the exception that you can schedule a CronJob to run at periodic intervals.
See the Kubernetes documentation on CronJobs for more information.

Creating a Kubernetes CronJob in the DuploCloud portal

  1. 1.
    In the DuploCloud Portal, navigate to Kubernetes -> CronJob.
  2. 2.
    Click Add. The Add Kubernetes CronJob page displays.
  3. 3.
    In the Basic Options step, specify the Kubernetes CronJob Name.
  4. 4.
    In the Schedule field, specify the Cron Schedule in Cron Format. Click the Info Tip icon for examples. When specifying a Schedule in Cron Format, ensure you separate each value with a space. For example, 0 0 * * 0 is a valid Cron Format input; 00**0 is not. See the Kubernetes documentation for detailed information about Cron Format.
  5. 5.
    In the Container - 1 area, specify the Container Name and associated Docker Image.
Add Kubernetes CronJob page
  1. 6.
    In the Command field, specify the command attributes for Container - 1. Click the Info Tip icon for examples. Select and Copy commands as needed.
    Examples for Command field in Container - 1 area of Add Kubernetes CronJob page.
    Completed Command field for Container - 1.
  2. 7.
    To run the CronJob to completion, you must specify a Kubernetes Init Container. Click the Add Container
    button and select the Add Init Container option. The Init Container - 1 area displays.
    Add Init Container option on Add Container button in Container - 1 area.
    Init Container - 1 area.
  3. 8.
    In the Init Container - 1 area, specify the Container Name and associated Docker Image.
  4. 9.
    Click Next to open the Advanced Configuration step.
  5. 10.
    In the Other Spec Configuration field, specify the job spec (in YAML) for Init Container - 1. Click the Info Tip icon (
    ) for examples. Select and Copy commands as needed
Examples for Other Spec Configuration field in Advanced Configuration step for Init Container - 1.
Completed Other Spec Configuration field for Init Container - 1.
  1. 8.
    Click Create. The K8s CronJob is created and displayed on the CronJob page and will be run according to the schedule you specified.
    K8s CronJob tab displaying Kubernetes Job MYCRONJOB.

Viewing a Kubernetes CronJob

  1. 1.
    In the DuploCloud Portal, navigate to Kubernetes -> CronJob.
  2. 2.
    Select the CronJob you want to view and click the Overview, Schedule, and Details tabs for more information about the job schedule and job history.
You can also view details of a Kubernetes CronJob by clicking on the menu icon (
) icon to the left of the job name and selecting View.
Overview tab for Kubernetes Job MYCRONJOB.
CronJob options menu with View option highlighted.

Using the Container page to view linked Kubernetes CronJobs

You can also view CronJobs linked to containers by clicking the container Name on the Containers page (Kubernetes -> Containers).
Clicking the Container Name on the Containers page to view a linked K8s CronJob
You can filter container names by using the search field at the top of the page, as in this example:
Highlighted search field on the Containers page

Editing a Kubernetes CronJob

  1. 1.
    In the DuploCloud Portal, navigate to Kubernetes -> CronJob.
  2. 2.
    Select the K8s CronJob you want to edit.
  3. 3.
    Click the options menu (
    ) icon to the left of the CronJob name and select Edit.
You can edit a Kubernetes Job in the DuploCloud Portal and modify the following fields:
  • Cleanup After Finished in Seconds
  • Other Spec Configuration
  • Metadata Annotations
  • Labels
CronJob options menu with Edit option highlighted

Deleting a Kubernetes CronJob

  1. 1.
    In the DuploCloud Portal, navigate to Kubernetes -> CronJob.
  2. 2.
    Select the K8s CronJob you want to delete.
  3. 3.
    Click the Job Options Menu (
    ) icon to the left of the Job name and select Delete.
Job options menu with Delete option highlighted