turbot/kubernetes
GitHub
steampipe plugin install kubernetessteampipe plugin install kubernetes

Table: kubernetes_storage_class - Query Kubernetes Storage Classes using SQL

A Storage Class in Kubernetes is a way to describe different types of storage that are available in a Kubernetes cluster. Storage Classes are used to dynamically provision storage, based on the class of storage requested by a Persistent Volume Claim. They are essential for managing storage resources and ensuring that the right type of storage is available for different workloads.

Table Usage Guide

The kubernetes_storage_class table provides insights into the Storage Classes within a Kubernetes cluster. As a Kubernetes administrator, you can explore details about each Storage Class through this table, including the provisioner, reclaim policy, and volume binding mode. Utilize it to manage and optimize storage resources in your cluster, ensuring that the right type of storage is available for different workloads.

Examples

Basic Info

Explore which storage classes are available in your Kubernetes environment, including their provisioners, reclaim policies, and mount options. This can be useful to understand how your storage resources are configured and managed.

select
name,
provisioner,
reclaim_policy,
parameters,
mount_options
from
kubernetes_storage_class;
select
name,
provisioner,
reclaim_policy,
parameters,
mount_options
from
kubernetes_storage_class;

List storage classes that don't allow volume expansion

Explore which storage classes in a Kubernetes environment do not support volume expansion. This is useful for identifying potential storage limitations in your system.

select
name,
allow_volume_expansion,
provisioner,
reclaim_policy,
parameters,
mount_options
from
kubernetes_storage_class
where
not allow_volume_expansion;
select
name,
allow_volume_expansion,
provisioner,
reclaim_policy,
parameters,
mount_options
from
kubernetes_storage_class
where
allow_volume_expansion = 0;

List storage classes with immediate volume binding mode enabled

Explore which storage classes have immediate volume binding mode enabled. This is beneficial for understanding the storage configurations that allow immediate access to volumes, which can be crucial for certain applications and workloads.

select
name,
allow_volume_expansion,
provisioner,
reclaim_policy,
volume_binding_mode
from
kubernetes_storage_class
where
volume_binding_mode = 'Immediate';
select
name,
allow_volume_expansion,
provisioner,
reclaim_policy,
volume_binding_mode
from
kubernetes_storage_class
where
volume_binding_mode = 'Immediate';

List manifest resources

Explore the configuration of storage classes in a Kubernetes environment to understand which ones have defined paths for storing data. This is useful in identifying potential storage optimization opportunities or troubleshooting storage-related issues.

select
name,
provisioner,
reclaim_policy,
parameters,
mount_options,
path
from
kubernetes_storage_class
where
path is not null;
select
name,
provisioner,
reclaim_policy,
parameters,
mount_options,
path
from
kubernetes_storage_class
where
path is not null;

Schema for kubernetes_storage_class

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
allow_volume_expansionbooleanAllowVolumeExpansion shows whether the storage class allows volume expand.
allowed_topologiesjsonbRestrict the node topologies where volumes can be dynamically provisioned. Each volume plugin defines its own supported topology specifications. An empty TopologySelectorTerm list means there is no topology restriction.
annotationsjsonbAnnotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
context_nametextKubectl config context name.
creation_timestamptimestamp with time zoneCreationTimestamp is a timestamp representing the server time when this object was created.
deletion_grace_period_secondsbigintNumber of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set.
deletion_timestamptimestamp with time zoneDeletionTimestamp is RFC 3339 date and time at which this resource will be deleted.
end_linebigintThe path to the manifest file.
finalizersjsonbMust be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.
generate_nametextGenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided.
generationbigintA sequence number representing a specific generation of the desired state.
labelsjsonbMap of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services.
mount_optionsjsonbDynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. ['ro', 'soft']. Not validated - mount of the PVs will simply fail if one is invalid.
nametextName of the object. Name must be unique within a namespace.
namespacetextNamespace defines the space within which each name must be unique.
owner_referencesjsonbList of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.
parametersjsonbParameters holds the parameters for the provisioner that should create volumes of this storage class.
pathtextThe path to the manifest file.
provisionertextProvisioner indicates the type of the provisioner.
reclaim_policytextDynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.
resource_versiontextAn opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed.
source_typetextThe source of the resource. Possible values are: deployed and manifest. If the resource is fetched from the spec file the value will be manifest.
start_linebigintThe path to the manifest file.
titletextTitle of the resource.
uidtextUID is the unique in time and space value for this object.
volume_binding_modetextVolumeBindingMode indicates how PersistentVolumeClaims should be provisioned and bound. When unset, VolumeBindingImmediate is used. This field is only honored by servers that enable the VolumeScheduling feature.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- kubernetes

You can pass the configuration to the command with the --config argument:

steampipe_export_kubernetes --config '<your_config>' kubernetes_storage_class