StatefulSet is a Kubernetes controller designed to manage stateful applications by orchestrating Pod instances with stable network identities and persistent storage. Within a single application architecture, you may deploy multiple StatefulSets as discrete components to deliver specialized services while maintaining ordered deployment, scaling, and rolling updates.
Obtain the image address. The source of the images can be from the image repository integrated by the platform administrator through the toolchain or from third-party platforms' image repositories.
For the former, the Administrator typically assigns the image repository to your project, and you can use the images within it. If the required image repository is not found, please contact the Administrator for allocation.
If it is a third-party platform's image repository, ensure that images can be pulled directly from it in the current cluster.
Container Platform, navigate to Workloads > StatefulSets in the left sidebar.
Click Create StatefulSet.
Select or Input an image, and click Confirm.
Note: You can filter images by selecting only when using images from the integrated image repository of this platform. For example, the integrated project name such as containers (docker-registry-projectname) includes the project name projectname from this platform and the project name containers from the image repository.
In the Basic Info section, configure declarative parameters for Deployment workloads:
Parameters | Description |
---|---|
Replicas | Defines the desired number of Pod replicas in the Deployment (default: 1 ). Adjust based on workload requirements. Please set this according to the actual business request volume. |
Update Strategy | Controls phased updates in StatefulSet rolling updates: 1. Partition Value:
|
Volume Claim Templates | volumeClaimTemplates is a critical feature of StatefulSets that enables dynamic per-Pod persistent storage provisioning. Each Pod replica in a StatefulSet automatically gets its own dedicated PersistentVolumeClaim (PVC) based on predefined templates.1. Dynamic PVC Creation: Automatically creates unique PVCs for each Pod:
storageClassName :
resources.requests.storage :
|
In the Pod section, please refer to Creating Deployment - Configure Pod
In the Container section, please refer to Creating Deployment - Configure Containers
Click Create.