Defining K8s Run Job Properties
This job allows you to create and run a job in K8s.
If the job does not exist in the namespace specified, the system creates a new job and runs it. If the job already exists in the namespace specified, the system first deletes the job and then creates a new one and runs it.
On the Run Job page you define the parameters relevant to run that job on the K8s system from Automic Automation.
-
Connection
Select the K8s Connection object containing the relevant information to connect to the K8s system.
To search for a Connection object, start typing its name to limit the list of the objects that match your input.
-
Namespace
Define the namespace in which you want to run the job. You can click the browse button to the right of the field to open a picker dialog where you can select the relevant name.
-
Job Name
Define the name of the job that you want to trigger in K8s.
-
Job Definition Type
Select the one of the four definition types available: JSON, YAML, FILE, or SCM.
This is the format that you want to use to pass the attributes relevant for this job to K8s.
-
Job Definition
Define what the job should do. Enter the job definition according to the definition type that you have selected:
-
JSON: Enter the relevant job definition in JSON format.
-
YAML: Enter the relevant job definition in YAML format.
-
FILE: Define the path to the file that contains the job definition in URI format.
Example
/opt/k8s/job.json
The file should be stored in the Agent machine.
-
SCM: Define the URL of the SCM.
If the SCM is password-protected, make sure you have an SCM Connection object with the relevant connection data in place, seeSCM Connection Object.
-
-
SCM Connection (Only available if the SCM job definition type is selected)
Select the SCM Connection object containing the relevant connection data.
To search for a Connection object, start typing its name to limit the list of the objects that match your input.
-
Variables
Define the list of substitution variables to replace in the K8s job definition.
Make sure you define the list using a JSON-formatted object of key-value pairs ({"$VAR1":"value 1","VAR2":"value 2"}).
If this field is left empty, then no values are replaced in the job definition. If there are variables defined but they do not exist in the job definition, the system skips the replacement and continues processing.
The JSON payload is displayed in the Object Variables section of the Details pane, which provides information about the task execution, see Monitoring K8s Jobs.
-
Cleanup
Select this checkbox if you want to delete the job after its completion.
The Pre-Process page allows you to define the settings of all K8s Jobs using script statements. These statements are processed before the Schedule Job is executed, see Setting Kubernetes Job Properties Through Scripts.
See also: