Config and Storage Resources - v1 provides a comprehensive suite of templates for Kubernetes configuration and storage resources, including PersistentVolume, PersistentVolumeClaim, ConfigMap, Secret, and StorageClass. These templates enable efficient management of persistent storage and configuration data within clusters.
Authentication
Add API authentication details
Readme
User instructions for this resource
The PersistentVolumeClaim (PVC) template in ConfigFacets is designed to create and manage Kubernetes PVC resources, which are requests for storage by users.
Key aspects of the template design
- Modularity: The template is divided into multiple sections, each with its own facet, allowing for flexible configuration of different PVC aspects. For example:
{
"spec": {
"storageClassName": "{{ __PVC_ID__.spec.storageClassName }}"
},
"facets": [
"addon:spec",
"addon:storageclass"
]
}
- Core Specifications: The basic PVC specifications (resources, access modes) are included in the main "addon:spec" facet:
{
"spec": {
"resources": {
"requests": {
"storage": "{{ __PVC_ID__.spec.resources.requests.storage }}"
}
},
"accessModes": "{{ __PVC_ID__.spec.accessModes }}"
},
"facets": [
"addon:spec"
]
}
- Volume Mode Support: A separate facet for volume mode allows specification of block or filesystem volume type:
{
"spec": {
"volumeMode": "{{ __PVC_ID__.spec.volumeMode }}"
},
"facets": [
"addon:spec",
"addon:volumemode"
]
}
- Selector and Volume Name: The template includes facets for selecting specific PVs or naming a volume, enabling more control over volume binding:
{
"spec": {
"selector": "{{ __PVC_ID__.spec.selector }}"
},
"facets": [
"addon:spec",
"addon:selector"
]
},
{
"spec": {
"volumeName": "{{ __PVC_ID__.spec.volumeName }}"
},
"facets": [
"addon:spec",
"addon:volumename"
]
}
- Data Source Support: A facet for specifying a data source allows for creating PVCs from snapshots or other PVCs:
{
"spec": {
"dataSource": "{{ __PVC_ID__.spec.dataSource }}"
},
"facets": [
"addon:spec",
"addon:datasource"
]
}
Flexibility: The use of the
variable allows for dynamic population of all PersistentVolumeClaim fields.__PVC_ID__
Extensibility: The facet-based approach allows for easy addition of new PVC features in future Kubernetes versions.
Examples
Check Request Body tab section to play around with interactive examples.
Install(
)Example
The Curl tab in the request section below provides the curl command for your resource.
curl -s -X POST "https://configfacets.com/apis/repos/kubernetes/config-and-storage-resources/v1/resources/collections/persistent-volume-claim/exec?format=json" -d '{"facets":["master","addon:spec","addon:storageclass"],"values":{"basic_pvc":{"spec":{"resources":{"requests":{"storage":"8Gi"}},"accessModes":["ReadWriteOnce"],"storageClassName":"standard"},"metadata":{"name":"myclaim"}}},"globalvars":{"__PVC_ID__":"basic_pvc"}}' | kubectl apply -f -