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 ConfigMap template in ConfigFacets is designed to create and manage Kubernetes ConfigMap resources, which are used to store non-confidential data in key-value pairs.
Key aspects of the template design
- Modularity: The template is divided into multiple sections, each with its own facet:
{
"data": "{{ __CM_ID__.data }}",
"facets": [
"addon:data"
]
}
This allows for flexible configuration of different ConfigMap aspects.
- Core Metadata: The basic ConfigMap metadata is included in the "master" facet:
{
"kind": "ConfigMap",
"facets": [
"master"
],
"metadata": "{{ __CM_ID__.metadata }}",
"apiVersion": "v1"
}
- Support for Binary Data: A separate facet for binary data allows inclusion of non-UTF8 data:
{
"binaryData": "{{ __CM_ID__.binaryData }}",
"facets": [
"addon:binarydata"
]
}
- Immutability Option: The template includes a facet for setting the ConfigMap as immutable:
{
"immutable": "{{ __CM_ID__.immutable }}",
"facets": [
"addon:immutable"
]
}
Flexibility: The use of the
variable allows for dynamic population of all ConfigMap fields.__CM_ID__
Extensibility: The facet-based approach allows for easy addition of new ConfigMap 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/configmap/exec?format=json" -d '{"facets":["master","addon:data"],"values":{"basic_cm":{"data":{"player_initial_lives":"3","ui_properties_file_name":"user-interface.properties"},"metadata":{"name":"game-config"}}},"globalvars":{"__CM_ID__":"basic_cm"}}' | kubectl apply -f -