# 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="/files/182ibkp6LCpI1Y82MyEe" 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](/guidance-for-individual/cloudeka-api-list/global-flags.md). 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.                             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudeka.ai/guidance-for-individual/cloudeka-api-list/command-reference/cldkctl-describe/statefulset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
