Create job ΒΆ
This how-to guide will show you how to create a Nais manifest for your job.
Setup ΒΆ
Inside your job repository, create a .nais-folder.
bash
cd <MY-JOB>
mkdir .naisCreate a file called job.yaml in the .nais-folder.
bash
touch .nais/job.yamlDefine your job ΒΆ
Below is a basic example of an job manifest.
Add the following content to the file, and insert the appropriate values in the placeholders on the highlighted lines:
.nais/app.yaml
yaml
apiVersion: nais.io/v1
kind: Naisjob
metadata:
labels:
team: <MY-TEAM>
name: <MY-JOB>
namespace: <MY-TEAM>
spec:
schedule: "0 * * * *" # Runs every hour
image: {{image}} # Placeholder variable to be replaced by the CI/CD pipeline
resources:
requests:
cpu: 200m
memory: 128MiThis job manifest will run your code every hour. If you want to run your job only once, you can remove the schedule field.
Related pages ΒΆ
π― Build and deploy your job to Nais.
π Job spec reference.
π Complete job example.