Job
In Nanocl, a Job
is a list of commands to run.
Unlike a Cargo it aim to stop running.
There is the openapi specification for a JobPartial
used to create a job
:
required | Array of objects (Config) List of container to run |
ImagePullPolicy | string or null Enum: "Never" "Always" "IfNotPresent" Policy for pulling images related to process objects (job, cargo, vm) |
ImagePullSecret | string or null Secret to use when pulling the image |
object Metadata (user defined) | |
Name required | string Name of the job |
Schedule | string or null Schedule of the job (cron) |
Secrets | Array of strings or null Secrets to load as environment variables |
Ttl | integer or null >= 0 Remove the job after (x) seconds after execution |
{- "Name": "string",
- "Secrets": [
- "string"
], - "Metadata": {
- "property1": "string",
- "property2": "string"
}, - "Schedule": "string",
- "Ttl": 0,
- "ImagePullSecret": "string",
- "ImagePullPolicy": "Never",
- "Containers": [
- {
- "Hostname": "string",
- "Domainname": "string",
- "User": "string",
- "AttachStdin": true,
- "AttachStdout": true,
- "AttachStderr": true,
- "ExposedPorts": {
- "property1": { },
- "property2": { }
}, - "Tty": true,
- "OpenStdin": true,
- "StdinOnce": true,
- "Env": [
- "string"
], - "Cmd": [
- "string"
], - "Healthcheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "ArgsEscaped": true,
- "Image": "string",
- "Volumes": {
- "property1": { },
- "property2": { }
}, - "WorkingDir": "string",
- "Entrypoint": [
- "string"
], - "NetworkDisabled": true,
- "MacAddress": "string",
- "OnBuild": [
- "string"
], - "Labels": {
- "property1": "string",
- "property2": "string"
}, - "StopSignal": "string",
- "StopTimeout": 0,
- "Shell": [
- "string"
], - "HostConfig": {
- "CpuShares": 0,
- "Memory": 0,
- "CgroupParent": "string",
- "BlkioWeight": 0,
- "BlkioWeightDevice": [
- {
- "Path": "string",
- "Weight": 0
}
], - "BlkioDeviceReadBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceReadIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "CpuPeriod": 0,
- "CpuQuota": 0,
- "CpuRealtimePeriod": 0,
- "CpuRealtimeRuntime": 0,
- "CpusetCpus": "string",
- "CpusetMems": "string",
- "Devices": [
- {
- "PathOnHost": "string",
- "PathInContainer": "string",
- "CgroupPermissions": "string"
}
], - "DeviceCgroupRules": [
- "string"
], - "DeviceRequests": [
- {
- "Driver": "string",
- "Count": 0,
- "DeviceIDs": [
- "string"
], - "Capabilities": [
- [
- "string"
]
], - "Options": {
- "property1": "string",
- "property2": "string"
}
}
], - "KernelMemoryTCP": 0,
- "MemoryReservation": 0,
- "MemorySwap": 0,
- "MemorySwappiness": 0,
- "NanoCpus": 0,
- "OomKillDisable": true,
- "Init": true,
- "PidsLimit": 0,
- "Ulimits": [
- {
- "Name": "string",
- "Soft": 0,
- "Hard": 0
}
], - "CpuCount": 0,
- "CpuPercent": 0,
- "IOMaximumIOps": 0,
- "IOMaximumBandwidth": 0,
- "Binds": [
- "string"
], - "ContainerIDFile": "string",
- "LogConfig": {
- "Type": "string",
- "Config": {
- "property1": "string",
- "property2": "string"
}
}, - "NetworkMode": "string",
- "PortBindings": {
- "<port/tcp|udp>": [
- {
- "HostPort": "string",
- "HostIp": "string"
}
]
}, - "RestartPolicy": {
- "Name": "EMPTY",
- "MaximumRetryCount": 0
}, - "AutoRemove": true,
- "VolumeDriver": "string",
- "VolumesFrom": [
- "string"
], - "Mounts": [
- {
- "Target": "string",
- "Source": "string",
- "Type": "EMPTY",
- "ReadOnly": true,
- "Consistency": "string",
- "BindOptions": {
- "Propagation": "EMPTY",
- "NonRecursive": true,
- "CreateMountpoint": true,
- "ReadOnlyNonRecursive": true,
- "ReadOnlyForceRecursive": true
}, - "VolumeOptions": {
- "NoCopy": true,
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0
}
}
], - "ConsoleSize": [
- 0
], - "Annotations": {
- "property1": "string",
- "property2": "string"
}, - "CapAdd": [
- "string"
], - "CapDrop": [
- "string"
], - "CgroupnsMode": "EMPTY",
- "Dns": [
- "string"
], - "DnsOptions": [
- "string"
], - "DnsSearch": [
- "string"
], - "ExtraHosts": [
- "string"
], - "GroupAdd": [
- "string"
], - "IpcMode": "string",
- "Cgroup": "string",
- "Links": [
- "string"
], - "OomScoreAdj": 0,
- "PidMode": "string",
- "Privileged": true,
- "PublishAllPorts": true,
- "ReadonlyRootfs": true,
- "SecurityOpt": [
- "string"
], - "StorageOpt": {
- "property1": "string",
- "property2": "string"
}, - "Tmpfs": {
- "property1": "string",
- "property2": "string"
}, - "UTSMode": "string",
- "UsernsMode": "string",
- "ShmSize": 0,
- "Sysctls": {
- "property1": "string",
- "property2": "string"
}, - "Runtime": "string",
- "Isolation": "EMPTY",
- "MaskedPaths": [
- "string"
], - "ReadonlyPaths": [
- "string"
]
}, - "NetworkingConfig": {
- "EndpointsConfig": {
- "property1": {
- "IPAMConfig": {
- "IPv4Address": "string",
- "IPv6Address": "string",
- "LinkLocalIPs": [
- "string"
]
}, - "Links": [
- "string"
], - "MacAddress": "string",
- "Aliases": [
- "string"
], - "NetworkID": "string",
- "EndpointID": "string",
- "Gateway": "string",
- "IPAddress": "string",
- "IPPrefixLen": 0,
- "IPv6Gateway": "string",
- "GlobalIPv6Address": "string",
- "GlobalIPv6PrefixLen": 0,
- "DriverOpts": {
- "property1": "string",
- "property2": "string"
}, - "DNSNames": [
- "string"
]
}, - "property2": {
- "IPAMConfig": {
- "IPv4Address": "string",
- "IPv6Address": "string",
- "LinkLocalIPs": [
- "string"
]
}, - "Links": [
- "string"
], - "MacAddress": "string",
- "Aliases": [
- "string"
], - "NetworkID": "string",
- "EndpointID": "string",
- "Gateway": "string",
- "IPAddress": "string",
- "IPPrefixLen": 0,
- "IPv6Gateway": "string",
- "GlobalIPv6Address": "string",
- "GlobalIPv6PrefixLen": 0,
- "DriverOpts": {
- "property1": "string",
- "property2": "string"
}, - "DNSNames": [
- "string"
]
}
}
}
}
]
}