Create a StatefulSet
Deploy stateful applications (databases, message queues, etc.) using a StatefulSet. Each Pod gets a stable network identity and ordered deployment.
Prerequisites
- Target Namespace exists.
- For persistent storage, ensure a PersistentVolume or StorageClass is available.
Step 1. Open the Create form
- In the left menu, select Workloads → StatefulSets.
- Click Create StatefulSet in the top-right corner.
- Select Create as form from the dropdown.
Step 2. Configure the StatefulSet
| Field | Description | Example |
|---|---|---|
| Name | StatefulSet name | mysql |
| Namespace | Target Namespace | default |
| Replicas | Number of Pod replicas | 3 |
| Service Name | Headless Service name (for network identity) | mysql-svc |
Step 3. Configure the Container and Volumes
In the Container section, set the image and port:
| Field | Description | Example |
|---|---|---|
| Image | Container image | mysql:8.0 |
| Container Port | Port the container listens on | 3306 |
| Environment Variables | Key=value pairs | MYSQL_ROOT_PASSWORD=secret |
In the Volume Claim Templates section, configure the PVC template for each Pod:
| Field | Description | Example |
|---|---|---|
| Storage Class | StorageClass to use for the PVC | standard |
| Access Mode | PVC access mode | ReadWriteOnce |
| Storage | Storage capacity | 10Gi |
| Mount Path | Mount path inside the container | /var/lib/mysql |
INFO
PVCs created from Volume Claim Templates are unique per Pod. (e.g., data-mysql-0, data-mysql-1)
Step 4. Create and verify
Click Create.
The StatefulSet is ready when the Ready count in the list matches the configured replica count.
Pod naming convention: [statefulset-name]-0, [statefulset-name]-1, ...