doc-exports/docs/cce/umn/cce_bestpractice_0107.html
Dong, Qiu Jian 86fb05065f CCE UMN for 24.2.0 version -20240428
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
2024-06-10 08:19:07 +00:00

646 lines
60 KiB
HTML

<a name="cce_bestpractice_0107"></a><a name="cce_bestpractice_0107"></a>
<h1 class="topictitle1">How Do I Change the Storage Class Used by a Cluster of v1.15 from FlexVolume to CSI Everest?</h1>
<div id="body1603175011039"><p id="cce_bestpractice_0107__p148301338132712">In clusters later than v1.15.11-r1, CSI (the everest add-on) has taken over all functions of fuxi FlexVolume (the storage-driver add-on) for managing container storage. You are advised to use CSI Everest.</p>
<p id="cce_bestpractice_0107__p1556618195217">To migrate your storage volumes, create a static PV to associate with the original underlying storage, and then create a PVC to associate with this static PV. When you upgrade your application, mount the new PVC to the original mounting path to migrate the storage volumes.</p>
<div class="warning" id="cce_bestpractice_0107__note589874414375"><span class="warningtitle"><img src="public_sys-resources/warning_3.0-en-us.png"> </span><div class="warningbody"><p id="cce_bestpractice_0107__p1189834410374">Services will be interrupted during the migration. Therefore, properly plan the migration and back up data.</p>
</div></div>
<div class="section" id="cce_bestpractice_0107__section1914417445277"><h4 class="sectiontitle">Procedure</h4><ol id="cce_bestpractice_0107__ol1119842011254"><li id="cce_bestpractice_0107__li39059101273"><span>(Optional) Back up data to prevent data loss in case of exceptions.</span></li><li id="cce_bestpractice_0107__li1219802032512"><a name="cce_bestpractice_0107__li1219802032512"></a><a name="li1219802032512"></a><span>Configure a YAML file of the PV in the CSI format according to the PV in the FlexVolume format and associate the PV with the existing storage.</span><p><p id="cce_bestpractice_0107__p10956144914562">To be specific, run the following commands to configure the pv-example.yaml file, which is used to create a PV. </p>
<p id="cce_bestpractice_0107__p16647121665720"><strong id="cce_bestpractice_0107__b20159165101615">touch pv-example.yaml</strong></p>
<p id="cce_bestpractice_0107__p166474161573"><strong id="cce_bestpractice_0107__b520305161611">vi pv-example.yaml</strong></p>
<div class="p" id="cce_bestpractice_0107__p10409104995614">Configuration example of <strong id="cce_bestpractice_0107__b13988223541">a PV for an EVS volume</strong>:<pre class="screen" id="cce_bestpractice_0107__screen124093496566">apiVersion: v1
kind: PersistentVolume
metadata:
labels:
<strong id="cce_bestpractice_0107__b12131375441">failure-domain.beta.kubernetes.io/region: </strong><span id="cce_bestpractice_0107__text6728433172218">eu-de</span>
<strong id="cce_bestpractice_0107__b16216133724416"> failure-domain.beta.kubernetes.io/zone: &lt;zone name&gt;</strong>
annotations:
pv.kubernetes.io/provisioned-by: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b050631184419">name: </strong><strong id="cce_bestpractice_0107__b105123134415">pv-evs-example</strong>
spec:
accessModes:
- ReadWriteOnce
capacity:
<strong id="cce_bestpractice_0107__b1916712269445">storage: </strong><strong id="cce_bestpractice_0107__b15172162617446">10Gi</strong>
csi:
driver: disk.csi.everest.io
fsType: ext4
volumeAttributes:
<strong id="cce_bestpractice_0107__b771412711482">everest.io/disk-mode: </strong><strong id="cce_bestpractice_0107__b3715107184817">SCSI</strong>
<strong id="cce_bestpractice_0107__b57196714812"> everest.io/disk-volume-type: SAS</strong>
storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b915010138486">volumeHandle: </strong><strong id="cce_bestpractice_0107__b5151201318488">0992dbda-6340-470e-a74e-4f0db288ed82</strong>
persistentVolumeReclaimPolicy: Delete
storageClassName: csi-disk</pre>
</div>
<p id="cce_bestpractice_0107__p19607165215128"></p>
<p id="cce_bestpractice_0107__p54091549175616">Pay attention to the fields in bold and red. The parameters are described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0107__table1819001615355" frame="border" border="1" rules="all"><caption><b>Table 1 </b>EVS volume configuration parameters</caption><thead align="left"><tr id="cce_bestpractice_0107__row1519121663519"><th align="left" class="cellrowborder" valign="top" width="26.1%" id="mcps1.3.4.2.2.2.7.2.3.1.1"><p id="cce_bestpractice_0107__p18191161619356">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="73.9%" id="mcps1.3.4.2.2.2.7.2.3.1.2"><p id="cce_bestpractice_0107__p1919116161353">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_bestpractice_0107__row2318123021219"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p1995180962">failure-domain.beta.kubernetes.io/region</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p1861300612">Region where the EVS disk is located. Use the same value as that of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row163191830121220"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p168517016619">failure-domain.beta.kubernetes.io/zone</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p12892459355">AZ where the EVS disk is located. Use the same value as that of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row9653154613512"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p166542461356">name</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p126541746357">Name of the PV, which must be unique in the cluster.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row36542464516"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p2065516461655">storage</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p1065544610519">EVS volume capacity in the unit of Gi. Use the value of <strong id="cce_bestpractice_0107__b1144121364514">spec.capacity.storage</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row95681351352"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p115681951655">driver</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p556912511555">Storage driver used to attach the volume. Set the driver to <strong id="cce_bestpractice_0107__b673716182452">disk.csi.everest.io</strong> for the EVS volume.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row856925110517"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p1756925110517">volumeHandle</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p11569175120514">Volume ID of the EVS disk. Use the value of <strong id="cce_bestpractice_0107__b221553434517">spec.flexVolume.options.volumeID</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row19351157557"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p183510571550">everest.io/disk-mode</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p163511571556">EVS disk mode. Use the value of <strong id="cce_bestpractice_0107__b381519478459">spec.flexVolume.options.disk-mode</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row15352571556"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p3357571053">everest.io/disk-volume-type</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p1936105718517">EVS disk type. Use the value of <strong id="cce_bestpractice_0107__b2528131316506">kubernetes.io/volumetype</strong> in the storage class corresponding to <strong id="cce_bestpractice_0107__b1953411395020">spec.storageClassName</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row153610571511"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.7.2.3.1.1 "><p id="cce_bestpractice_0107__p03614576517">storageClassName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.7.2.3.1.2 "><p id="cce_bestpractice_0107__p1436557154">Name of the Kubernetes storage class associated with the storage volume. Set this field to <strong id="cce_bestpractice_0107__b178186575356">csi-disk</strong> for EVS disks.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_bestpractice_0107__p040913499563">Configuration example of <strong id="cce_bestpractice_0107__b9465137161213">a PV for an SFS volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen16410149155610">apiVersion: v1
kind: PersistentVolume
metadata:
<strong id="cce_bestpractice_0107__b20655104515487">name: pv-sfs-example</strong>
annotations:
pv.kubernetes.io/provisioned-by: everest-csi-provisioner
spec:
accessModes:
- ReadWriteMany
capacity:
<strong id="cce_bestpractice_0107__b10446115017484">storage: </strong><strong id="cce_bestpractice_0107__b11448135010480">10Gi</strong>
csi:
driver: nas.csi.everest.io
fsType: nfs
volumeAttributes:
<strong id="cce_bestpractice_0107__b1986810568485">everest.io/share-export-location: # Shared path of the file storage</strong>
storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b5516219497">volumeHandle: 682f00bb-ace0-41d8-9b3e-913c9aa6b695</strong>
persistentVolumeReclaimPolicy: Delete
storageClassName: csi-nas</pre>
<p id="cce_bestpractice_0107__p104042044181220"></p>
<p id="cce_bestpractice_0107__p6410144945614">Pay attention to the fields in bold and red. The parameters are described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0107__table10859183316916" frame="border" border="1" rules="all"><caption><b>Table 2 </b>SFS volume configuration parameters</caption><thead align="left"><tr id="cce_bestpractice_0107__row38591633994"><th align="left" class="cellrowborder" valign="top" width="26.1%" id="mcps1.3.4.2.2.2.12.2.3.1.1"><p id="cce_bestpractice_0107__p1385913337917">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="73.9%" id="mcps1.3.4.2.2.2.12.2.3.1.2"><p id="cce_bestpractice_0107__p3859733090">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_bestpractice_0107__row88591233395"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.12.2.3.1.1 "><p id="cce_bestpractice_0107__p108591533693">name</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.12.2.3.1.2 "><p id="cce_bestpractice_0107__p148592335912">Name of the PV, which must be unique in the cluster.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row158595338918"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.12.2.3.1.1 "><p id="cce_bestpractice_0107__p785919331096">storage</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.12.2.3.1.2 "><p id="cce_bestpractice_0107__p186003319918">File storage size in the unit of Gi. Use the value of <strong id="cce_bestpractice_0107__b4964104616563">spec.capacity.storage</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row48607331494"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.12.2.3.1.1 "><p id="cce_bestpractice_0107__p1686014331913">driver</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.12.2.3.1.2 "><p id="cce_bestpractice_0107__p3860173312917">Storage driver used to attach the volume. Set the driver to <strong id="cce_bestpractice_0107__b67607155715">nas.csi.everest.io</strong> for the file system.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row6808112520114"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.12.2.3.1.1 "><p id="cce_bestpractice_0107__p17809172511117">everest.io/share-export-location</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.12.2.3.1.2 "><p id="cce_bestpractice_0107__p780919259115">Shared path of the file system. Use the value of <strong id="cce_bestpractice_0107__b562915119">spec.flexVolume.options.deviceMountPath</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row78601833094"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.12.2.3.1.1 "><p id="cce_bestpractice_0107__p18601933393">volumeHandle</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.12.2.3.1.2 "><p id="cce_bestpractice_0107__p148602331397">File system ID. Use the value of <strong id="cce_bestpractice_0107__b77331625326">spec.flexVolume.options.volumeID</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row5860143317914"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.12.2.3.1.1 "><p id="cce_bestpractice_0107__p178608331994">storageClassName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.12.2.3.1.2 "><p id="cce_bestpractice_0107__p1786013338917">Name of the Kubernetes storage class. Set this field to <strong id="cce_bestpractice_0107__b384216614366">csi-nas</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_bestpractice_0107__p94101749105619">Configuration example of <strong id="cce_bestpractice_0107__b957014161416">a PV for an OBS volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen341064915612">apiVersion: v1
kind: PersistentVolume
metadata:
<strong id="cce_bestpractice_0107__b19697272497">name: pv-obs-example</strong>
annotations:
pv.kubernetes.io/provisioned-by: everest-csi-provisioner
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 1Gi
csi:
driver: obs.csi.everest.io
<strong id="cce_bestpractice_0107__b64651633194911">fsType: s3fs</strong>
volumeAttributes:
<strong id="cce_bestpractice_0107__b18061377497">everest.io/obs-volume-type: STANDARD</strong>
<strong id="cce_bestpractice_0107__b5807153794916"> everest.io/region: <span id="cce_bestpractice_0107__text13180166132919">eu-de</span></strong>
storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b16316154315491">volumeHandle: obs-normal-static-pv</strong>
persistentVolumeReclaimPolicy: Delete
storageClassName: csi-obs</pre>
<p id="cce_bestpractice_0107__p1541064918566"></p>
<p id="cce_bestpractice_0107__p1763835121210">Pay attention to the fields in bold and red. The parameters are described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0107__table147634352126" frame="border" border="1" rules="all"><caption><b>Table 3 </b>OBS volume configuration parameters</caption><thead align="left"><tr id="cce_bestpractice_0107__row1376383591219"><th align="left" class="cellrowborder" valign="top" width="26.1%" id="mcps1.3.4.2.2.2.17.2.3.1.1"><p id="cce_bestpractice_0107__p187631357122">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="73.9%" id="mcps1.3.4.2.2.2.17.2.3.1.2"><p id="cce_bestpractice_0107__p147631357126">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_bestpractice_0107__row20763935101212"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.17.2.3.1.1 "><p id="cce_bestpractice_0107__p10763335141218">name</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.17.2.3.1.2 "><p id="cce_bestpractice_0107__p1876313352123">Name of the PV, which must be unique in the cluster.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row2763183511126"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.17.2.3.1.1 "><p id="cce_bestpractice_0107__p12763143541213">storage</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.17.2.3.1.2 "><p id="cce_bestpractice_0107__p10763143561217">Storage capacity, in the unit of Gi. Set this parameter to the fixed value <strong id="cce_bestpractice_0107__b69303913316">1Gi</strong>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row17763635161217"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.17.2.3.1.1 "><p id="cce_bestpractice_0107__p12763143516123">driver</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.17.2.3.1.2 "><p id="cce_bestpractice_0107__p476403511217">Storage driver used to attach the volume. Set the driver to <strong id="cce_bestpractice_0107__b1892865020316">obs.csi.everest.io</strong> for the OBS volume.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row87641035151214"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.17.2.3.1.1 "><p id="cce_bestpractice_0107__p2764133531218">fsType</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.17.2.3.1.2 "><p id="cce_bestpractice_0107__p1764163514127">File type. Value options are <strong id="cce_bestpractice_0107__b4774501048">obsfs</strong> or <strong id="cce_bestpractice_0107__b77751001416">s3fs</strong>. If the value is <strong id="cce_bestpractice_0107__b3775701249">s3fs</strong>, an OBS bucket is created and mounted using s3fs. If the value is <strong id="cce_bestpractice_0107__b0775140745">obsfs</strong>, an OBS parallel file system is created and mounted using obsfs. Set this parameter according to the value of <strong id="cce_bestpractice_0107__b182806128410">spec.flexVolume.options.posix</strong> of the FlexVolume PV. If the value of <strong id="cce_bestpractice_0107__b132852121947">spec.flexVolume.options.posix</strong> is <strong id="cce_bestpractice_0107__b42852121541">true</strong>, set this parameter to <strong id="cce_bestpractice_0107__b112862121945">obsfs</strong>. If the value is <strong id="cce_bestpractice_0107__b14286151215418">false</strong>, set this parameter to <strong id="cce_bestpractice_0107__b928615121417">s3fs</strong>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row671295211146"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.17.2.3.1.1 "><p id="cce_bestpractice_0107__p671313522145">everest.io/obs-volume-type</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.17.2.3.1.2 "><p id="cce_bestpractice_0107__p9713452161412">Storage class, including <strong id="cce_bestpractice_0107__b04090199415">STANDARD</strong> (standard bucket) and <strong id="cce_bestpractice_0107__b441491915417">WARM</strong> (infrequent access bucket). Set this parameter according to the value of <strong id="cce_bestpractice_0107__b11614133019416">spec.flexVolume.options.storage_class</strong> of the FlexVolume PV. If the value of <strong id="cce_bestpractice_0107__b261913012414">spec.flexVolume.options.storage_class</strong> is <strong id="cce_bestpractice_0107__b1461913300413">standard</strong>, set this parameter to <strong id="cce_bestpractice_0107__b362010301446">STANDARD</strong>. If the value is <strong id="cce_bestpractice_0107__b962023017412">standard_ia</strong>, set this parameter to <strong id="cce_bestpractice_0107__b1162018301843">WARM</strong>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row1929744911413"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.17.2.3.1.1 "><p id="cce_bestpractice_0107__p7298164941418">everest.io/region</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.17.2.3.1.2 "><p id="cce_bestpractice_0107__p1429844971411">Region where the OBS bucket is located. Use the value of <strong id="cce_bestpractice_0107__b9813625987">spec.flexVolume.options.region</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row19764935181217"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.17.2.3.1.1 "><p id="cce_bestpractice_0107__p476416354129">volumeHandle</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.17.2.3.1.2 "><p id="cce_bestpractice_0107__p1476433581210">OBS bucket name. Use the value of <strong id="cce_bestpractice_0107__b19199334192">spec.flexVolume.options.volumeID</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row197641935171213"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.17.2.3.1.1 "><p id="cce_bestpractice_0107__p576413351125">storageClassName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.17.2.3.1.2 "><p id="cce_bestpractice_0107__p576473510123">Name of the Kubernetes storage class. Set this field to <strong id="cce_bestpractice_0107__b99771619123610">csi-obs</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_bestpractice_0107__p204119497566">Configuration example of <strong id="cce_bestpractice_0107__b47395156165">a PV for an SFS Turbo volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen4411164920568">apiVersion: v1
kind: PersistentVolume
metadata:
<strong id="cce_bestpractice_0107__b151901852174911">name: pv-efs-example</strong>
annotations:
pv.kubernetes.io/provisioned-by: everest-csi-provisioner
spec:
accessModes:
- ReadWriteMany
capacity:
<strong id="cce_bestpractice_0107__b872211561497">storage: 10Gi</strong>
csi:
driver: sfsturbo.csi.everest.io
fsType: nfs
volumeAttributes:
<strong id="cce_bestpractice_0107__b17915122125015">everest.io/share-export-location: 192.168.0.169:/</strong>
storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b16810197175014">volumeHandle: 8962a2a2-a583-4b7f-bb74-fe76712d8414</strong>
persistentVolumeReclaimPolicy: Delete
storageClassName: csi-sfsturbo</pre>
<p id="cce_bestpractice_0107__p8391138132018"></p>
<p id="cce_bestpractice_0107__p85884120207">Pay attention to the fields in bold and red. The parameters are described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0107__table7581741152015" frame="border" border="1" rules="all"><caption><b>Table 4 </b>SFS Turbo volume configuration parameters</caption><thead align="left"><tr id="cce_bestpractice_0107__row2058124162013"><th align="left" class="cellrowborder" valign="top" width="26.1%" id="mcps1.3.4.2.2.2.22.2.3.1.1"><p id="cce_bestpractice_0107__p13591241202019">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="73.9%" id="mcps1.3.4.2.2.2.22.2.3.1.2"><p id="cce_bestpractice_0107__p1859204152010">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_bestpractice_0107__row185944110206"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.22.2.3.1.1 "><p id="cce_bestpractice_0107__p185919415209">name</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.22.2.3.1.2 "><p id="cce_bestpractice_0107__p1259144113208">Name of the PV, which must be unique in the cluster.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row1459141112011"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.22.2.3.1.1 "><p id="cce_bestpractice_0107__p13592417202">storage</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.22.2.3.1.2 "><p id="cce_bestpractice_0107__p2059174162015">File system size. Use the value of <strong id="cce_bestpractice_0107__b7973528131212">spec.capacity.storage</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row8597411207"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.22.2.3.1.1 "><p id="cce_bestpractice_0107__p9591841152015">driver</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.22.2.3.1.2 "><p id="cce_bestpractice_0107__p16595418201">Storage driver used to attach the volume. Set it to <strong id="cce_bestpractice_0107__b028711355126">sfsturbo.csi.everest.io</strong>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row1601741132014"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.22.2.3.1.1 "><p id="cce_bestpractice_0107__p10883193912218">everest.io/share-export-location</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.22.2.3.1.2 "><p id="cce_bestpractice_0107__p4882153911226">Shared path of the SFS Turbo volume. Use the value of <strong id="cce_bestpractice_0107__b256734911217">spec.flexVolume.options.deviceMountPath</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row176012417202"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.22.2.3.1.1 "><p id="cce_bestpractice_0107__p11881839112219">volumeHandle</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.22.2.3.1.2 "><p id="cce_bestpractice_0107__p288013962213">SFS Turbo volume ID. Use the value of <strong id="cce_bestpractice_0107__b1819716572124">spec.flexVolume.options.volumeID</strong> of the FlexVolume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row12603415203"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.2.2.22.2.3.1.1 "><p id="cce_bestpractice_0107__p11879153915225">storageClassName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.2.2.22.2.3.1.2 "><p id="cce_bestpractice_0107__p19878539112216">Name of the Kubernetes storage class. Set this field to <strong id="cce_bestpractice_0107__b057131163615">csi-sfsturbo</strong> for SFS Turbo volumes.</p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li id="cce_bestpractice_0107__li1710710385418"><a name="cce_bestpractice_0107__li1710710385418"></a><a name="li1710710385418"></a><span>Configure a YAML file of the PVC in the CSI format according to the PVC in the FlexVolume format and associate the PVC with the PV created in <a href="#cce_bestpractice_0107__li1219802032512">2</a>.</span><p><p id="cce_bestpractice_0107__p11528815195819">To be specific, run the following commands to configure the pvc-example.yaml file, which is used to create a PVC. </p>
<p id="cce_bestpractice_0107__p652841585811"><strong id="cce_bestpractice_0107__b136125221717">touch pvc-example.yaml</strong></p>
<p id="cce_bestpractice_0107__p185281515155810"><strong id="cce_bestpractice_0107__b6957522175">vi pvc-example.yaml</strong></p>
<p id="cce_bestpractice_0107__p474941465817">Configuration example of <strong id="cce_bestpractice_0107__b125522619204">a PVC for an EVS volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen874991414586">apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
<strong id="cce_bestpractice_0107__b3970622105017">failure-domain.beta.kubernetes.io/region: <span id="cce_bestpractice_0107__text20432543122320">eu-de</span></strong>
<strong id="cce_bestpractice_0107__b209722222507"> failure-domain.beta.kubernetes.io/zone: &lt;zone name&gt;</strong>
annotations:
<strong id="cce_bestpractice_0107__b37912037155015">everest.io/disk-volume-type: SAS</strong>
volume.beta.kubernetes.io/storage-provisioner: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b161731742165015">name: pvc-evs-example</strong>
<strong id="cce_bestpractice_0107__b61761842205015"> namespace: default</strong>
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
<strong id="cce_bestpractice_0107__b1345115474504">storage: 10Gi</strong>
<strong id="cce_bestpractice_0107__b645811477500"> volumeName: pv-evs-example</strong>
storageClassName: csi-disk</pre>
<p id="cce_bestpractice_0107__p9518267242"></p>
<p id="cce_bestpractice_0107__p3812172815241">Pay attention to the fields in bold and red. The parameters are described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0107__table16812928132411" frame="border" border="1" rules="all"><caption><b>Table 5 </b>PVC configuration parameters for an EVS volume</caption><thead align="left"><tr id="cce_bestpractice_0107__row4813122818245"><th align="left" class="cellrowborder" valign="top" width="26.1%" id="mcps1.3.4.2.3.2.8.2.3.1.1"><p id="cce_bestpractice_0107__p16813112818246">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="73.9%" id="mcps1.3.4.2.3.2.8.2.3.1.2"><p id="cce_bestpractice_0107__p198131028112415">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_bestpractice_0107__row081318282243"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.8.2.3.1.1 "><p id="cce_bestpractice_0107__p1732144516242">failure-domain.beta.kubernetes.io/region</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.8.2.3.1.2 "><p id="cce_bestpractice_0107__p1431974514243">Region where the cluster is located. Use the same value as that of the FlexVolume PVC.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row1581342816246"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.8.2.3.1.1 "><p id="cce_bestpractice_0107__p1631844572420">failure-domain.beta.kubernetes.io/zone</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.8.2.3.1.2 "><p id="cce_bestpractice_0107__p18317184513249">AZ where the EVS disk is deployed. Use the same value as that of the FlexVolume PVC.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row181462811245"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.8.2.3.1.1 "><p id="cce_bestpractice_0107__p133168454241">everest.io/disk-volume-type</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.8.2.3.1.2 "><p id="cce_bestpractice_0107__p0315114552411">Storage class of the EVS disk. The value can be <strong id="cce_bestpractice_0107__b139414107543">SAS</strong> or <strong id="cce_bestpractice_0107__b540051016549">SSD</strong>. Set this parameter to the same value as that of the PV created in <a href="#cce_bestpractice_0107__li1219802032512">2</a>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row681442812241"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.8.2.3.1.1 "><p id="cce_bestpractice_0107__p123141645112413">name</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.8.2.3.1.2 "><p id="cce_bestpractice_0107__p531364572411">PVC name, which must be unique in the namespace. The value must be unique in the namespace. (If the PVC is dynamically created by a stateful application, the value of this parameter must be the same as the name of the FlexVolume PVC.)</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row14814112802420"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.8.2.3.1.1 "><p id="cce_bestpractice_0107__p12312104542415">namespace</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.8.2.3.1.2 "><p id="cce_bestpractice_0107__p23111645172416">Namespace to which the PVC belongs. Use the same value as that of the FlexVolume PVC.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row29461842142512"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.8.2.3.1.1 "><p id="cce_bestpractice_0107__p17946114232518">storage</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.8.2.3.1.2 "><p id="cce_bestpractice_0107__p139473427251">Requested capacity of the PVC, which must be the same as the storage size of the existing PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row49479423257"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.8.2.3.1.1 "><p id="cce_bestpractice_0107__p18947342152514">volumeName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.8.2.3.1.2 "><p id="cce_bestpractice_0107__p3947184232520">Name of the PV. Set this parameter to the name of the static PV in <a href="#cce_bestpractice_0107__li1219802032512">2</a>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row18815102892413"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.8.2.3.1.1 "><p id="cce_bestpractice_0107__p8310164517245">storageClassName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.8.2.3.1.2 "><p id="cce_bestpractice_0107__p1530854517246">Name of the Kubernetes storage class. Set this field to <strong id="cce_bestpractice_0107__b1460943817368">csi-disk</strong> for EVS disks.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_bestpractice_0107__p274981413584">Configuration example of <strong id="cce_bestpractice_0107__b89401733192715">a PVC for an SFS volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen374911425816">apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-provisioner: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b133131858205020">name: pvc-sfs-example</strong>
<strong id="cce_bestpractice_0107__b143149582501"> namespace: default</strong>
spec:
accessModes:
- ReadWriteMany
resources:
requests:
<strong id="cce_bestpractice_0107__b951138515">storage: 10Gi</strong>
storageClassName: csi-nas
<strong id="cce_bestpractice_0107__b31661107515">volumeName: pv-sfs-example</strong></pre>
<p id="cce_bestpractice_0107__p153871736162614"></p>
<p id="cce_bestpractice_0107__p12224173311267">Pay attention to the fields in bold and red. The parameters are described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0107__table422493310266" frame="border" border="1" rules="all"><caption><b>Table 6 </b>PVC configuration parameters for an SFS volume</caption><thead align="left"><tr id="cce_bestpractice_0107__row1922563392612"><th align="left" class="cellrowborder" valign="top" width="26.1%" id="mcps1.3.4.2.3.2.13.2.3.1.1"><p id="cce_bestpractice_0107__p22251033152613">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="73.9%" id="mcps1.3.4.2.3.2.13.2.3.1.2"><p id="cce_bestpractice_0107__p8225933132618">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_bestpractice_0107__row2225333122619"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.13.2.3.1.1 "><p id="cce_bestpractice_0107__p8945032152711">name</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.13.2.3.1.2 "><p id="cce_bestpractice_0107__p10943203272712">PVC name, which must be unique in the namespace. The value must be unique in the namespace. (If the PVC is dynamically created by a stateful application, the value of this parameter must be the same as the name of the FlexVolume PVC.)</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row12258330265"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.13.2.3.1.1 "><p id="cce_bestpractice_0107__p199433322276">namespace</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.13.2.3.1.2 "><p id="cce_bestpractice_0107__p1794193282720">Namespace to which the PVC belongs. Use the same value as that of the FlexVolume PVC.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row4226193317265"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.13.2.3.1.1 "><p id="cce_bestpractice_0107__p3941123222711">storage</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.13.2.3.1.2 "><p id="cce_bestpractice_0107__p1937163220275">Storage capacity, in the unit of Gi. The value must be the same as the storage size of the existing PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row122267331266"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.13.2.3.1.1 "><p id="cce_bestpractice_0107__p693723214276">storageClassName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.13.2.3.1.2 "><p id="cce_bestpractice_0107__p12935432172717">Set this field to <strong id="cce_bestpractice_0107__b2098319548357">csi-nas</strong>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row16226173312266"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.13.2.3.1.1 "><p id="cce_bestpractice_0107__p13935113202710">volumeName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.13.2.3.1.2 "><p id="cce_bestpractice_0107__p1789783262714">Name of the PV. Set this parameter to the name of the static PV in <a href="#cce_bestpractice_0107__li1219802032512">2</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_bestpractice_0107__p10749101435811">Configuration example of <strong id="cce_bestpractice_0107__b1319323912287">a PVC for an OBS volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen6750191415816">apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-provisioner: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b148192314516">everest.io/obs-volume-type: STANDARD</strong>
<strong id="cce_bestpractice_0107__b115042311518"> csi.storage.k8s.io/fstype: s3fs</strong>
<strong id="cce_bestpractice_0107__b65119231516"> name: pvc-obs-example</strong>
<strong id="cce_bestpractice_0107__b155282318512"> namespace: default</strong>
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: csi-obs
<strong id="cce_bestpractice_0107__b1338563395110">volumeName: pv-obs-example</strong></pre>
<p id="cce_bestpractice_0107__p383704032816"></p>
<p id="cce_bestpractice_0107__p47721342102816">Pay attention to the fields in bold and red. The parameters are described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0107__table17773144214281" frame="border" border="1" rules="all"><caption><b>Table 7 </b>PVC configuration parameters for an OBS volume</caption><thead align="left"><tr id="cce_bestpractice_0107__row177312429288"><th align="left" class="cellrowborder" valign="top" width="26.1%" id="mcps1.3.4.2.3.2.18.2.3.1.1"><p id="cce_bestpractice_0107__p1577319428281">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="73.9%" id="mcps1.3.4.2.3.2.18.2.3.1.2"><p id="cce_bestpractice_0107__p18773114202812">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_bestpractice_0107__row577312423281"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.18.2.3.1.1 "><p id="cce_bestpractice_0107__p193015559284">everest.io/obs-volume-type</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.18.2.3.1.2 "><p id="cce_bestpractice_0107__p992585519282">OBS volume type, which can be <strong id="cce_bestpractice_0107__b2444626143612">STANDARD</strong> (standard bucket) and <strong id="cce_bestpractice_0107__b844912623617">WARM</strong> (infrequent access bucket). Set this parameter to the same value as that of the PV created in <a href="#cce_bestpractice_0107__li1219802032512">2</a>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row19773144211282"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.18.2.3.1.1 "><p id="cce_bestpractice_0107__p5923855162815">csi.storage.k8s.io/fstype</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.18.2.3.1.2 "><p id="cce_bestpractice_0107__p39171555102815">File type, which can be <strong id="cce_bestpractice_0107__b13289932153612">obsfs</strong> or <strong id="cce_bestpractice_0107__b1290113233617">s3fs</strong>. The value must be the same as that of <strong id="cce_bestpractice_0107__b14178841123611">fsType</strong> of the static OBS volume PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row477319428280"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.18.2.3.1.1 "><p id="cce_bestpractice_0107__p1291685572817">name</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.18.2.3.1.2 "><p id="cce_bestpractice_0107__p109121355172817">PVC name, which must be unique in the namespace. The value must be unique in the namespace. (If the PVC is dynamically created by a stateful application, the value of this parameter must be the same as the name of the FlexVolume PVC.)</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row1774942132812"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.18.2.3.1.1 "><p id="cce_bestpractice_0107__p1991165552819">namespace</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.18.2.3.1.2 "><p id="cce_bestpractice_0107__p5906185532810">Namespace to which the PVC belongs. Use the same value as that of the FlexVolume PVC.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row45426588296"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.18.2.3.1.1 "><p id="cce_bestpractice_0107__p18543135842910">storage</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.18.2.3.1.2 "><p id="cce_bestpractice_0107__p5543125816296">Storage capacity, in the unit of Gi. Set this parameter to the fixed value <strong id="cce_bestpractice_0107__b539314634520">1Gi</strong>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row19543858172911"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.18.2.3.1.1 "><p id="cce_bestpractice_0107__p185431558192914">storageClassName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.18.2.3.1.2 "><p id="cce_bestpractice_0107__p12544958192916">Name of the Kubernetes storage class. Set this field to <strong id="cce_bestpractice_0107__b1113154916369">csi-obs</strong>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row1577494282811"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.18.2.3.1.1 "><p id="cce_bestpractice_0107__p169043554284">volumeName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.18.2.3.1.2 "><p id="cce_bestpractice_0107__p14898135517281">Name of the PV. Set this parameter to the name of the static PV created in <a href="#cce_bestpractice_0107__li1219802032512">2</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_bestpractice_0107__p1675061455816">Configuration example of <strong id="cce_bestpractice_0107__b17354554153016">a PVC for an SFS Turbo volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen3750214135816">apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-provisioner: everest-csi-provisioner
<strong id="cce_bestpractice_0107__b244135135117">name: pvc-efs-example</strong>
<strong id="cce_bestpractice_0107__b1745135175111"> namespace: default</strong>
spec:
accessModes:
- ReadWriteMany
resources:
requests:
<strong id="cce_bestpractice_0107__b19227115545111">storage: 10Gi</strong>
storageClassName: csi-sfsturbo
<strong id="cce_bestpractice_0107__b189426581511">volumeName: pv-efs-example</strong></pre>
<p id="cce_bestpractice_0107__p86568093119"></p>
<p id="cce_bestpractice_0107__p1171114213318">Pay attention to the fields in bold and red. The parameters are described as follows:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0107__table671111213311" frame="border" border="1" rules="all"><caption><b>Table 8 </b>PVC configuration parameters for an SFS Turbo volume</caption><thead align="left"><tr id="cce_bestpractice_0107__row1471215263113"><th align="left" class="cellrowborder" valign="top" width="26.1%" id="mcps1.3.4.2.3.2.23.2.3.1.1"><p id="cce_bestpractice_0107__p67121726317">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="73.9%" id="mcps1.3.4.2.3.2.23.2.3.1.2"><p id="cce_bestpractice_0107__p1271218216314">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_bestpractice_0107__row57121926319"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.23.2.3.1.1 "><p id="cce_bestpractice_0107__p0943764313">name</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.23.2.3.1.2 "><p id="cce_bestpractice_0107__p199421860316">PVC name, which must be unique in the namespace. The value must be unique in the namespace. (If the PVC is dynamically created by a stateful application, the value of this parameter must be the same as the name of the FlexVolume PVC.)</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row57124233111"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.23.2.3.1.1 "><p id="cce_bestpractice_0107__p494114615316">namespace</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.23.2.3.1.2 "><p id="cce_bestpractice_0107__p49399611316">Namespace to which the PVC belongs. Use the same value as that of the FlexVolume PVC.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row10712132133110"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.23.2.3.1.1 "><p id="cce_bestpractice_0107__p193419653113">storageClassName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.23.2.3.1.2 "><p id="cce_bestpractice_0107__p593318613110">Name of the Kubernetes storage class. Set this field to <strong id="cce_bestpractice_0107__b18465105517360">csi-sfsturbo</strong>.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row97131621319"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.23.2.3.1.1 "><p id="cce_bestpractice_0107__p11933106203116">storage</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.23.2.3.1.2 "><p id="cce_bestpractice_0107__p179324633110">Storage capacity, in the unit of Gi. The value must be the same as the storage size of the existing PV.</p>
</td>
</tr>
<tr id="cce_bestpractice_0107__row17131626319"><td class="cellrowborder" valign="top" width="26.1%" headers="mcps1.3.4.2.3.2.23.2.3.1.1 "><p id="cce_bestpractice_0107__p39311762316">volumeName</p>
</td>
<td class="cellrowborder" valign="top" width="73.9%" headers="mcps1.3.4.2.3.2.23.2.3.1.2 "><p id="cce_bestpractice_0107__p1393016623115">Name of the PV. Set this parameter to the name of the static PV created in <a href="#cce_bestpractice_0107__li1219802032512">2</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li id="cce_bestpractice_0107__li487255772614"><a name="cce_bestpractice_0107__li487255772614"></a><a name="li487255772614"></a><span>Upgrade the workload to use a new PVC.</span><p><div class="p" id="cce_bestpractice_0107__p49135415327"><strong id="cce_bestpractice_0107__b4921045529">For Deployments</strong><ol type="a" id="cce_bestpractice_0107__ol13702185293210"><li id="cce_bestpractice_0107__li89201610376">Run the <strong id="cce_bestpractice_0107__b37767425521">kubectl create -f</strong> commands to create a PV and PVC.<p id="cce_bestpractice_0107__p14051775518"><strong id="cce_bestpractice_0107__b634944319535">kubectl create -f pv-example.yaml</strong></p>
<p id="cce_bestpractice_0107__p3931117155519"><strong id="cce_bestpractice_0107__b12351174335316">kubectl create -f pvc-example.yaml</strong></p>
<div class="note" id="cce_bestpractice_0107__note29456108015"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_bestpractice_0107__p15945410903">Replace the example file name <strong id="cce_bestpractice_0107__b488083619534">pvc-example.yaml</strong> in the preceding commands with the names of the YAML files configured in <a href="#cce_bestpractice_0107__li1219802032512">2</a> and <a href="#cce_bestpractice_0107__li1710710385418">3</a>.</p>
</div></div>
</li><li id="cce_bestpractice_0107__li9702175212324">Go to the CCE console. On the workload upgrade page, click <strong id="cce_bestpractice_0107__b112026811519">Upgrade</strong> &gt; <strong id="cce_bestpractice_0107__b1293016109517">Advanced Settings</strong> &gt; <strong id="cce_bestpractice_0107__b2033618182518">Data Storage</strong> &gt; <strong id="cce_bestpractice_0107__b3464204813510">Cloud Storage</strong>.<p id="cce_bestpractice_0107__p86798198185"></p>
</li><li id="cce_bestpractice_0107__li1570218527326">Uninstall the old storage and add the PVC in the CSI format. Retain the original mounting path in the container.</li><li id="cce_bestpractice_0107__li770285210328">Click <strong id="cce_bestpractice_0107__b8264527157">Submit</strong>.</li><li id="cce_bestpractice_0107__li9702125211325">Wait until the pods are running.</li></ol>
</div>
<p id="cce_bestpractice_0107__p2046531913410"><strong id="cce_bestpractice_0107__b1218415319183">For StatefulSets that use existing storage</strong></p>
<ol type="a" id="cce_bestpractice_0107__ol391017653810"><li id="cce_bestpractice_0107__li1991019610384">Run the <strong id="cce_bestpractice_0107__b5635143217182">kubectl create -f</strong> commands to create a PV and PVC.<p id="cce_bestpractice_0107__p719614467583"><strong id="cce_bestpractice_0107__b16814314529">kubectl create -f pv-example.yaml</strong></p>
<p id="cce_bestpractice_0107__p2019634635813"><strong id="cce_bestpractice_0107__b368303175216">kubectl create -f pvc-example.yaml</strong></p>
<div class="note" id="cce_bestpractice_0107__note1366820421907"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_bestpractice_0107__p1766874218020">Replace the example file name <strong id="cce_bestpractice_0107__b2077273716181">pvc-example.yaml</strong> in the preceding commands with the names of the YAML files configured in <a href="#cce_bestpractice_0107__li1219802032512">2</a> and <a href="#cce_bestpractice_0107__li1710710385418">3</a>.</p>
</div></div>
</li><li id="cce_bestpractice_0107__li467218817397">Run the <strong id="cce_bestpractice_0107__b591655819185">kubectl edit</strong> command to edit the StatefulSet and use the newly created PVC.<p id="cce_bestpractice_0107__p3883848805"><strong id="cce_bestpractice_0107__b8480926155211">kubectl edit sts sts-example -n</strong> xxx</p>
<p id="cce_bestpractice_0107__p1047514291298"><span><img id="cce_bestpractice_0107__image1089813263010" src="en-us_image_0000001851585440.png"></span></p>
<div class="note" id="cce_bestpractice_0107__note1646111820116"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_bestpractice_0107__p74619186120">Replace <strong id="cce_bestpractice_0107__b137451618206">sts-example</strong> in the preceding command with the actual name of the StatefulSet to upgrade. <strong id="cce_bestpractice_0107__b11603328217">xxx</strong> indicates the namespace to which the StatefulSet belongs.</p>
</div></div>
</li><li id="cce_bestpractice_0107__li182243184017">Wait until the pods are running.</li></ol>
<div class="note" id="cce_bestpractice_0107__note14106440104810"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_bestpractice_0107__p1010634011480">The current console does not support the operation of adding new cloud storage for StatefulSets. Use the kubectl commands to replace the storage with the newly created PVC.</p>
</div></div>
<p id="cce_bestpractice_0107__p6139112124010"><strong id="cce_bestpractice_0107__b169082072316">For StatefulSets that use dynamically allocated storage</strong></p>
<ol type="a" id="cce_bestpractice_0107__ol8394103754010"><li id="cce_bestpractice_0107__li839453710408">Back up the PV and PVC in the flexVolume format used by the StatefulSet.<p id="cce_bestpractice_0107__p860733613433"><a name="cce_bestpractice_0107__li839453710408"></a><a name="li839453710408"></a><strong id="cce_bestpractice_0107__b15772239165214">kubectl get pvc xxx -n {namespaces} -oyaml &gt; pvc-backup.yaml</strong></p>
<p id="cce_bestpractice_0107__p1946244224319"><strong id="cce_bestpractice_0107__b11773153914525">kubectl get pv xxx -n {namespaces} -oyaml &gt; pv-backup.yaml</strong></p>
</li><li id="cce_bestpractice_0107__li3752132274116">Change the number of pods to <strong id="cce_bestpractice_0107__b842715611241">0</strong>.</li><li id="cce_bestpractice_0107__li8594347124116">On the storage page, disassociate the flexVolume PVC used by the StatefulSet.</li><li id="cce_bestpractice_0107__li1516912289428">Run the <strong id="cce_bestpractice_0107__b4130171813255">kubectl create -f</strong> commands to create a PV and PVC.<p id="cce_bestpractice_0107__p8843649624"><strong id="cce_bestpractice_0107__b6321104512522">kubectl create -f pv-example.yaml</strong></p>
<p id="cce_bestpractice_0107__p108433491626"><strong id="cce_bestpractice_0107__b732314519529">kubectl create -f pvc-example.yaml</strong></p>
<div class="note" id="cce_bestpractice_0107__note1984317491325"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_bestpractice_0107__p884394916216">Replace the example file name <strong id="cce_bestpractice_0107__b63634327258">pvc-example.yaml</strong> in the preceding commands with the names of the YAML files configured in <a href="#cce_bestpractice_0107__li1219802032512">2</a> and <a href="#cce_bestpractice_0107__li1710710385418">3</a>.</p>
</div></div>
</li><li id="cce_bestpractice_0107__li416917424">Change the number of pods back to the original value and wait until the pods are running.</li></ol>
<div class="note" id="cce_bestpractice_0107__note16369154924218"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_bestpractice_0107__p193690499421">The dynamic allocation of storage for StatefulSets is achieved by using <strong id="cce_bestpractice_0107__b18281421379">volumeClaimTemplates</strong>. This field cannot be modified by Kubernetes. Therefore, data cannot be migrated by using a new PVC.</p>
<p id="cce_bestpractice_0107__p191911444124512">The PVC naming rule of the <strong id="cce_bestpractice_0107__b586438122911">volumeClaimTemplates</strong> is fixed. When a PVC that meets the naming rule exists, this PVC is used.</p>
<p id="cce_bestpractice_0107__p226010117479">Therefore, disassociate the original PVC first, and then create a PVC with the same name in the CSI format.</p>
</div></div>
<p id="cce_bestpractice_0107__p101114953715">6. (Optional) Recreate the stateful application to ensure that a CSI PVC is used when the application is scaled out. Otherwise, FlexVolume PVCs are used in scaling out.</p>
<ul id="cce_bestpractice_0107__ul6565455173114"><li id="cce_bestpractice_0107__li85652555315">Run the following command to obtain the YAML file of the StatefulSet:</li></ul>
<p id="cce_bestpractice_0107__p8106135815424"><strong id="cce_bestpractice_0107__b142839015531">kubectl get sts xxx -n {namespaces} -oyaml &gt; sts.yaml</strong></p>
<ul id="cce_bestpractice_0107__ul1702757163116"><li id="cce_bestpractice_0107__li1870215715312">Run the following command to back up the YAML file of the StatefulSet:</li></ul>
<p id="cce_bestpractice_0107__p16392162024511"><strong id="cce_bestpractice_0107__b885919419538">cp sts.yaml sts-backup.yaml</strong></p>
<ul id="cce_bestpractice_0107__ul147311659183119"><li id="cce_bestpractice_0107__li9731259123116">Modify the definition of <strong id="cce_bestpractice_0107__b181291215342">volumeClaimTemplates</strong> in the YAML file of the StatefulSet.</li></ul>
<p id="cce_bestpractice_0107__p1503720144718"><strong id="cce_bestpractice_0107__b61168985318">vi sts.yaml</strong></p>
<p id="cce_bestpractice_0107__p1327113457466">Configuration example of <strong id="cce_bestpractice_0107__b187711213386">volumeClaimTemplates for an EVS volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen8273843134614"> volumeClaimTemplates:
- metadata:
name: pvc-161070049798261342
namespace: default
creationTimestamp: null
annotations:
everest.io/disk-volume-type: SAS
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: csi-disk</pre>
<p id="cce_bestpractice_0107__p16173075017">The parameter value must be the same as the PVC of the EVS volume created in <a href="#cce_bestpractice_0107__li1710710385418">3</a>.</p>
<p id="cce_bestpractice_0107__p496972015420">Configuration example of <strong id="cce_bestpractice_0107__b38819408388">volumeClaimTemplates for an SFS volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen2111101275510"> volumeClaimTemplates:
- metadata:
name: pvc-161063441560279697
namespace: default
creationTimestamp: null
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
storageClassName: csi-nas</pre>
<p id="cce_bestpractice_0107__p18964174325419">The parameter value must be the same as the PVC of the SFS volume created in <a href="#cce_bestpractice_0107__li1710710385418">3</a>.</p>
<p id="cce_bestpractice_0107__p2028514411542">Configuration example of <strong id="cce_bestpractice_0107__b32081043916">volumeClaimTemplates for an OBS volume</strong>:</p>
<pre class="screen" id="cce_bestpractice_0107__screen3803192217565"> volumeClaimTemplates:
- metadata:
name: pvc-161070100417416148
namespace: default
creationTimestamp: null
annotations:
csi.storage.k8s.io/fstype: s3fs
everest.io/obs-volume-type: STANDARD
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: csi-obs</pre>
<p id="cce_bestpractice_0107__p7452134435416">The parameter value must be the same as the PVC of the OBS volume created in <a href="#cce_bestpractice_0107__li1710710385418">3</a>.</p>
<ul id="cce_bestpractice_0107__ul4451106123212"><li id="cce_bestpractice_0107__li1445110623213">Delete the StatefulSet.</li></ul>
<p id="cce_bestpractice_0107__p9484135210583"><strong id="cce_bestpractice_0107__b10187161615531">kubectl delete sts xxx -n</strong> {namespaces}</p>
<ul id="cce_bestpractice_0107__ul23331682326"><li id="cce_bestpractice_0107__li183333819328">Create the StatefulSet.</li></ul>
<p id="cce_bestpractice_0107__p15201716115912"><strong id="cce_bestpractice_0107__b364112118534">kubectl create -f sts.yaml</strong></p>
</p></li><li id="cce_bestpractice_0107__li613114241611"><span>Check service functions.</span><p><ol type="a" id="cce_bestpractice_0107__ol11922155141617"><li id="cce_bestpractice_0107__li39225559164">Check whether the application is running properly.</li><li id="cce_bestpractice_0107__li14372105921616">Checking whether the data storage is normal.</li></ol>
<div class="note" id="cce_bestpractice_0107__note175615519171"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_bestpractice_0107__p25611851151710">If a rollback is required, perform <a href="#cce_bestpractice_0107__li487255772614">4</a>. Select the PVC in FlexVolume format and upgrade the application.</p>
</div></div>
</p></li><li id="cce_bestpractice_0107__li11514201412713"><span>Uninstall the PVC in the FlexVolume format.</span><p><p id="cce_bestpractice_0107__p1096845811912">If the application functions normally, unbind the PVC in the FlexVolume format on the storage management page.</p>
<p id="cce_bestpractice_0107__p106251635193615">You can also run the kubectl command to delete the PVC and PV of the FlexVolume format.</p>
<div class="caution" id="cce_bestpractice_0107__note7619735143613"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="cce_bestpractice_0107__p14619163573619">Before deleting a PV, change the persistentVolumeReclaimPolicy of the PV to <strong id="cce_bestpractice_0107__b057412249379">Retain</strong>. Otherwise, the underlying storage will be reclaimed after the PV is deleted.</p>
<p id="cce_bestpractice_0107__p597819349482">If the cluster has been upgraded before the storage migration, PVs may fail to be deleted. You can remove the PV protection field <strong id="cce_bestpractice_0107__b16941325115918">finalizers</strong> to delete PVs.</p>
<p id="cce_bestpractice_0107__p69375506527">kubectl patch pv {pv_name} -p '{"metadata":{"finalizers":null}}'</p>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_bestpractice_0053.html">Storage</a></div>
</div>
</div>