Files
doc-exports/docs/cce/umn/cce_10_1012.html
qiujiandong1 6d480dcc20 CCE UMN update 20250912 version
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Co-authored-by: qiujiandong1 <qiujiandong1@huawei.com>
Co-committed-by: qiujiandong1 <qiujiandong1@huawei.com>
2025-10-29 10:20:57 +00:00

105 lines
12 KiB
HTML

<a name="cce_10_1012"></a><a name="cce_10_1012"></a>
<h1 class="topictitle1">Configuring EVS Mount Options</h1>
<div id="body0000002314496089"><p id="cce_10_1012__p740320151189">Mount options are parameters passed to the kernel during file system mounting. They control the access mode, performance optimization, and security policies of storage devices (such as EVS, SFS, and OBS). CCE allows you to configure mount options in PVs and StorageClasses.</p>
<ul id="cce_10_1012__ul10666118151814"><li id="cce_10_1012__li2297142031815">Configuring mount options in a PV applies only to that specific PV. This method is used when custom mount parameters are needed for a particular storage volume.</li><li id="cce_10_1012__li9297192415205">Configuring mount options in a StorageClass applies to all PVs created using that StorageClass. This method is used for centrally configuring mount options for EVS disks.</li></ul>
<div class="section" id="cce_10_1012__section1940515714420"><h4 class="sectiontitle">Prerequisites</h4><p id="cce_10_1012__p123191440105710">The <a href="cce_10_0066.html">CCE Container Storage (Everest)</a> version must be <strong id="cce_10_1012__b11385120890">2.4.153 or later</strong>. This add-on identifies the mount options and transfers them to the underlying storage resources. The parameter settings take effect only if the underlying storage resources support the specified options.</p>
</div>
<div class="section" id="cce_10_1012__section6456132219344"><h4 class="sectiontitle">Notes and Constraints</h4><ul id="cce_10_1012__ul17439102191413"><li id="cce_10_1012__li11439182141416">Mount options cannot be configured for secure containers.</li></ul>
</div>
<div class="section" id="cce_10_1012__section1254912109811"><a name="cce_10_1012__section1254912109811"></a><a name="section1254912109811"></a><h4 class="sectiontitle">EVS Mount Options</h4><p id="cce_10_1012__p683717710293">CCE supports the mount options listed in the following table.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_10_1012__table1688593020213" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Mount options</caption><thead align="left"><tr id="cce_10_1012__row148854300216"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.3.2.4.1.1"><p id="cce_10_1012__p1188553019213">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.5%" id="mcps1.3.5.3.2.4.1.2"><p id="cce_10_1012__p0668193919131">Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="62.5%" id="mcps1.3.5.3.2.4.1.3"><p id="cce_10_1012__p12885183018212">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_10_1012__row788593020214"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="cce_10_1012__p178859301223">noatime/strictatime/relatime</p>
</td>
<td class="cellrowborder" valign="top" width="12.5%" headers="mcps1.3.5.3.2.4.1.2 "><p id="cce_10_1012__p1668143912134">Blank</p>
</td>
<td class="cellrowborder" valign="top" width="62.5%" headers="mcps1.3.5.3.2.4.1.3 "><p id="cce_10_1012__p1088511301822">Specify how file access time (atime) is updated. You can choose one of the following options:</p>
<ul id="cce_10_1012__ul3520192173510"><li id="cce_10_1012__li205201721153517"><strong id="cce_10_1012__b231493912476">noatime</strong>: atime is not updated. This option provides the highest performance but completely loses atime information. It is suitable for high-concurrency read scenarios, such as databases and static file services.</li><li id="cce_10_1012__li4331163183513"><strong id="cce_10_1012__b15367832154814">relatime</strong> (default): atime is updated only if it is earlier than mtime or if it has not been updated for more than 24 hours. This option has low overhead.</li><li id="cce_10_1012__li244365143512"><strong id="cce_10_1012__b149532125503">strictatime</strong>: atime is updated every time a file is read. This option is the most accurate but has the worst performance. It is suitable for scenarios where access time needs to be strictly recorded.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="cce_10_1012__section1787104824615"><h4 class="sectiontitle">Configuring Mount Options</h4><p id="cce_10_1012__p392405314619">You can configure mount options using one of the following methods.</p>
</div>
<div class="section" id="cce_10_1012__section846811715589"><h4 class="sectiontitle">Configuring Mount Options in a PV</h4><p id="cce_10_1012__p1070219443123">You can use <strong id="cce_10_1012__b19637633302">mountOptions</strong> to configure mount options in a PV. This configuration applies only to that specific PV. For details about <strong id="cce_10_1012__b135415514116">mountOptions</strong>, see <a href="#cce_10_1012__section1254912109811">EVS Mount Options</a>.</p>
<ol id="cce_10_1012__ol24468432310"><li id="cce_10_1012__li3446143636"><span>Use kubectl to access the cluster. For details, see <a href="cce_10_0107.html">Accessing a Cluster Using kubectl</a>.</span></li><li id="cce_10_1012__li887813482193"><span>Configure mount options in a PV. Example:</span><p><pre class="screen" id="cce_10_1012__screen6878748181916">apiVersion: v1
kind: PersistentVolume
metadata:
annotations:
pv.kubernetes.io/provisioned-by: everest-csi-provisioner
name: pv-disk # PV name
labels:
failure-domain.beta.kubernetes.io/region:
failure-domain.beta.kubernetes.io/zone:
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi # Storage capacity
csi:
driver: disk.csi.everest.io
fsType: ext4
volumeHandle: {your_volume_id} # EVS volume ID
volumeAttributes:
storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner
everest.io/disk-mode: SCSI
everest.io/disk-volume-type: SATA
everest.io/enterprise-project-id: '0'
persistentVolumeReclaimPolicy: Retain
storageClassName: csi-disk
<strong id="cce_10_1012__b11511618310"> mountOptions: # Mount options</strong>
<strong id="cce_10_1012__b135199563484"> - strictatime</strong></pre>
</p></li><li id="cce_10_1012__li562916479317"><span>After creating a PV, you can create a PVC, bind it to the PV, and mount the PV to the containers in the workload. For details, see <a href="cce_10_0614.html">Using an Existing EVS Disk Through a Static PV</a>.</span></li><li id="cce_10_1012__li481852971115"><span>Check whether the mount options are effective. In this example, the PVC is mounted to a workload using the <strong id="cce_10_1012__b9806115331716">nginx:latest</strong> image, with the mount path <strong id="cce_10_1012__b091722171816">/testdir</strong> in the container. To verify the settings, do as follows:</span><p><ol type="a" id="cce_10_1012__ol14535192815529"><li id="cce_10_1012__li1653582815526">Check the name of the pod to which the PVC has been mounted. In this example, the workload name is <strong id="cce_10_1012__b16347115245">web-disk</strong>.<pre class="screen" id="cce_10_1012__screen1641643713531">kubectl get pod | grep <i><span class="varname" id="cce_10_1012__varname145401959205319">web-disk</span></i></pre>
<p id="cce_10_1012__p336810441542">Information similar to the following is displayed:</p>
<pre class="screen" id="cce_10_1012__screen19146756135418">web-disk-xxx 1/1 Running 0 23m</pre>
</li><li id="cce_10_1012__li104133225551">Run the following command to access the pod:<pre class="screen" id="cce_10_1012__screen189511552165514">kubectl exec -it web-disk-xxx -- bash</pre>
</li><li id="cce_10_1012__li9900101019563">Run the following command to access the mount path and obtain a test file:<pre class="screen" id="cce_10_1012__screen2521317185714">cd /testdir
echo 'ok' &gt; testfile</pre>
</li><li id="cce_10_1012__li17181012145813">Run the command repeatedly and check the <strong id="cce_10_1012__b66986712305">Access</strong> value in the output. If the <strong id="cce_10_1012__b15693152312309">Access</strong> value changes, the <strong id="cce_10_1012__b977773163012">strictatime</strong> mount option is effective.<pre class="screen" id="cce_10_1012__screen1987864811589">stat testfile &amp;&amp; cat testfile &gt; /dev/null</pre>
</li></ol>
</p></li></ol>
</div>
<div class="section" id="cce_10_1012__section14845171205813"><h4 class="sectiontitle">Configuring Mount Options in a StorageClass</h4><p id="cce_10_1012__p09111331124418">You can also use <strong id="cce_10_1012__b93099167316">mountOptions</strong> to configure mount options in a StorageClass. This configuration applies to all PVs created using this StorageClass. For details about <strong id="cce_10_1012__b974715412320">mountOptions</strong>, see <a href="#cce_10_1012__section1254912109811">EVS Mount Options</a>.</p>
<ol id="cce_10_1012__ol347253314205"><li id="cce_10_1012__li104721332209"><span>Use kubectl to access the cluster. For details, see <a href="cce_10_0107.html">Accessing a Cluster Using kubectl</a>.</span></li><li id="cce_10_1012__li13357154012205"><span>Create a custom StorageClass. Example:</span><p><pre class="screen" id="cce_10_1012__screen5357144011202">allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-disk # The StorageClass name
<strong id="cce_10_1012__b1073163695910">mountOptions: # Mount options</strong>
<strong id="cce_10_1012__b12731136145912">- strictatime</strong>
parameters:
csi.storage.k8s.io/csi-driver-name: disk.csi.everest.io
csi.storage.k8s.io/fstype: ext4
everest.io/disk-volume-type: SAS
everest.io/passthrough: "true"
provisioner: everest-csi-provisioner
reclaimPolicy: Delete
volumeBindingMode: Immediate</pre>
</p></li><li id="cce_10_1012__li32331138216"><span>After the StorageClass is configured, you can use it to create a PVC. By default, dynamically created PVs inherit the mount options configured in the StorageClass. For details, see <a href="cce_10_0615.html">Using an EVS Disk Through a Dynamic PV</a>.</span></li><li id="cce_10_1012__li688641315217"><span>Check whether the mount options are effective. In this example, the PVC is mounted to a workload using the <strong id="cce_10_1012__cce_10_1012_b9806115331716">nginx:latest</strong> image, with the mount path <strong id="cce_10_1012__cce_10_1012_b091722171816">/testdir</strong> in the container. To verify the settings, do as follows:</span><p><ol type="a" id="cce_10_1012__cce_10_1012_ol14535192815529"><li id="cce_10_1012__cce_10_1012_li1653582815526">Check the name of the pod to which the PVC has been mounted. In this example, the workload name is <strong id="cce_10_1012__cce_10_1012_b16347115245">web-disk</strong>.<pre class="screen" id="cce_10_1012__cce_10_1012_screen1641643713531">kubectl get pod | grep <i><span class="varname" id="cce_10_1012__cce_10_1012_varname145401959205319">web-disk</span></i></pre>
<p id="cce_10_1012__cce_10_1012_p336810441542">Information similar to the following is displayed:</p>
<pre class="screen" id="cce_10_1012__cce_10_1012_screen19146756135418">web-disk-xxx 1/1 Running 0 23m</pre>
</li><li id="cce_10_1012__cce_10_1012_li104133225551">Run the following command to access the pod:<pre class="screen" id="cce_10_1012__cce_10_1012_screen189511552165514">kubectl exec -it web-disk-xxx -- bash</pre>
</li><li id="cce_10_1012__cce_10_1012_li9900101019563">Run the following command to access the mount path and obtain a test file:<pre class="screen" id="cce_10_1012__cce_10_1012_screen2521317185714">cd /testdir
echo 'ok' &gt; testfile</pre>
</li><li id="cce_10_1012__cce_10_1012_li17181012145813">Run the command repeatedly and check the <strong id="cce_10_1012__cce_10_1012_b66986712305">Access</strong> value in the output. If the <strong id="cce_10_1012__cce_10_1012_b15693152312309">Access</strong> value changes, the <strong id="cce_10_1012__cce_10_1012_b977773163012">strictatime</strong> mount option is effective.<pre class="screen" id="cce_10_1012__cce_10_1012_screen1987864811589">stat testfile &amp;&amp; cat testfile &gt; /dev/null</pre>
</li></ol>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_10_0044.html">EVS</a></div>
</div>
</div>