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 Secret template in ConfigFacets is designed to create and manage Kubernetes Secret resources, which are used to store and manage sensitive information, such as passwords, OAuth tokens, and ssh keys.
Key aspects of the template design:
- Modularity: The template is divided into multiple sections, each with its own facet. This allows for flexible configuration of different Secret aspects. For example:
{
"type": "{{ __SECRET_ID__.type }}",
"facets": [
"addon:type"
]
}
- Core Metadata: The basic Secret metadata is included in the "master" facet:
{
"kind": "Secret",
"facets": [
"master"
],
"metadata": "{{ __SECRET_ID__.metadata }}",
"apiVersion": "v1"
}
- Support for Different Data Types: The template includes separate facets for base64-encoded data and string data:
{
"data": "{{ __SECRET_ID__.data }}",
"facets": [
"addon:data"
]
},
{
"stringData": "{{ __SECRET_ID__.stringData }}",
"facets": [
"addon:stringdata"
]
}
This allows users to input secret data in their preferred format.
- Secret Type Specification: A separate facet for the secret type allows for creating different kinds of secrets (e.g., Opaque, kubernetes.io/tls):
{
"type": "{{ __SECRET_ID__.type }}",
"facets": [
"addon:type"
]
}
- Immutability Option: The template includes a facet for setting the Secret as immutable
{
"immutable": "{{ __SECRET_ID__.immutable }}",
"facets": [
"addon:immutable"
]
}
Flexibility: The use of the
variable allows for dynamic population of all Secret fields.__SECRET_ID__
Extensibility: The facet-based approach allows for easy addition of new Secret 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/secret/exec?format=json" -d '{"facets":["master","addon:type","addon:data"],"values":{"basic_secret":{"data":{"password":"MWYyZDFlMmU2N2Rm","username":"YWRtaW4="},"type":"Opaque","metadata":{"name":"mysecret"}}},"globalvars":{"__SECRET_ID__":"basic_secret"}}' | kubectl apply -f -