Resource Definitions
Driver
Capability
Flavor
Resource Type
Volumes
This section contains Resource Definitions examples for handling Kubernetes
Volumes
by using the
volume-pvc
Driver. If you have special requirements for your PersistentVolume
implementation, you can
see this other example using the template
Driver
.
You can find a Score file example using the volume
resource type
here
.
Resource Definitions #
volume-ebs.yaml
(
view on GitHub
)
:
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
id: volume-ebs
entity:
type: volume
driver_type: humanitec/volume-pvc
name: volume-ebs
driver_inputs:
values:
access_modes: ReadWriteOnce
capacity: 5Gi
storage_class_name: ebs-sc
criteria:
- class: ebs
volume-pvc.yaml
(
view on GitHub
)
:
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
id: volume-pvc
entity:
type: volume
driver_type: humanitec/volume-pvc
name: volume-pvc
driver_inputs:
values:
access_modes: ReadWriteOnce
capacity: 10Gi
criteria:
- {}
volume-ebs.tf
(
view on GitHub
)
:
resource "humanitec_resource_definition" "volume-ebs" {
driver_type = "humanitec/volume-pvc"
id = "volume-ebs"
name = "volume-ebs"
type = "volume"
driver_inputs = {
values_string = jsonencode({
"access_modes" = "ReadWriteOnce"
"capacity" = "5Gi"
"storage_class_name" = "ebs-sc"
})
}
}
resource "humanitec_resource_definition_criteria" "volume-ebs_criteria_0" {
resource_definition_id = resource.humanitec_resource_definition.volume-ebs.id
class = "ebs"
}
volume-pvc.tf
(
view on GitHub
)
:
resource "humanitec_resource_definition" "volume-pvc" {
driver_type = "humanitec/volume-pvc"
id = "volume-pvc"
name = "volume-pvc"
type = "volume"
driver_inputs = {
values_string = jsonencode({
"access_modes" = "ReadWriteOnce"
"capacity" = "10Gi"
})
}
}
resource "humanitec_resource_definition_criteria" "volume-pvc_criteria_0" {
resource_definition_id = resource.humanitec_resource_definition.volume-pvc.id
}