Repositories
v1v
Published by: Kubernetes0Updated

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.

v1
configmap
persistentvolume
persistentvolumeclaim
|

Authentication

Add API authentication details

HEADERS
X-APIKEY
string
Send X-APIKEY in Header

Readme

User instructions for this resource

The StorageClass template in ConfigFacets is designed to create and manage Kubernetes StorageClass resources, which define the characteristics of storage that can be dynamically provisioned.

Key aspects of the template design

  1. Modularity: The template is divided into multiple sections, each with its own facet, allowing for flexible configuration of different StorageClass aspects. For example:
{
    "provisioner": "{{ __SC_ID__.spec.provisioner }}",
    "facets": [
      "addon:spec", 
      "addon:provisioner"
    ]
}
  1. Core Metadata: The basic StorageClass metadata is included in the master facet
{
  "kind": "StorageClass", 
  "facets":[ 
    "master" 
  ], 
  "metadata":"{{ __SC_ID__.metadata }}", 
  "apiVersion":"storage.k8s.io/v1"
}
  1. Provisioner Specification: A separate facet allows users to specify the provisioner responsible for creating volumes of this class
{
  "provisioner":"{{ __SC_ID__.spec.provisioner }}", 
  "facets":[ 
    "addon:spec", 
    "addon:provisioner"
  ]
}
  1. Parameters: The template includes a facet for additional parameters specific to the provisioner
{
  "parameters":"{{ __SC_ID__.spec.parameters }}", 
  "facets":[ 
    "addon:spec", 
    "addon:parameters"
  ]
}
  1. Reclaim Policy: The reclaim policy determines what happens to the volume when it's released from its claim
{
  "reclaimPolicy":"{{ __SC_ID__.spec.reclaimPolicy }}", 
  "facets":[ 
    "addon:spec", 
    "addon:reclaimpolicy"
  ]
}
  1. Volume Binding Mode: This specifies how volume binding and dynamic provisioning should occur
{
  "volumeBindingMode":"{{ __SC_ID__.spec.volumeBindingMode }}", 
  "facets":[ 
    "addon:spec", 
    "addon:volumebindingmode"
  ]
}
  1. Allow Volume Expansion: This option allows users to expand the size of persistent volumes created from this StorageClass
{
  "allowVolumeExpansion":"{{ __SC_ID__.spec.allowVolumeExpansion }}", 
  "facets":[ 
    "addon:spec", 
    "addon:allowvolumeexpansion"
  ]
}
  1. Flexibility: The use of the __SC_ID__ variable allows for dynamic population of all StorageClass fields.

  2. Extensibility: The facet-based approach allows for easy addition of new features or parameters 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/storageclass/exec?format=json" -d '{"facets":["master","addon:spec"],"values":{"basic_sc":{"metadata":{"name":"standard"},"parameters":{"type":"gp2"},"provisioner":"kubernetes.io/aws-ebs","reclaimPolicy":"Delete","volumeBindingMode":"Immediate","allowVolumeExpansion":true}},"globalvars":{"__SC_ID__":"basic_sc"}}' | kubectl apply -f -
POST/apis/repos/kubernetes/config-and-storage-resources/v1/resources/collections/storageclass/exec
REQUEST
QUERY-STRING PARAMETERS
format
string
No sources available.
API Server https://configfacets.com
API Key
Not set
RESPONSES
No content available.