V1PolyaxonCleaner
polyaxon._auxiliaries.cleaner.V1PolyaxonCleaner()
Polyaxon cleaner is a helper job that gets scheduled to clean artifacts when a run is deleted.
Polyaxon CE and Polyaxon Agent are deployed with default values for the cleaner, however if you need to control or update one or several aspects of how the cleaner is scheduled, this guide walks through the possible options.
- Args:
- image: str, optional.
- image_tag: str, optional.
- image_pull_policy: str, optional.
- resources: V1ResourceRequirements, optional.
- node_selector: Dict, optional
- affinity: V1Affinity, optional
- tolerations: List[V1Toleration], optional
- image_pull_secrets: List[str]
YAML usage
cleaner:
image: polyaxon/polyaxon-init
imageTag: v1.x
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "64Mi"
cpu: "50m"
nodeSelector:
foo: bar
Fields
image
The container image to use.
cleaner:
image: polyaxon/polyaxon-init
imageTag
The container image tag to use.
cleaner:
imageTag: dev
imagePullPolicy
The image pull policy to use, it must be a valid policy supported by Kubernetes.
cleaner:
imagePullPolicy: Always
resources
The resources requirements to allocate to the container.
cleaner:
resources:
memory: "64Mi"
cpu: "50m"
nodeSelector
From Kubernetes docs
nodeSelector is the simplest recommended form of node selection constraint. nodeSelector is a field of PodSpec. It specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). The most common usage is one key-value pair.
cleaner:
nodeSelector:
node_label: node_value
affinity
From Kubernetes docs
The affinity/anti-affinity feature, greatly expands the types of constraints you can express.
The affinity to use for scheduling the job.
cleaner:
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
...
tolerations
From Kubernetes docs
Tolerations are applied to pods, and allow (but do not require) the pods to schedule onto nodes with matching taints.
cleaner:
tolerations:
- key: "key"
operator: "Exists"
effect: "NoSchedule"
imagePullSecrets
From Kubernetes docs
ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet.
cleaner:
imagePullSecrets: ['secret1', 'secret2']