# statefulset

The describe statefulset command retrieves detailed information about a specific StatefulSet in the Kubernetes cluster. This includes metadata, replica status, persistent volume claims, update strategy, and associated pods.

## Usage

```
cldkctl describe statefulset [name] [flags]
```

## Steps

Follow the steps below to run and view the result of this command:

1. Run the following command in your terminal:

```
./cldkctl describe statefulset [name]
```

2. Replace \[name] with the StatefulSet name you want to inspect.
3. To view the resource name, refer to the corresponding get statefulset section.
4. If the resource is located in a non-default namespace, include the `-n` or `--namespace` flag followed by the namespace name.

```
./cldkctl describe [resource] [name] -n [namespace]
```

5. Once completed successfully, the detailed information about the specified StatefulSet will appear in your terminal. The output includes metadata, specifications, replica count, volume templates, and status.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FWk1WKTSyQ47iwh75JD1k%2Funknown.png?alt=media&#x26;token=43650c15-a152-42f1-a6a4-0241d1423d09" alt=""><figcaption></figcaption></figure>

The following table describes the additional fields specific to the StatefulSet resource.

| Column                                                    | Description                                                                                    |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| spec.replicas                                             | The desired number of pod replicas managed by the StatefulSet.                                 |
| spec.selector                                             | Defines the label selector used to identify pods managed by this StatefulSet.                  |
| spec.template                                             | Describes the pod template for the StatefulSet, including container and volume configurations. |
| spec.template.spec.containers                             | Lists the containers to be deployed within each pod.                                           |
| spec.template.spec.containers.image                       | The container image used by the StatefulSet.                                                   |
| spec.volumeClaimTemplates                                 | Defines templates for dynamically creating PersistentVolumeClaims (PVCs) for each replica.     |
| spec.volumeClaimTemplates.spec.accessModes                | Lists the access modes for the volume.                                                         |
| spec.volumeClaimTemplates.spec.resources.requests.storage | The requested storage size for the volume.                                                     |
| spec.volumeClaimTemplates.spec.storageClassName           | The StorageClass used for dynamically provisioning volumes.                                    |
| spec.updateStrategy                                       | Defines the update strategy used when updating pods.                                           |
| spec.updateStrategy.type                                  | The strategy type.                                                                             |
| spec.persistentVolumeClaimRetentionPolicy                 | Specifies how PVCs are retained when pods are deleted or scaled down.                          |
| spec.persistentVolumeClaimRetentionPolicy.whenDeleted     | Policy applied when StatefulSet pods are deleted.                                              |
| spec.persistentVolumeClaimRetentionPolicy.whenScaled      | Policy applied when StatefulSet replicas are scaled.                                           |
| status.replicas                                           | The number of replicas targeted by the StatefulSet.                                            |
| status.currentReplicas                                    | The number of pods currently created by the StatefulSet.                                       |
| status.updatedReplicas                                    | The number of pods updated to match the current StatefulSet specification.                     |
| status.availableReplicas                                  | The number of pods that are available and ready to serve requests.                             |

## Flags

{% hint style="info" %}
This command supports [global flags](https://docs.cloudeka.ai/cloudeka-api-list/global-flags). Refer to the Global Flags section for details
{% endhint %}

| Flag                                                      | Description                                                                                    |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| spec.replicas                                             | The desired number of pod replicas managed by the StatefulSet.                                 |
| spec.selector                                             | Defines the label selector used to identify pods managed by this StatefulSet.                  |
| spec.template                                             | Describes the pod template for the StatefulSet, including container and volume configurations. |
| spec.template.spec.containers                             | Lists the containers to be deployed within each pod.                                           |
| spec.template.spec.containers.image                       | The container image used by the StatefulSet.                                                   |
| spec.volumeClaimTemplates                                 | Defines templates for dynamically creating PersistentVolumeClaims (PVCs) for each replica.     |
| spec.volumeClaimTemplates.spec.accessModes                | Lists the access modes for the volume.                                                         |
| spec.volumeClaimTemplates.spec.resources.requests.storage | The requested storage size for the volume.                                                     |
| spec.volumeClaimTemplates.spec.storageClassName           | The StorageClass used for dynamically provisioning volumes.                                    |
| spec.updateStrategy                                       | Defines the update strategy used when updating pods.                                           |
| spec.updateStrategy.type                                  | The strategy type.                                                                             |
| spec.persistentVolumeClaimRetentionPolicy                 | Specifies how PVCs are retained when pods are deleted or scaled down.                          |
| spec.persistentVolumeClaimRetentionPolicy.whenDeleted     | Policy applied when StatefulSet pods are deleted.                                              |
| spec.persistentVolumeClaimRetentionPolicy.whenScaled      | Policy applied when StatefulSet replicas are scaled.                                           |
| status.replicas                                           | The number of replicas targeted by the StatefulSet.                                            |
| status.currentReplicas                                    | The number of pods currently created by the StatefulSet.                                       |
| status.updatedReplicas                                    | The number of pods updated to match the current StatefulSet specification.                     |
| status.availableReplicas                                  | The number of pods that are available and ready to serve requests.                             |
