pod
The pod directive defines pod-specific settings, such as environment variables, secrets, and config maps, when using the Kubernetes executor.
Usage
For example:
process echo {
pod env: 'MESSAGE', value: 'hello world'
script:
"""
echo $MESSAGE
"""
}
This example defines an environment variable named MESSAGE whose value is 'hello world'.
You can also set it in the Nextflow configuration:
// single setting
process.pod = [env: 'MESSAGE', value: 'hello world']
// multiple settings
process.pod = [
[env: 'MESSAGE', value: 'hello world'],
[secret: 'my-secret/key1', mountPath: '/etc/file.txt']
]
Options
The following options are available: Specifies the pod affinity with the given configuration. Can be specified multiple times Defines a pod annotation with the given name and value. Specifies whether to automount the service account token into the pod (default: Can be specified multiple times Mounts a ConfigMap with name and optional key to the given path. If the key is omitted, the path is interpreted as a directory and all entries in the Can be specified multiple times Mounts a CSI ephemeral volume with the given configuration to the given path. Can be specified multiple times Mounts an emptyDir with the given configuration to the given path. Can be specified multiple times Defines an environment variable whose value is defined by the given ConfigMap and key. Can be specified multiple times Defines an environment variable whose value is defined by the given field path value. For example, the following pod option: Maps to the following pod spec: Can be specified multiple times Defines an environment variable whose value is defined by the given Secret and key. Can be specified multiple times Defines an environment variable with the given name and value. Can be specified multiple times Creates a hostPath volume and mounts it at the specified Specifies the image pull policy used by the pod to pull the container image. Specifies the image pull secret used to access a private container image registry. Can be specified multiple times Defines a pod label with the given name and value. Specifies the node selector with the given configuration. The configuration can be a map or a string: Specifies the priority class name for pods. Specifies whether the pod should run as a privileged container (default: Specifies the user ID with which to run the container. Shortcut for the Specifies the runtime class. Specifies which scheduler is used to schedule the container. Can be specified multiple times Mounts a Secret with name and optional key to the given path. If the key is omitted, the path is interpreted as a directory and all entries in the Specifies the pod security context with the given configuration. Can be specified multiple times Specifies the pod toleration with the given configuration. The configuration should be a map corresponding to a single toleration rule. For example, the following pod options: Maps to the following pod spec: Specifies the TTL mechanism for finished jobs in seconds. Applies to both successful and failed jobs. Can be specified multiple times Mounts a Persistent volume claim with the given name to the given path. The The affinity: <config>annotation: '<name>', value: '<value>'automountServiceAccountToken: true | falsetrue).config: '<configMap>/<key>', mountPath: '</absolute/path>'ConfigMap are exposed in that path.csi: '<config>', mountPath: '</absolute/path>'emptyDir: <config>, mountPath: '</absolute/path>'env: '<name>', config: '<configMap>/<key>'env: '<name>', fieldPath: '<fieldPath>'process.pod = [env: 'MY_NODE_NAME', fieldPath: 'spec.nodeName']env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeNameenv: '<name>', secret: '<secret>/<key>'env: '<name>', value: '<value>'hostPath: '/host/absolute/path', mountPath: '</pod/absolute/path>'mountPath in the pod.imagePullPolicy: 'IfNotPresent' | 'Always' | 'Never'imagePullSecret: '<name>'label: '<name>', value: '<value>'nodeSelector: <config>// map
process.pod = [nodeSelector: [disktype: 'ssd', cpu: 'intel']]
// string
process.pod = [nodeSelector: 'disktype=ssd,cpu=intel']priorityClassName: '<name>'privileged: true | falsefalse).runAsUser: '<uid>'securityContext option.runtimeClassName: '<name>'schedulerName: '<name>'secret: '<secret>/<key>', mountPath: '</absolute/path>'Secret are exposed in that path.securityContext: <config>toleration: <config>process.pod = [
[toleration: [key: 'key1', operator: 'Equal', value: 'value1', effect: 'NoSchedule']],
[toleration: [key: 'key1', operator: 'Exists', effect: 'NoSchedule']],
]tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
- key: "key1"
operator: "Exists"
effect: "NoSchedule"ttlSecondsAfterFinishedvolumeClaim: '<name>', mountPath: '</absolute/path>' [, subPath: '<path>', readOnly: true | false]subPath option mounts a sub-directory of the volume instead of its root.readOnly option mounts the volume as read-only (default: false).