Volumes
Argo Workflows allows you to mount volumes from many different sources. Hera provides wrappper classes for all of the first-party Kubernetes volumes (such as Volume and EmptyDirVolume), as well as third-party volumes (such as CinderVolume).
The hera.workflows.volume module provides all Argo volume types that can be used via Hera.
Volume
Volume represents a basic, dynamic, volume representation.
This Volume cannot only be instantiated to be used for mounting purposes but also for dynamically privisioning
volumes in K8s. When the volume is used a corresponding persistent volume claim is also created on workflow
submission.
Source code in src/hera/workflows/volume.py
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 | |
access_modes
access_modes: List[str | AccessMode] = field(
default_factory=lambda: [read_write_once]
)
AccessMode
A representations of the volume access modes for Kubernetes.
Notes
See: access modes docs for more information.
Source code in src/hera/workflows/volume.py
read_write_many
The volume can be mounted as read-write by many nodes
read_write_once
The volume can be mounted as read-write by a single node. ReadWriteOnce access mode still can allow multiple pods to access the volume when the pods are running on the same node
read_write_once_pod
The volume can be mounted as read-write by a single Pod. Use ReadWriteOncePod access mode if you want to ensure that only one pod across whole cluster can read that PVC or write to it. This is only supported for CSI volumes and Kubernetes version 1.22+.