{"id":98208,"date":"2026-08-31T12:32:53","date_gmt":"2026-08-31T04:32:53","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/98208.html"},"modified":"2026-08-31T12:32:53","modified_gmt":"2026-08-31T04:32:53","slug":"k8s%e9%9b%86%e7%be%a4%e5%88%86%e5%b8%83%e5%bc%8f%e5%ad%98%e5%82%a8%e5%bf%ab%e7%85%a7%e9%ab%98%e9%98%b6%e8%bf%90%e7%bb%b4%e6%94%b6%e5%ae%98%e5%ae%9e%e6%93%8d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/98208.html","title":{"rendered":"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd"},"content":{"rendered":"<h2>K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd<\/h2>\n<p>\u6280\u672f\u6808&#xff1a;Kubernetes v1.32.13 &#043; Rocky Linux 8.6 &#043; \u5b58\u50a8\u5feb\u7167\u4e0e\u514b\u9686 &#043; Containerd 1.7.x<\/p>\n<p>\u64cd\u4f5c\u73af\u5883 \/ \u5bf9\u63a5\u539f\u7406 \/ \u8be6\u7ec6\u6b65\u9aa4 \/ \u5b8c\u6574\u547d\u4ee4 \/ \u914d\u7f6e\u6587\u4ef6 \/ \u9a8c\u8bc1\u6d41\u7a0b \/ \u6392\u9519\u65b9\u6848<\/p>\n<h2>K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd<\/h2>\n<h3>\u64cd\u4f5c\u73af\u5883<\/h3>\n<ul>\n<li>\n<p>K8s \u96c6\u7fa4 3 \u8282\u70b9&#xff1a;k8s-master(192.168.1.10), k8s-node1(192.168.1.11), k8s-node2(192.168.1.12)&#xff0c;K8s \u7248\u672c v1.32.13<\/p>\n<\/li>\n<li>\n<p>\u5b58\u50a8\u7c7b\u578b&#xff1a;\u5b58\u50a8\u5feb\u7167\u4e0e\u514b\u9686&#xff0c;\u5df2\u914d\u7f6e\u5bf9\u5e94 StorageClass \u652f\u6301\u52a8\u6001\u4f9b\u7ed9&#xff0c;PV\/PVC \u8d44\u6e90\u5df2\u5c31\u7eea<\/p>\n<\/li>\n<li>\n<p>\u5bb9\u5668\u8fd0\u884c\u65f6&#xff1a;Containerd 1.7.x&#xff0c;\u64cd\u4f5c\u7cfb\u7edf Rocky Linux 8.6&#xff0c;\u5185\u6838\u7248\u672c\u5df2\u9002\u914d\u5b58\u50a8\u9700\u6c42<\/p>\n<\/li>\n<li>\n<p>\u96c6\u7fa4\u5185\u5b58\u5728\u591a\u547d\u540d\u7a7a\u95f4\/\u591a\u79df\u6237\u4e1a\u52a1&#xff0c;\u5b58\u50a8\u8d44\u6e90\u9700\u8981\u7edf\u4e00\u89c4\u8303\u5316\u7ba1\u7406&#xff0c;\u5305\u542b PV\/PVC\/StorageClass\/ResourceQuota \u7b49\u8d44\u6e90<\/p>\n<\/li>\n<li>\n<p>\u5df2\u914d\u7f6e\u76d1\u63a7\u544a\u8b66\u4f53\u7cfb&#xff08;Prometheus &#043; Grafana&#xff09;&#xff0c;\u5b58\u50a8\u6307\u6807\u53ef\u91c7\u96c6&#xff0c;\u5177\u5907\u5907\u4efd\u6062\u590d\u80fd\u529b<\/p>\n<\/li>\n<\/ul>\n<h3>\u5bf9\u63a5\u539f\u7406<\/h3>\n<p>K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd\u662f K8s \u96c6\u7fa4\u5b58\u50a8\u7cfb\u7edf\u8fd0\u7ef4\u4e2d\u7684\u6838\u5fc3\u64cd\u4f5c\u573a\u666f\u3002K8s \u5b58\u50a8\u4f53\u7cfb\u901a\u8fc7 PV&#xff08;PersistentVolume&#xff09;\u548c PVC&#xff08;PersistentVolumeClaim&#xff09;\u5b9e\u73b0\u5b58\u50a8\u8d44\u6e90\u7684\u62bd\u8c61\u4e0e\u89e3\u8026&#xff0c;StorageClass \u63d0\u4f9b\u52a8\u6001\u5b58\u50a8\u4f9b\u7ed9\u80fd\u529b&#xff0c;CSI&#xff08;Container Storage Interface&#xff09;\u7edf\u4e00\u5b58\u50a8\u9a71\u52a8\u63a5\u53e3\u3002\u5b58\u50a8\u5feb\u7167\u4e0e\u514b\u9686\u4f5c\u4e3a\u5177\u4f53\u7684\u5b58\u50a8\u540e\u7aef&#xff0c;\u4e3a\u96c6\u7fa4\u4e2d\u7684\u6709\u72b6\u6001\u5e94\u7528\u63d0\u4f9b\u6301\u4e45\u5316\u5b58\u50a8\u80fd\u529b\u3002\u8fd0\u7ef4\u64cd\u4f5c\u7684\u6838\u5fc3\u76ee\u6807\u662f\u786e\u4fdd\u5b58\u50a8\u8d44\u6e90\u7684\u53ef\u7528\u6027\u3001\u6027\u80fd\u3001\u5b89\u5168\u6027\u548c\u53ef\u7ba1\u7406\u6027&#xff1a;\u901a\u8fc7\u89c4\u8303\u5316\u7684 PV\/PVC \u7ba1\u7406\u786e\u4fdd\u6301\u4e45\u5316\u6570\u636e\u4e0d\u4e22\u5931&#xff0c;\u901a\u8fc7 StorageClass \u548c\u52a8\u6001\u4f9b\u7ed9\u63d0\u5347\u8d44\u6e90\u5206\u914d\u6548\u7387&#xff0c;\u901a\u8fc7\u914d\u989d\u548c\u591a\u79df\u6237\u9694\u79bb\u5b9e\u73b0\u8d44\u6e90\u7ba1\u63a7&#xff0c;\u901a\u8fc7\u76d1\u63a7\u544a\u8b66\u548c\u5907\u4efd\u5bb9\u707e\u4fdd\u969c\u4e1a\u52a1\u8fde\u7eed\u6027&#xff0c;\u901a\u8fc7\u81ea\u52a8\u5316\u811a\u672c\u548c SOP \u63d0\u5347\u8fd0\u7ef4\u6548\u7387\u3002\u6240\u6709\u64cd\u4f5c\u9700\u9075\u5faa\u4e1a\u52a1\u65e0\u611f\u77e5\u539f\u5219&#xff0c;\u5bf9\u6b63\u5728\u4f7f\u7528\u7684\u5b58\u50a8\u8d44\u6e90\u91c7\u7528\u7070\u5ea6\u548c\u6eda\u52a8\u65b9\u5f0f&#xff0c;\u907f\u514d\u5f71\u54cd\u4e1a\u52a1\u8fd0\u884c\u3002<\/p>\n<h3>\u8be6\u7ec6\u6b65\u9aa4<\/h3>\n<p>1. \u5b58\u50a8\u8d44\u6e90\u73b0\u72b6\u76d8\u70b9\u4e0e\u5206\u7c7b<\/p>\n<p># 1. \u76d8\u70b9\u6240\u6709 PV \u8d44\u6e90<br \/>\nkubectl get pv -o wide<br \/>\nkubectl get pv -o custom-columns&#061;&#039;NAME:.metadata.name,STATUS:.status.phase,CAPACITY:.spec.capacity.storage,ACCESSMODES:.spec.accessModes[*],RECLAIMPOLICY:.spec.persistentVolumeReclaimPolicy,STORAGECLASS:.spec.storageClassName,AGE:.metadata.creationTimestamp&#039;<br \/>\n\u200b<br \/>\n# 2. \u76d8\u70b9\u6240\u6709 PVC \u8d44\u6e90<br \/>\nkubectl get pvc &#8211;all-namespaces -o wide<br \/>\nkubectl get pvc &#8211;all-namespaces -o custom-columns&#061;&#039;NAMESPACE:.metadata.namespace,NAME:.metadata.name,STATUS:.status.phase,VOLUME:.spec.volumeName,CAPACITY:.status.capacity.storage,STORAGECLASS:.spec.storageClassName,ACCESSMODES:.spec.accessModes[*],AGE:.metadata.creationTimestamp&#039;<br \/>\n\u200b<br \/>\n# 3. \u76d8\u70b9 StorageClass<br \/>\nkubectl get storageclass -o wide<br \/>\nkubectl describe storageclass<br \/>\n\u200b<br \/>\n# 4. \u6309\u547d\u540d\u7a7a\u95f4\/\u79df\u6237\u5206\u7c7b\u7edf\u8ba1<br \/>\nfor ns in $(kubectl get ns -o jsonpath&#061;&#039;{.items[*].metadata.name}&#039;); do<br \/>\n \u00a0count&#061;$(kubectl get pvc -n $ns &#8211;no-headers 2&gt;\/dev\/null | wc -l)<br \/>\n \u00a0if [ &#034;$count&#034; -gt 0 ]; then<br \/>\n \u00a0 \u00a0echo &#034;\u547d\u540d\u7a7a\u95f4 $ns: $count \u4e2aPVC&#034;<br \/>\n \u00a0  kubectl get pvc -n $ns -o wide<br \/>\n \u00a0fi<br \/>\ndone<br \/>\n\u200b<br \/>\n# 5. \u8bc6\u522b\u5f02\u5e38\u72b6\u6001\u8d44\u6e90<br \/>\necho &#034;&#061;&#061;&#061; Pending \u72b6\u6001 PVC &#061;&#061;&#061;&#034;<br \/>\nkubectl get pvc &#8211;all-namespaces &#8211;field-selector&#061;status.phase&#061;Pending -o wide<br \/>\necho &#034;&#061;&#061;&#061; Released \u72b6\u6001 PV &#061;&#061;&#061;&#034;<br \/>\nkubectl get pv &#8211;field-selector&#061;status.phase&#061;Released -o wide<br \/>\necho &#034;&#061;&#061;&#061; Failed \u72b6\u6001 PV &#061;&#061;&#061;&#034;<br \/>\nkubectl get pv &#8211;field-selector&#061;status.phase&#061;Failed -o wide<br \/>\n\u200b<br \/>\n# 6. \u5bfc\u51fa\u76d8\u70b9\u7ed3\u679c<br \/>\nkubectl get pv -o yaml &gt; \/tmp\/pv_inventory_$(date &#043;%Y%m%d).yaml<br \/>\nkubectl get pvc &#8211;all-namespaces -o yaml &gt; \/tmp\/pvc_inventory_$(date &#043;%Y%m%d).yaml<br \/>\necho &#034;\u76d8\u70b9\u7ed3\u679c\u5df2\u5bfc\u51fa\u5230 \/tmp\/&#034;<br \/>\n\u200b <\/p>\n<p>2. \u5236\u5b9a\u64cd\u4f5c\u65b9\u6848\u4e0e\u5907\u4efd\u9632\u62a4<\/p>\n<p># 1. \u5907\u4efd\u5f53\u524d\u6240\u6709\u5b58\u50a8\u8d44\u6e90\u914d\u7f6e&#xff08;\u64cd\u4f5c\u524d\u5fc5\u505a&#xff09;<br \/>\nkubectl get pv -o yaml &gt; \/tmp\/pv_backup_$(date &#043;%Y%m%d_%H%M%S).yaml<br \/>\nkubectl get pvc &#8211;all-namespaces -o yaml &gt; \/tmp\/pvc_backup_$(date &#043;%Y%m%d_%H%M%S).yaml<br \/>\nkubectl get storageclass -o yaml &gt; \/tmp\/sc_backup_$(date &#043;%Y%m%d_%H%M%S).yaml<br \/>\nkubectl get resourcequota &#8211;all-namespaces -o yaml &gt; \/tmp\/quota_backup_$(date &#043;%Y%m%d_%H%M%S).yaml<br \/>\n\u200b<br \/>\n# 2. \u5907\u4efd\u5b58\u50a8\u540e\u7aef\u6570\u636e&#xff08;\u6839\u636e\u5b58\u50a8\u7c7b\u578b\u6267\u884c&#xff09;<br \/>\n# NFS \u5907\u4efd\u793a\u4f8b<br \/>\n# ssh root&#064;nfs-server &#034;tar czf \/data\/nfs_backup_$(date &#043;%Y%m%d).tar.gz \/data\/nfs\/shared\/&#034;<br \/>\n# Ceph \u5907\u4efd\u793a\u4f8b<br \/>\n# ceph osd pool get volumes size<br \/>\n# rbd snap create volumes\/pvc-xxx&#064;snapshot_$(date &#043;%Y%m%d)<br \/>\n\u200b<br \/>\n# 3. \u5236\u5b9a\u64cd\u4f5c\u65b9\u6848<br \/>\ncat &gt; \/tmp\/storage_operation_plan.md &lt;&lt; &#039;EOF&#039;<br \/>\n# \u5b58\u50a8\u64cd\u4f5c\u65b9\u6848<br \/>\n## \u4e00\u3001\u64cd\u4f5c\u76ee\u6807<br \/>\n## \u4e8c\u3001\u5f71\u54cd\u8303\u56f4\u8bc4\u4f30<br \/>\n## \u4e09\u3001\u64cd\u4f5c\u6b65\u9aa4\u4e0e\u65f6\u95f4\u7a97\u53e3<br \/>\n## \u56db\u3001\u56de\u6eda\u65b9\u6848<br \/>\n## \u4e94\u3001\u9a8c\u8bc1\u6807\u51c6<br \/>\n## \u516d\u3001\u98ce\u9669\u70b9\u4e0e\u5e94\u5bf9\u63aa\u65bd<br \/>\nEOF<br \/>\necho &#034;\u64cd\u4f5c\u65b9\u6848\u6a21\u677f\u5df2\u521b\u5efa&#034;<br \/>\n\u200b<br \/>\n# 4. \u786e\u8ba4\u4e1a\u52a1\u7a97\u53e3&#xff08;\u4f4e\u5cf0\u671f\u64cd\u4f5c&#xff09;<br \/>\necho &#034;\u5f53\u524d\u65f6\u95f4: $(date)&#034;<br \/>\necho &#034;\u5efa\u8bae\u5728\u4e1a\u52a1\u4f4e\u5cf0\u671f\u6267\u884c\u5b58\u50a8\u64cd\u4f5c&#xff0c;\u907f\u514d\u5f71\u54cd\u4e1a\u52a1&#034;<br \/>\n\u200b<br \/>\n# 5. \u901a\u77e5\u76f8\u5173\u4e1a\u52a1\u65b9<br \/>\n# echo &#034;\u5b58\u50a8\u8fd0\u7ef4\u64cd\u4f5c\u901a\u77e5&#034; | mail -s &#034;\u5b58\u50a8\u8fd0\u7ef4\u901a\u77e5&#034; admin&#064;example.com<br \/>\n\u200b <\/p>\n<p>3. \u6267\u884c\u5b58\u50a8\u8d44\u6e90\u89c4\u8303\u5316\u64cd\u4f5c<\/p>\n<p># 1. \u6279\u91cf\u8865\u5168 PV\/PVC \u6807\u7b7e&#xff08;\u793a\u4f8b&#xff09;<br \/>\ncat &gt; \/tmp\/batch_label_storage.sh &lt;&lt; &#039;SCRIPT&#039;<br \/>\n#!\/bin\/bash<br \/>\n# \u4e3a\u6240\u6709 PV \u8865\u5168\u6807\u7b7e<br \/>\nfor pv in $(kubectl get pv -o jsonpath&#061;&#039;{.items[*].metadata.name}&#039;); do<br \/>\n \u00a0sc&#061;$(kubectl get pv $pv -o jsonpath&#061;&#039;{.spec.storageClassName}&#039;)<br \/>\n  kubectl label pv $pv \u00a0 \u00a0 storage-type&#061;$sc \u00a0 \u00a0 managed-by&#061;storage-team \u00a0 \u00a0 env&#061;prod \u00a0 \u00a0 &#8211;overwrite 2&gt;\/dev\/null<br \/>\ndone<br \/>\n# \u4e3a\u6240\u6709 PVC \u8865\u5168\u6807\u7b7e<br \/>\nfor ns in $(kubectl get ns -o jsonpath&#061;&#039;{.items[*].metadata.name}&#039;); do<br \/>\n \u00a0for pvc in $(kubectl get pvc -n $ns -o jsonpath&#061;&#039;{.items[*].metadata.name}&#039; 2&gt;\/dev\/null); do<br \/>\n \u00a0  kubectl label pvc $pvc -n $ns \u00a0 \u00a0 \u00a0 namespace&#061;$ns \u00a0 \u00a0 \u00a0 managed-by&#061;storage-team \u00a0 \u00a0 \u00a0 env&#061;prod \u00a0 \u00a0 \u00a0 &#8211;overwrite 2&gt;\/dev\/null<br \/>\n \u00a0done<br \/>\ndone<br \/>\necho &#034;\u6807\u7b7e\u6279\u91cf\u8865\u5168\u5b8c\u6210&#034;<br \/>\nSCRIPT<br \/>\nchmod &#043;x \/tmp\/batch_label_storage.sh<br \/>\n# \/tmp\/batch_label_storage.sh<br \/>\n\u200b<br \/>\n# 2. \u89c4\u8303\u5316 StorageClass \u53c2\u6570&#xff08;\u793a\u4f8b&#xff09;<br \/>\n# kubectl patch storageclass &lt;sc-name&gt; -p &#039;{&#034;allowVolumeExpansion&#034;: true}&#039;<br \/>\n\u200b<br \/>\n# 3. \u8bbe\u7f6e ResourceQuota&#xff08;\u793a\u4f8b&#xff09;<br \/>\n# cat &gt; \/tmp\/quota.yaml &lt;&lt; &#039;EOF&#039;<br \/>\n# apiVersion: v1<br \/>\n# kind: ResourceQuota<br \/>\n# metadata:<br \/>\n# \u00a0 name: storage-quota<br \/>\n# \u00a0 namespace: &lt;namespace&gt;<br \/>\n# spec:<br \/>\n# \u00a0 hard:<br \/>\n# \u00a0 \u00a0 requests.storage: &#034;500Gi&#034;<br \/>\n# \u00a0 \u00a0 persistentvolumeclaims: &#034;20&#034;<br \/>\n# EOF<br \/>\n# kubectl apply -f \/tmp\/quota.yaml<br \/>\n\u200b<br \/>\n# 4. \u6e05\u7406\u95f2\u7f6e\u8d44\u6e90&#xff08;\u5148\u786e\u8ba4\u65e0\u4e1a\u52a1\u5f15\u7528&#xff09;<br \/>\n# \u8bc6\u522b\u65e0 Pod \u6302\u8f7d\u7684 PVC<br \/>\n# for ns in $(kubectl get ns -o jsonpath&#061;&#039;{.items[*].metadata.name}&#039;); do<br \/>\n# \u00a0 for pvc in $(kubectl get pvc -n $ns -o jsonpath&#061;&#039;{.items[*].metadata.name}&#039; 2&gt;\/dev\/null); do<br \/>\n# \u00a0 \u00a0 used&#061;$(kubectl get pod -n $ns -o json 2&gt;\/dev\/null | grep -c &#034;persistentVolumeClaim.*$pvc&#034;)<br \/>\n# \u00a0 \u00a0 if [ &#034;$used&#034; -eq 0 ]; then<br \/>\n# \u00a0 \u00a0 \u00a0 echo &#034;\u95f2\u7f6ePVC: $ns\/$pvc&#034;<br \/>\n# \u00a0 \u00a0 fi<br \/>\n# \u00a0 done<br \/>\n# done<br \/>\n# \u786e\u8ba4\u540e\u5220\u9664: kubectl delete pvc &lt;name&gt; -n &lt;namespace&gt;<br \/>\n\u200b<br \/>\n# 5. \u6267\u884c\u5177\u4f53\u64cd\u4f5c&#xff08;\u6839\u636e\u6807\u9898\u8c03\u6574&#xff09;<br \/>\necho &#034;\u6267\u884c\u5b58\u50a8\u8d44\u6e90\u89c4\u8303\u5316\u5177\u4f53\u64cd\u4f5c&#8230;&#034;<br \/>\necho &#034;\u8bf7\u6839\u636e\u64cd\u4f5c\u65b9\u6848\u6267\u884c\u5177\u4f53\u6b65\u9aa4&#034;<br \/>\n\u200b <\/p>\n<p>4. \u5b58\u50a8\u6027\u80fd\u8c03\u4f18\u4e0e\u53c2\u6570\u4f18\u5316<\/p>\n<p># 1. \u68c0\u67e5\u5f53\u524d\u5b58\u50a8\u6027\u80fd\u6307\u6807<br \/>\nkubectl top nodes<br \/>\n# \u68c0\u67e5\u78c1\u76d8 IO&#xff08;\u9700\u8282\u70b9\u6743\u9650&#xff09;<br \/>\n# kubectl debug node\/&lt;node-name&gt; -it &#8211;image&#061;busybox &#8212; iostat -x 1 5<br \/>\n\u200b<br \/>\n# 2. \u5b58\u50a8\u6302\u8f7d\u53c2\u6570\u8c03\u4f18&#xff08;NFS \u793a\u4f8b&#xff09;<br \/>\n# mount -o hard,nfsvers&#061;4.1,rsize&#061;1048576,wsize&#061;1048576,timeo&#061;600,retrans&#061;3 nfs-server:\/share \/mnt\/nfs<br \/>\n\u200b<br \/>\n# 3. \u5185\u6838 IO \u8c03\u5ea6\u5668\u8c03\u4f18<br \/>\n# \u67e5\u770b\u5f53\u524d\u8c03\u5ea6\u5668<br \/>\n# cat \/sys\/block\/sda\/queue\/scheduler<br \/>\n# \u8bbe\u7f6e\u4e3a deadline&#xff08;\u9002\u5408 SSD&#xff09;\u6216 cfq&#xff08;\u9002\u5408 HDD&#xff09;<br \/>\n# echo deadline &gt; \/sys\/block\/sda\/queue\/scheduler<br \/>\n\u200b<br \/>\n# 4. \u6587\u4ef6\u7cfb\u7edf\u6302\u8f7d\u53c2\u6570\u4f18\u5316<br \/>\n# ext4: noatime,nodiratime,barrier&#061;0<br \/>\n# xfs: noatime,nodiratime,allocsize&#061;64m<br \/>\n# mount -o remount,noatime,nodiratime \/dev\/sdb1 \/data<br \/>\n\u200b<br \/>\n# 5. StorageClass \u53c2\u6570\u8c03\u4f18<br \/>\n# kubectl patch storageclass &lt;sc-name&gt; -p &#039;{&#034;parameters&#034;: {&#034;volumeBindingMode&#034;: &#034;WaitForFirstConsumer&#034;}}&#039;<br \/>\n\u200b<br \/>\n# 6. \u9a8c\u8bc1\u8c03\u4f18\u6548\u679c<br \/>\n# dd if&#061;\/dev\/zero of&#061;\/mnt\/storage\/testfile bs&#061;1G count&#061;1 oflag&#061;direct<br \/>\n# dd if&#061;\/mnt\/storage\/testfile of&#061;\/dev\/null bs&#061;1G iflag&#061;direct<br \/>\n# \u6e05\u7406\u6d4b\u8bd5\u6587\u4ef6<br \/>\n# rm -f \/mnt\/storage\/testfile<br \/>\n\u200b <\/p>\n<p>5. \u5b58\u50a8\u76d1\u63a7\u544a\u8b66\u4e0e\u5de1\u68c0<\/p>\n<p># 1. \u68c0\u67e5\u5b58\u50a8\u76f8\u5173\u76d1\u63a7\u6307\u6807<br \/>\n# PV\/PVC \u72b6\u6001<br \/>\nkubectl get pv &#8211;no-headers | awk &#039;{print $1, $2}&#039; | sort | uniq -c<br \/>\nkubectl get pvc &#8211;all-namespaces &#8211;no-headers | awk &#039;{print $2, $3}&#039; | sort | uniq -c<br \/>\n\u200b<br \/>\n# 2. \u5b58\u50a8\u5bb9\u91cf\u76d1\u63a7&#xff08;\u9700\u8282\u70b9\u6743\u9650\u6216\u76d1\u63a7\u7cfb\u7edf&#xff09;<br \/>\n# df -h | grep -E &#039;\/data|\/mnt|nfs|ceph&#039;<br \/>\n# \u68c0\u67e5 PVC \u5b9e\u9645\u4f7f\u7528\u91cf&#xff08;\u9700\u8fdb\u5165 Pod&#xff09;<br \/>\n# kubectl exec -it &lt;pod-name&gt; &#8212; df -h | grep -E &#039;\/data|\/mnt&#039;<br \/>\n\u200b<br \/>\n# 3. \u914d\u7f6e\u5b58\u50a8\u544a\u8b66\u89c4\u5219&#xff08;Prometheus \u793a\u4f8b&#xff09;<br \/>\ncat &gt; \/tmp\/storage_alerts.yaml &lt;&lt; &#039;EOF&#039;<br \/>\ngroups:<br \/>\n&#8211; name: storage-alerts<br \/>\n  rules:<br \/>\n \u00a0&#8211; alert: PVCPending<br \/>\n \u00a0  expr: kube_persistentvolumeclaim_status_phase{phase&#061;&#034;Pending&#034;} &gt; 0<br \/>\n \u00a0 \u00a0for: 5m<br \/>\n \u00a0  labels:<br \/>\n \u00a0 \u00a0  severity: warning<br \/>\n \u00a0  annotations:<br \/>\n \u00a0 \u00a0  summary: &#034;PVC \u5904\u4e8e Pending \u72b6\u6001&#034;<br \/>\n \u00a0&#8211; alert: StorageCapacityHigh<br \/>\n \u00a0  expr: (1 &#8211; kubelet_volume_stats_available_bytes \/ kubelet_volume_stats_capacity_bytes) * 100 &gt; 85<br \/>\n \u00a0 \u00a0for: 5m<br \/>\n \u00a0  labels:<br \/>\n \u00a0 \u00a0  severity: critical<br \/>\n \u00a0  annotations:<br \/>\n \u00a0 \u00a0  summary: &#034;\u5b58\u50a8\u5377\u4f7f\u7528\u7387\u8d85\u8fc7 85%&#034;<br \/>\nEOF<br \/>\necho &#034;\u544a\u8b66\u89c4\u5219\u6a21\u677f\u5df2\u521b\u5efa&#034;<br \/>\n\u200b<br \/>\n# 4. \u5b9a\u65f6\u5de1\u68c0\u811a\u672c<br \/>\ncat &gt; \/tmp\/storage_audit.sh &lt;&lt; &#039;SCRIPT&#039;<br \/>\n#!\/bin\/bash<br \/>\necho &#034;&#061;&#061;&#061; \u5b58\u50a8\u5de1\u68c0 $(date) &#061;&#061;&#061;&#034;<br \/>\necho &#034;&#8212; PV \u72b6\u6001\u7edf\u8ba1 &#8212;&#034;<br \/>\nkubectl get pv &#8211;no-headers | awk &#039;{print $2}&#039; | sort | uniq -c<br \/>\necho &#034;&#8212; PVC \u72b6\u6001\u7edf\u8ba1 &#8212;&#034;<br \/>\nkubectl get pvc &#8211;all-namespaces &#8211;no-headers | awk &#039;{print $3}&#039; | sort | uniq -c<br \/>\necho &#034;&#8212; StorageClass \u5217\u8868 &#8212;&#034;<br \/>\nkubectl get storageclass &#8211;no-headers<br \/>\necho &#034;&#8212; \u5f02\u5e38 PVC &#8212;&#034;<br \/>\nkubectl get pvc &#8211;all-namespaces &#8211;field-selector&#061;status.phase&#061;Pending -o wide 2&gt;\/dev\/null<br \/>\necho &#034;&#8212; \u5f02\u5e38 PV &#8212;&#034;<br \/>\nkubectl get pv &#8211;field-selector&#061;status.phase&#061;Released -o wide 2&gt;\/dev\/null<br \/>\nkubectl get pv &#8211;field-selector&#061;status.phase&#061;Failed -o wide 2&gt;\/dev\/null<br \/>\necho &#034;&#061;&#061;&#061; \u5de1\u68c0\u5b8c\u6210 &#061;&#061;&#061;&#034;<br \/>\nSCRIPT<br \/>\nchmod &#043;x \/tmp\/storage_audit.sh<br \/>\n\/tmp\/storage_audit.sh<br \/>\n\u200b<br \/>\n# 5. \u8bbe\u7f6e\u5b9a\u65f6\u5de1\u68c0&#xff08;CronJob \u6216 crontab&#xff09;<br \/>\n# crontab -e<br \/>\n# 0 2 * * * \/tmp\/storage_audit.sh &gt;&gt; \/var\/log\/storage_audit.log 2&gt;&amp;1<br \/>\n\u200b <\/p>\n<p>6. \u9a8c\u8bc1\u64cd\u4f5c\u7ed3\u679c\u4e0e\u4e1a\u52a1\u65e0\u611f\u77e5<\/p>\n<p># 1. \u9a8c\u8bc1 PV\/PVC \u72b6\u6001<br \/>\nkubectl get pv -o wide | head -20<br \/>\nkubectl get pvc &#8211;all-namespaces -o wide | head -20<br \/>\n# \u9884\u671f&#xff1a;\u65e0 Pending\/Failed\/Released \u5f02\u5e38\u72b6\u6001&#xff08;\u6216\u5df2\u786e\u8ba4\u4fdd\u7559&#xff09;<br \/>\n\u200b<br \/>\n# 2. \u9a8c\u8bc1 StorageClass \u914d\u7f6e<br \/>\nkubectl get storageclass -o wide<br \/>\nkubectl describe storageclass &lt;sc-name&gt; | grep -E &#039;Parameters|Reclaim|Expansion|Mount&#039;<br \/>\n# \u9884\u671f&#xff1a;\u53c2\u6570\u5df2\u89c4\u8303\u5316&#xff0c;allowVolumeExpansion \u7b26\u5408\u9884\u671f<br \/>\n\u200b<br \/>\n# 3. \u9a8c\u8bc1 ResourceQuota<br \/>\nkubectl get resourcequota &#8211;all-namespaces -o wide<br \/>\n# \u9884\u671f&#xff1a;\u5404\u547d\u540d\u7a7a\u95f4\u914d\u989d\u5df2\u8bbe\u7f6e&#xff0c;\u4f7f\u7528\u91cf\u6b63\u5e38<br \/>\n\u200b<br \/>\n# 4. \u9a8c\u8bc1\u6807\u7b7e\u8865\u5168<br \/>\nkubectl get pv -L storage-type,managed-by,env &#8211;no-headers | head -10<br \/>\nkubectl get pvc &#8211;all-namespaces -L namespace,managed-by,env &#8211;no-headers | head -10<br \/>\n# \u9884\u671f&#xff1a;\u6807\u7b7e\u5df2\u8865\u5168<br \/>\n\u200b<br \/>\n# 5. \u4e1a\u52a1\u65e0\u611f\u77e5\u9a8c\u8bc1&#xff08;\u62bd\u67e5\u6b63\u5728\u4f7f\u7528\u7684 PVC&#xff09;<br \/>\necho &#034;&#061;&#061;&#061; \u6b63\u5728\u4f7f\u7528\u7684 PVC&#xff08;\u62bd\u67e5&#xff09;&#061;&#061;&#061;&#034;<br \/>\nkubectl get pvc &#8211;all-namespaces -o wide | grep Bound | head -5<br \/>\necho &#034;&#061;&#061;&#061; \u5173\u8054 Pod \u72b6\u6001&#xff08;\u62bd\u67e5&#xff09;&#061;&#061;&#061;&#034;<br \/>\nkubectl get pod &#8211;all-namespaces -o wide | grep Running | head -10<br \/>\n# \u9884\u671f&#xff1a;\u4e1a\u52a1 Pod \u5747\u6b63\u5e38 Running&#xff0c;\u65e0\u56e0\u5b58\u50a8\u64cd\u4f5c\u5bfc\u81f4\u7684\u5f02\u5e38<br \/>\n\u200b<br \/>\n# 6. \u5b58\u50a8\u8bfb\u5199\u9a8c\u8bc1&#xff08;\u8fdb\u5165\u4e1a\u52a1 Pod \u6d4b\u8bd5&#xff09;<br \/>\n# kubectl exec -it &lt;pod-name&gt; &#8212; touch \/data\/test_write_$(date &#043;%Y%m%d).txt<br \/>\n# kubectl exec -it &lt;pod-name&gt; &#8212; ls -la \/data\/test_write_*.txt<br \/>\n# kubectl exec -it &lt;pod-name&gt; &#8212; rm -f \/data\/test_write_*.txt<br \/>\n# \u9884\u671f&#xff1a;\u8bfb\u5199\u6b63\u5e38&#xff0c;\u65e0\u6743\u9650\u6216\u6302\u8f7d\u95ee\u9898<br \/>\n\u200b<br \/>\n# 7. \u751f\u6210\u64cd\u4f5c\u62a5\u544a<br \/>\necho &#034;&#061;&#061;&#061; \u5b58\u50a8\u64cd\u4f5c\u62a5\u544a &#061;&#061;&#061;&#034; &gt; \/tmp\/storage_operation_report.txt<br \/>\necho &#034;\u64cd\u4f5c\u65f6\u95f4: $(date)&#034; &gt;&gt; \/tmp\/storage_operation_report.txt<br \/>\necho &#034;\u64cd\u4f5c\u524d PV \u6570\u91cf: $(cat \/tmp\/pv_backup_*.yaml 2&gt;\/dev\/null | grep -c &#039;kind: PersistentVolume&#039;)&#034; &gt;&gt; \/tmp\/storage_operation_report.txt<br \/>\necho &#034;\u64cd\u4f5c\u540e PV \u6570\u91cf: $(kubectl get pv &#8211;no-headers | wc -l)&#034; &gt;&gt; \/tmp\/storage_operation_report.txt<br \/>\necho &#034;\u64cd\u4f5c\u524d PVC \u6570\u91cf: $(cat \/tmp\/pvc_backup_*.yaml 2&gt;\/dev\/null | grep -c &#039;kind: PersistentVolumeClaim&#039;)&#034; &gt;&gt; \/tmp\/storage_operation_report.txt<br \/>\necho &#034;\u64cd\u4f5c\u540e PVC \u6570\u91cf: $(kubectl get pvc &#8211;all-namespaces &#8211;no-headers | wc -l)&#034; &gt;&gt; \/tmp\/storage_operation_report.txt<br \/>\necho &#034;\u5f02\u5e38\u72b6\u6001 PV: $(kubectl get pv &#8211;field-selector&#061;status.phase&#061;Released &#8211;no-headers 2&gt;\/dev\/null | wc -l) Released, $(kubectl get pv &#8211;field-selector&#061;status.phase&#061;Failed &#8211;no-headers 2&gt;\/dev\/null | wc -l) Failed&#034; &gt;&gt; \/tmp\/storage_operation_report.txt<br \/>\necho &#034;\u5f02\u5e38\u72b6\u6001 PVC: $(kubectl get pvc &#8211;all-namespaces &#8211;field-selector&#061;status.phase&#061;Pending &#8211;no-headers 2&gt;\/dev\/null | wc -l) Pending&#034; &gt;&gt; \/tmp\/storage_operation_report.txt<br \/>\ncat \/tmp\/storage_operation_report.txt<br \/>\n\u200b <\/p>\n<h3>\u9a8c\u8bc1\u6d41\u7a0b<\/h3>\n<p># 1. PV \u72b6\u6001\u9a8c\u8bc1<br \/>\nkubectl get pv -o wide<br \/>\n# \u9884\u671f&#xff1a;\u6240\u6709 PV \u72b6\u6001\u6b63\u5e38&#xff08;Bound\/Available&#xff09;&#xff0c;\u65e0 Failed<br \/>\n\u200b<br \/>\n# 2. PVC \u72b6\u6001\u9a8c\u8bc1<br \/>\nkubectl get pvc &#8211;all-namespaces -o wide<br \/>\n# \u9884\u671f&#xff1a;\u6240\u6709 PVC \u72b6\u6001\u4e3a Bound&#xff0c;\u65e0 Pending\/Lost<br \/>\n\u200b<br \/>\n# 3. StorageClass \u9a8c\u8bc1<br \/>\nkubectl get storageclass -o wide<br \/>\n# \u9884\u671f&#xff1a;StorageClass \u5b58\u5728&#xff0c;\u53c2\u6570\u7b26\u5408\u89c4\u8303<br \/>\n\u200b<br \/>\n# 4. \u4e1a\u52a1 Pod \u9a8c\u8bc1<br \/>\nkubectl get pod &#8211;all-namespaces -o wide | grep -v Running | head -10<br \/>\n# \u9884\u671f&#xff1a;\u65e0\u56e0\u5b58\u50a8\u95ee\u9898\u5bfc\u81f4\u7684\u5f02\u5e38 Pod<br \/>\n\u200b<br \/>\n# 5. \u5b58\u50a8\u8bfb\u5199\u9a8c\u8bc1<br \/>\n# kubectl exec -it &lt;pod&gt; &#8212; touch \/data\/test.txt &amp;&amp; echo &#034;\u8bfb\u5199\u6b63\u5e38&#034;<br \/>\n# \u9884\u671f&#xff1a;\u8bfb\u5199\u64cd\u4f5c\u6210\u529f<br \/>\n\u200b<br \/>\n# 6. \u76d1\u63a7\u6307\u6807\u9a8c\u8bc1<br \/>\n# \u68c0\u67e5 Prometheus \u5b58\u50a8\u6307\u6807\u662f\u5426\u6b63\u5e38\u91c7\u96c6<br \/>\n# \u9884\u671f&#xff1a;\u5b58\u50a8\u5bb9\u91cf\u3001IOPS\u3001\u5ef6\u8fdf\u7b49\u6307\u6807\u53ef\u67e5\u8be2<br \/>\n\u200b<br \/>\n# 7. \u64cd\u4f5c\u62a5\u544a\u9a8c\u8bc1<br \/>\ncat \/tmp\/storage_operation_report.txt<br \/>\n# \u9884\u671f&#xff1a;\u62a5\u544a\u5305\u542b\u64cd\u4f5c\u524d\u540e\u5bf9\u6bd4&#xff0c;\u65e0\u5f02\u5e38\u72b6\u6001 <\/p>\n<h3>\u6392\u9519\u65b9\u6848<\/h3>\n<ul>\n<li>\n<p>\u5feb\u7167\u521b\u5efa\u5931\u8d25&#xff1a;\u68c0\u67e5 VolumeSnapshotClass\u3001CSI \u9a71\u52a8\u5feb\u7167\u652f\u6301\u3001\u5b58\u50a8\u540e\u7aef\u5feb\u7167\u529f\u80fd\u3001PV \u72b6\u6001\u3001RBAC \u6743\u9650<\/p>\n<\/li>\n<li>\n<p>\u5feb\u7167\u6570\u636e\u635f\u574f&#xff1a;\u68c0\u67e5\u5feb\u7167\u521b\u5efa\u65f6\u5e94\u7528\u4e00\u81f4\u6027\u3001\u5b58\u50a8\u540e\u7aef\u5feb\u7167\u5b8c\u6574\u6027\u3001\u5feb\u7167\u6062\u590d\u9a8c\u8bc1\u3001\u5b9a\u671f\u6821\u9a8c<\/p>\n<\/li>\n<li>\n<p>\u5feb\u7167\u5360\u7528\u7a7a\u95f4\u8fc7\u5927&#xff1a;\u68c0\u67e5\u5feb\u7167\u4fdd\u7559\u7b56\u7565\u3001\u8fc7\u671f\u5feb\u7167\u6e05\u7406\u3001\u5feb\u7167\u589e\u91cf\u673a\u5236\u3001\u5b58\u50a8\u5bb9\u91cf\u89c4\u5212<\/p>\n<\/li>\n<li>\n<p>\u514b\u9686\u5377\u521b\u5efa\u5931\u8d25&#xff1a;\u68c0\u67e5\u5feb\u7167\u72b6\u6001\u3001\u5b58\u50a8\u540e\u7aef\u514b\u9686\u652f\u6301\u3001\u514b\u9686\u5377\u53c2\u6570\u3001\u5bb9\u91cf\u3001StorageClass<\/p>\n<\/li>\n<li>\n<p>\u514b\u9686\u5377\u6570\u636e\u9694\u79bb\u95ee\u9898&#xff1a;\u68c0\u67e5\u514b\u9686\u5377\u8bfb\u5199\u6743\u9650\u3001\u6570\u636e\u72ec\u7acb\u6027\u3001\u4e0e\u6e90\u5377\u5173\u8054\u3001\u5220\u9664\u5f71\u54cd<\/p>\n<\/li>\n<li>\n<p>\u5feb\u7167\u6062\u590d\u6570\u636e\u4e0d\u4e00\u81f4&#xff1a;\u68c0\u67e5\u6062\u590d\u6d41\u7a0b\u3001\u5e94\u7528\u505c\u673a\u3001\u5feb\u7167\u65f6\u95f4\u70b9\u3001\u6570\u636e\u6821\u9a8c\u3001\u6062\u590d\u540e\u9a8c\u8bc1<\/p>\n<\/li>\n<li>\n<p>\u5feb\u7167\u8fc7\u671f\u672a\u81ea\u52a8\u6e05\u7406&#xff1a;\u68c0\u67e5 VolumeSnapshot \u4fdd\u7559\u7b56\u7565\u3001\u5b9a\u65f6\u6e05\u7406\u4efb\u52a1\u3001CSI \u9a71\u52a8\u652f\u6301\u3001\u624b\u52a8\u6e05\u7406<\/p>\n<\/li>\n<li>\n<p>\u5feb\u7167\u6279\u91cf\u7ba1\u7406\u56f0\u96be&#xff1a;\u68c0\u67e5\u5feb\u7167\u547d\u540d\u89c4\u8303\u3001\u6807\u7b7e\u7ba1\u7406\u3001\u6279\u91cf\u811a\u672c\u3001\u53f0\u8d26\u8bb0\u5f55\u3001\u81ea\u52a8\u5316\u5de5\u5177<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd<br \/>\n\u6280\u672f\u6808&#xff1a;Kubernetes v1.32.13  Rocky Linux 8.6  \u5b58\u50a8\u5feb\u7167\u4e0e\u514b\u9686  Containerd 1.7.x<br \/>\n\u64cd\u4f5c\u73af\u5883 \/ \u5bf9\u63a5\u539f\u7406 \/ \u8be6\u7ec6\u6b65\u9aa4 \/ \u5b8c\u6574\u547d\u4ee4 \/ \u914d\u7f6e\u6587\u4ef6 \/ \u9a8c\u8bc1\u6d41\u7a0b \/ \u6392\u9519\u65b9\u6848<br \/>\nK8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd<br \/>\n\u64cd\u4f5c\u73af\u5883 K8s \u96c6\u7fa4 3 \u8282\u70b9&#xff1a;k8s-master(192.168.1.10), k8s-node1(192.168.1.11<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[120,58,763,78],"topic":[],"class_list":["post-98208","post","type-post","status-publish","format-standard","hentry","category-server","tag-kubernetes","tag-linux","tag-763","tag-78"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/98208.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd \u6280\u672f\u6808&#xff1a;Kubernetes v1.32.13 Rocky Linux 8.6 \u5b58\u50a8\u5feb\u7167\u4e0e\u514b\u9686 Containerd 1.7.x \u64cd\u4f5c\u73af\u5883 \/ \u5bf9\u63a5\u539f\u7406 \/ \u8be6\u7ec6\u6b65\u9aa4 \/ \u5b8c\u6574\u547d\u4ee4 \/ \u914d\u7f6e\u6587\u4ef6 \/ \u9a8c\u8bc1\u6d41\u7a0b \/ \u6392\u9519\u65b9\u6848 K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd \u64cd\u4f5c\u73af\u5883 K8s \u96c6\u7fa4 3 \u8282\u70b9&#xff1a;k8s-master(192.168.1.10), k8s-node1(192.168.1.11\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/98208.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-31T04:32:53+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/98208.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/98208.html\",\"name\":\"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-31T04:32:53+00:00\",\"dateModified\":\"2026-08-31T04:32:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/98208.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/98208.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/98208.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/98208.html","og_locale":"zh_CN","og_type":"article","og_title":"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd \u6280\u672f\u6808&#xff1a;Kubernetes v1.32.13 Rocky Linux 8.6 \u5b58\u50a8\u5feb\u7167\u4e0e\u514b\u9686 Containerd 1.7.x \u64cd\u4f5c\u73af\u5883 \/ \u5bf9\u63a5\u539f\u7406 \/ \u8be6\u7ec6\u6b65\u9aa4 \/ \u5b8c\u6574\u547d\u4ee4 \/ \u914d\u7f6e\u6587\u4ef6 \/ \u9a8c\u8bc1\u6d41\u7a0b \/ \u6392\u9519\u65b9\u6848 K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd \u64cd\u4f5c\u73af\u5883 K8s \u96c6\u7fa4 3 \u8282\u70b9&#xff1a;k8s-master(192.168.1.10), k8s-node1(192.168.1.11","og_url":"https:\/\/www.wsisp.com\/helps\/98208.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-31T04:32:53+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/98208.html","url":"https:\/\/www.wsisp.com\/helps\/98208.html","name":"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-31T04:32:53+00:00","dateModified":"2026-08-31T04:32:53+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/98208.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/98208.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/98208.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"K8s\u96c6\u7fa4\u5206\u5e03\u5f0f\u5b58\u50a8\u5feb\u7167\u9ad8\u9636\u8fd0\u7ef4\u6536\u5b98\u5b9e\u64cd"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/98208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=98208"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/98208\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=98208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=98208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=98208"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=98208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}