avionix.kube.storage¶
-
class
avionix.kube.storage.CSIDriver(metadata, spec, api_version=None)¶ - Parameters
metadata (
ObjectMeta) – Standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata # noqaspec (
CSIDriverSpec) – Specification of the CSI Driver.api_version (
Optional[str]) – APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa
-
class
avionix.kube.storage.CSIDriverSpec(attach_required=None, volume_lifecycle_modes=None, pod_info_on_mount=None)¶ - Parameters
attach_required (
Optional[bool]) – attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called.volume_lifecycle_modes (
Optional[List[str]]) – volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is “Persistent”, which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is “Ephemeral”. In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future. This field is beta.pod_info_on_mount (
Optional[bool]) – If set to true, podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeConext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. “csi.storage.k8s.io/pod.name”: pod.Name “csi.storage.k8s.io/pod.namespace”: pod.Namespace “csi.storage.k8s.io/pod.uid”: string(pod.UID) “csi.storage.k8s.io/ephemeral”: “true” iff the volume is an ephemeral inline volume defined by a CSIVolumeSource, otherwise “false” “csi.storage.k8s.io/ephemeral” is a new feature in Kubernetes 1.16. It is only required for drivers which support both the “Persistent” and “Ephemeral” VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn’t support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.
-
class
avionix.kube.storage.CSINode(metadata, spec, api_version=None)¶ - Parameters
metadata (
ObjectMeta) – metadata.name must be the Kubernetes node name.spec (
CSINodeSpec) – spec is the specification of CSINodeapi_version (
Optional[str]) – APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa
-
class
avionix.kube.storage.CSINodeDriver(name, node_id, allocatable=None, topology_keys=None)¶ - Parameters
name (
str) – This is the name of the CSI driver that this object refers to. This MUST be the same name returned by the CSI GetPluginName() call for that driver.node_id (
str) – nodeID of the node from the driver point of view. This field enables Kubernetes to communicate with storage systems that do not share the same nomenclature for nodes. For example, Kubernetes may refer to a given node as “node1”, but the storage system may refer to the same node as “nodeA”. When Kubernetes issues a command to the storage system to attach a volume to a specific node, it can use this field to refer to the node name using the ID that the storage system will understand, e.g. “nodeA” instead of “node1”. This field is required.allocatable (
Optional[VolumeNodeResources]) – allocatable represents the volume resources of a node that are available for scheduling. This field is beta.topology_keys (
Optional[List[str]]) – topologyKeys is the list of keys supported by the driver. When a driver is initialized on a cluster, it provides a set of topology keys that it understands (e.g. “company.com/zone”, “company.com/region”). When a driver is initialized on a node, it provides the same topology keys along with values. Kubelet will expose these topology keys as labels on its own node object. When Kubernetes does topology aware provisioning, it can use this list to determine which labels it should retrieve from the node object and pass back to the driver. It is possible for different nodes to use different topology keys. This can be empty if driver does not support topology.
-
class
avionix.kube.storage.CSINodeSpec(drivers)¶ - Parameters
drivers (
List[CSINodeDriver]) – drivers is a list of information of all CSI Drivers existing on a node. If all drivers in the list are uninstalled, this can become empty.
-
class
avionix.kube.storage.StorageClass(metadata, provisioner, allow_volume_expansion=None, allowed_topologies=None, parameters=None, volume_binding_mode=None, mount_options=None, reclaim_policy=None, api_version=None)¶ - Parameters
metadata (
ObjectMeta) – Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata # noqaprovisioner (
str) – Provisioner indicates the type of the provisioner.allow_volume_expansion (
Optional[bool]) – AllowVolumeExpansion shows whether the storage class allow volume expandallowed_topologies (
Optional[List[TopologySelectorTerm]]) – Restrict the node topologies where volumes can be dynamically provisioned. Each volume plugin defines its own supported topology specifications. An empty TopologySelectorTerm list means there is no topology restriction. This field is only honored by servers that enable the VolumeScheduling feature.parameters (
Optional[dict]) – Parameters holds the parameters for the provisioner that should create volumes of this storage class.volume_binding_mode (
Optional[str]) – VolumeBindingMode indicates how PersistentVolumeClaims should be provisioned and bound. When unset, VolumeBindingImmediate is used. This field is only honored by servers that enable the VolumeScheduling feature.mount_options (
Optional[List[str]]) – Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. [“ro”, “soft”]. Not validated - mount of the PVs will simply fail if one is invalid.reclaim_policy (
Optional[str]) – Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.api_version (
Optional[str]) – APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa
-
class
avionix.kube.storage.VolumeAttachment(metadata, spec, api_version=None)¶ - Parameters
metadata (
ObjectMeta) – Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata # noqaspec (
VolumeAttachmentSpec) – Specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.api_version (
Optional[str]) – APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa
-
class
avionix.kube.storage.VolumeAttachmentSource(inline_volume_spec=None, persistent_volume_name=None)¶ - Parameters
inline_volume_spec (
Optional[PersistentVolumeSpec]) – inlineVolumeSpec contains all the information necessary to attach a persistent volume defined by a pod’s inline VolumeSource. This field is populated only for the CSIMigration feature. It contains translated fields from a pod’s inline VolumeSource to a PersistentVolumeSpec. This field is alpha-level and is only honored by servers that enabled the CSIMigration feature.persistent_volume_name (
Optional[str]) – Name of the persistent volume to attach.
-
class
avionix.kube.storage.VolumeAttachmentSpec(attacher, source, node_name)¶ - Parameters
attacher (
str) – Attacher indicates the name of the volume driver that MUST handle this request. This is the name returned by GetPluginName().source (
VolumeAttachmentSource) – Source represents the volume that should be attached.node_name (
str) – The node that the volume should be attached to.
-
class
avionix.kube.storage.VolumeNodeResources(count)¶ - Parameters
count (
int) – Maximum number of unique volumes managed by the CSI driver that can be used on a node. A volume that is both attached and mounted on a node is considered to be used once, not twice. The same rule applies for a unique volume that is shared among multiple pods on the same node. If this field is not specified, then the supported number of volumes on this node is unbounded.