storage_class#
State module for managing Kubernetes StorageClass.
- async idem_k8s.states.k8s.storage_k8s_io.v1.storage_class.present(hub, ctx, name: str, metadata: Dict, provisioner: str, allow_volume_expansion: bool = True, allowed_topologies: List = None, mount_options: List = None, parameters: Dict = None, reclaim_policy: str = None, volume_binding_mode: str = 'Immediate', resource_id: str = None) Dict[str, Any] [source]#
Create a StorageClass.
- Parameters:
name (str) – An Idem name of the resource.
resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.
allow_volume_expansion (bool, Optional) – AllowVolumeExpansion shows whether the storage class allow volume expand.
allowed_topologies (list, Optional) – 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.
metadata (dict) – Standard object’s metadata. More info: Kubernetes reference
mount_options (list, Optional) – 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.
parameters (dict, Optional) – Parameters holds the parameters for the provisioner that should create volumes of this storage class.
provisioner (str) – Provisioner indicates the type of the provisioner.
reclaim_policy (str, Optional) – Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.
volume_binding_mode (str, Optional) – 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.
- Returns:
Dict[str, Any]
Examples
resource_is_present: k8s.storage_k8s_io.v1.storage_class.present: - name: storage_class_1 - allow_volume_expansion: true - allowed_topologies: - match_label_expressions: - key: "failure-domain.beta.kubernetes.io/zone" values: ["us-west-2a"] - metadata: name: "storage_class_1" - mount_options: ["soft"] - parameters: type: "gp2" iopsPerGB: "10" - provisioner: "kubernetes.io/aws-ebs" - reclaim_policy: "Retain" - volume_binding_mode: "WaitForFirstConsumer"
- async idem_k8s.states.k8s.storage_k8s_io.v1.storage_class.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any] [source]#
Delete a StorageClass.
- Parameters:
- Returns:
Dict[str, Any]
Examples
resource_is_absent: k8s.storage_k8s_io.v1.storage_class.absent: - name: value - resource_id: value
- async idem_k8s.states.k8s.storage_k8s_io.v1.storage_class.describe(hub, ctx) Dict[str, Dict[str, Any]] [source]#
Describe the resource in a way that can be recreated/managed with the corresponding “present” function.
List or watch objects of kind StorageClass.
- Returns:
Dict[str, Dict[str, Any]]
Examples
$ idem describe k8s.storage_k8s_io.v1.storage_class