Class: CDK8sPlus25::PersistentVolume
- Inherits:
-
Resource
- Object
- Resource
- CDK8sPlus25::PersistentVolume
- Includes:
- IPersistentVolume, IStorage
- Defined in:
- persistent_volume.rb
Overview
A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes.
It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.
Direct Known Subclasses
AwsElasticBlockStorePersistentVolume, AzureDiskPersistentVolume, GCEPersistentDiskPersistentVolume
Class Method Summary collapse
-
.from_persistent_volume_name(scope, id, volume_name) ⇒ CDK8sPlus25::IPersistentVolume
Imports a pv from the cluster as a reference.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#access_modes ⇒ Array<CDK8sPlus25::PersistentVolumeAccessMode>?
Access modes requirement of this claim.
-
#api_group ⇒ String
The group portion of the API version (e.g. "authorization.k8s.io").
-
#api_object ⇒ CDK8s::APIObject
The underlying cdk8s API object.
-
#api_version ⇒ String
The object's API version (e.g. "authorization.k8s.io/v1").
-
#as_api_resource ⇒ CDK8sPlus25::IAPIResource?
Return the IApiResource this object represents.
-
#as_non_api_resource ⇒ String?
Return the non resource url this object represents.
-
#as_volume ⇒ CDK8sPlus25::Volume
Convert the piece of storage into a concrete volume.
-
#bind(claim) ⇒ void
Bind a volume to a specific claim.
-
#claim ⇒ CDK8sPlus25::IPersistentVolumeClaim?
PVC this volume is bound to.
-
#initialize(scope, id, props = nil, &jsii_block) ⇒ PersistentVolume
constructor
A new instance of PersistentVolume.
-
#kind ⇒ String
The object kind (e.g. "Deployment").
- #metadata ⇒ CDK8s::APIObjectMetadataDefinition
-
#mode ⇒ CDK8sPlus25::PersistentVolumeMode
Volume mode of this volume.
-
#mount_options ⇒ Array<String>?
Mount options of this volume.
-
#name ⇒ String
The name of this API object.
-
#node ⇒ Constructs::Node
The tree node.
- #permissions ⇒ CDK8sPlus25::ResourcePermissions
-
#reclaim_policy ⇒ CDK8sPlus25::PersistentVolumeReclaimPolicy
Reclaim policy of this volume.
-
#reserve ⇒ CDK8sPlus25::PersistentVolumeClaim
Reserve a
PersistentVolumeby creating aPersistentVolumeClaimthat is wired to claim this volume. -
#resource_name ⇒ String?
The unique, namespace-global, name of an object inside the Kubernetes cluster.
-
#resource_type ⇒ String
The name of a resource type as it appears in the relevant API endpoint.
-
#storage ⇒ CDK8s::Size?
Storage size of this volume.
-
#storage_class_name ⇒ String?
Storage class this volume belongs to.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props = nil, &jsii_block) ⇒ PersistentVolume
Returns a new instance of PersistentVolume.
19 20 21 22 23 24 25 |
# File 'persistent_volume.rb', line 19 def initialize(scope, id, props = nil, &jsii_block) props = props.is_a?(Hash) ? ::CDK8sPlus25::PersistentVolumeProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, "eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9", "scope") Jsii::Type.check_type(id, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "id") Jsii::Type.check_type(props, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1LlBlcnNpc3RlbnRWb2x1bWVQcm9wcyJ9", "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props, &jsii_block) end |
Class Method Details
.from_persistent_volume_name(scope, id, volume_name) ⇒ CDK8sPlus25::IPersistentVolume
Imports a pv from the cluster as a reference.
62 63 64 65 66 67 |
# File 'persistent_volume.rb', line 62 def self.from_persistent_volume_name(scope, id, volume_name) Jsii::Type.check_type(scope, "eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9", "scope") Jsii::Type.check_type(id, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "id") Jsii::Type.check_type(volume_name, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "volumeName") Jsii::Kernel.instance.call_static("cdk8s-plus-25.PersistentVolume", "fromPersistentVolumeName", [scope, id, volume_name]) end |
.jsii_overridable_methods ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'persistent_volume.rb', line 27 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :api_group => { kind: :property, name: "apiGroup", is_optional: false }, :api_object => { kind: :property, name: "apiObject", is_optional: false }, :api_version => { kind: :property, name: "apiVersion", is_optional: false }, :kind => { kind: :property, name: "kind", is_optional: false }, :metadata => { kind: :property, name: "metadata", is_optional: false }, :name => { kind: :property, name: "name", is_optional: false }, :permissions => { kind: :property, name: "permissions", is_optional: false }, :resource_type => { kind: :property, name: "resourceType", is_optional: false }, :resource_name => { kind: :property, name: "resourceName", is_optional: true }, :mode => { kind: :property, name: "mode", is_optional: false }, :reclaim_policy => { kind: :property, name: "reclaimPolicy", is_optional: false }, :access_modes => { kind: :property, name: "accessModes", is_optional: true }, :claim => { kind: :property, name: "claim", is_optional: true }, :mount_options => { kind: :property, name: "mountOptions", is_optional: true }, :storage => { kind: :property, name: "storage", is_optional: true }, :storage_class_name => { kind: :property, name: "storageClassName", is_optional: true }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :as_api_resource => { kind: :method, name: "asApiResource", is_optional: false }, :as_non_api_resource => { kind: :method, name: "asNonApiResource", is_optional: false }, :as_volume => { kind: :method, name: "asVolume", is_optional: false }, :bind => { kind: :method, name: "bind", is_optional: false }, :reserve => { kind: :method, name: "reserve", is_optional: false }, } end |
Instance Method Details
#access_modes ⇒ Array<CDK8sPlus25::PersistentVolumeAccessMode>?
Access modes requirement of this claim.
155 156 157 |
# File 'persistent_volume.rb', line 155 def access_modes() jsii_get_property("accessModes") end |
#api_group ⇒ String
The group portion of the API version (e.g. "authorization.k8s.io").
79 80 81 |
# File 'persistent_volume.rb', line 79 def api_group() jsii_get_property("apiGroup") end |
#api_object ⇒ CDK8s::APIObject
The underlying cdk8s API object.
87 88 89 |
# File 'persistent_volume.rb', line 87 def api_object() jsii_get_property("apiObject") end |
#api_version ⇒ String
The object's API version (e.g. "authorization.k8s.io/v1").
94 95 96 |
# File 'persistent_volume.rb', line 94 def api_version() jsii_get_property("apiVersion") end |
#as_api_resource ⇒ CDK8sPlus25::IAPIResource?
Return the IApiResource this object represents.
216 217 218 |
# File 'persistent_volume.rb', line 216 def as_api_resource() jsii_call_method("asApiResource", []) end |
#as_non_api_resource ⇒ String?
Return the non resource url this object represents.
223 224 225 |
# File 'persistent_volume.rb', line 223 def as_non_api_resource() jsii_call_method("asNonApiResource", []) end |
#as_volume ⇒ CDK8sPlus25::Volume
Convert the piece of storage into a concrete volume.
230 231 232 |
# File 'persistent_volume.rb', line 230 def as_volume() jsii_call_method("asVolume", []) end |
#bind(claim) ⇒ void
This method returns an undefined value.
Bind a volume to a specific claim.
Note that you must also bind the claim to the volume.
241 242 243 244 |
# File 'persistent_volume.rb', line 241 def bind(claim) Jsii::Type.check_type(claim, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1LklQZXJzaXN0ZW50Vm9sdW1lQ2xhaW0ifQ==", "claim") jsii_call_method("bind", [claim]) end |
#claim ⇒ CDK8sPlus25::IPersistentVolumeClaim?
PVC this volume is bound to.
Undefined means this volume is not yet claimed by any PVC.
165 166 167 |
# File 'persistent_volume.rb', line 165 def claim() jsii_get_property("claim") end |
#kind ⇒ String
The object kind (e.g. "Deployment").
101 102 103 |
# File 'persistent_volume.rb', line 101 def kind() jsii_get_property("kind") end |
#metadata ⇒ CDK8s::APIObjectMetadataDefinition
106 107 108 |
# File 'persistent_volume.rb', line 106 def () jsii_get_property("metadata") end |
#mode ⇒ CDK8sPlus25::PersistentVolumeMode
Volume mode of this volume.
141 142 143 |
# File 'persistent_volume.rb', line 141 def mode() jsii_get_property("mode") end |
#mount_options ⇒ Array<String>?
Mount options of this volume.
172 173 174 |
# File 'persistent_volume.rb', line 172 def () jsii_get_property("mountOptions") end |
#name ⇒ String
The name of this API object.
113 114 115 |
# File 'persistent_volume.rb', line 113 def name() jsii_get_property("name") end |
#node ⇒ Constructs::Node
The tree node.
72 73 74 |
# File 'persistent_volume.rb', line 72 def node() jsii_get_property("node") end |
#permissions ⇒ CDK8sPlus25::ResourcePermissions
118 119 120 |
# File 'persistent_volume.rb', line 118 def () jsii_get_property("permissions") end |
#reclaim_policy ⇒ CDK8sPlus25::PersistentVolumeReclaimPolicy
Reclaim policy of this volume.
148 149 150 |
# File 'persistent_volume.rb', line 148 def reclaim_policy() jsii_get_property("reclaimPolicy") end |
#reserve ⇒ CDK8sPlus25::PersistentVolumeClaim
Reserve a PersistentVolume by creating a PersistentVolumeClaim that is wired to claim this volume.
Note that this method will throw in case the volume is already claimed.
252 253 254 |
# File 'persistent_volume.rb', line 252 def reserve() jsii_call_method("reserve", []) end |
#resource_name ⇒ String?
The unique, namespace-global, name of an object inside the Kubernetes cluster.
If this is omitted, the ApiResource should represent all objects of the given type.
134 135 136 |
# File 'persistent_volume.rb', line 134 def resource_name() jsii_get_property("resourceName") end |
#resource_type ⇒ String
The name of a resource type as it appears in the relevant API endpoint.
125 126 127 |
# File 'persistent_volume.rb', line 125 def resource_type() jsii_get_property("resourceType") end |
#storage ⇒ CDK8s::Size?
Storage size of this volume.
179 180 181 |
# File 'persistent_volume.rb', line 179 def storage() jsii_get_property("storage") end |
#storage_class_name ⇒ String?
Storage class this volume belongs to.
186 187 188 |
# File 'persistent_volume.rb', line 186 def storage_class_name() jsii_get_property("storageClassName") end |
#to_string ⇒ String
Returns a string representation of this construct.
193 194 195 |
# File 'persistent_volume.rb', line 193 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
206 207 208 209 210 211 |
# File 'persistent_volume.rb', line 206 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, "eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9", "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |