Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menunjukkan cara mengonfigurasi volume lokal untuk cluster Google Distributed Cloud.
Cluster Google Distributed Cloud menyediakan dua opsi untuk mengonfigurasi
PV lokal)
di cluster: berbagi LVP dan pemasangan node LVP. Berbagi LVP menggunakan direktori dalam
sistem file bersama, sedangkan pemasangan node LVP menggunakan disk khusus.
Pangsa LVP
Class penyimpanan ini membuat PV lokal yang didukung oleh subdirektori dalam sistem file lokal
dan bersama di setiap node dalam cluster. Subdirektori ini
dibuat secara otomatis selama pembuatan cluster. Beban kerja yang menggunakan class penyimpanan
ini akan berbagi kapasitas dan IOPS karena PV didukung oleh sistem file bersama
yang sama. Untuk isolasi yang lebih baik, sebaiknya konfigurasikan disk melalui pemasangan node
LVP.
Mengonfigurasi pembagian LVP
Opsional: Sebelum pembuatan cluster, pasang disk menggunakan jalur yang dikonfigurasi
sebagai titik pemasangan sehingga PV yang dibuat akan berbagi kapasitas disk baru dan
diisolasi dari disk booting.
Tentukan hal berikut di bagian lvpShare dalam CR cluster:
path: Jalur komputer host di setiap host tempat subdirektori
dibuat. PV lokal dibuat untuk setiap subdirektori. Jalur defaultnya
adalah /mnt/localpv-share.
storageClassName: Class penyimpanan yang digunakan untuk membuat PV selama
pembuatan cluster. Nilai defaultnya adalah local-shared.
numPVUnderSharedPath: Jumlah subdirektori yang akan dibuat di bagian path.
Nilai defaultnya adalah 5.
Konfigurasi terlihat mirip dengan yang berikut ini:
PV dibuat dengan class penyimpanan yang ditentukan di storageClassName. Jumlah
total PV lokal yang dibuat di cluster adalah numPVUnderSharedPath
dikalikan dengan jumlah node.
Penopang node LVP
Class penyimpanan ini membuat PV lokal untuk setiap disk yang dipasang di direktori yang dikonfigurasi. Setiap PV dipetakan ke disk dengan kapasitas yang sama dengan kapasitas
disk yang mendasarinya. Jumlah total PV lokal yang dibuat di cluster adalah jumlah
disk yang dipasang di bawah jalur di semua node. Penyambungan tambahan dapat ditambahkan
setelah pembuatan cluster.
Mengonfigurasi pemasangan node LVP
Pada node yang memiliki disk tambahan untuk PV, format dan pasang setiap disk di
jalur. Hal ini juga dapat dilakukan sebelum atau setelah pembuatan cluster. Lihat
praktik terbaik.
Cantumkan disk dan temukan disk yang ingin dipasang:
sudo lsblk
Format disk, misalnya dengan satu sistem file ext4:
Tambahkan disk ke file /etc/fstab, sehingga perangkat otomatis
dipasang lagi saat instance dimulai ulang:
# Backup of your current /etc/fstab file
sudo cp /etc/fstab /etc/fstab.backup
# Use the blkid command to find the UUID for the zonal persistent disk
sudo blkid /dev/DEVICE_ID
# Edit /etc/fstab file: create an entry that includes the UUID
UUID=UUID_VALUE /mnt/localpv-disk/MNT_DIR ext4 discard,defaults,NOFAIL_OPTION 0 2
Tentukan hal berikut di bagian lvpNodeMounts dalam CR cluster:
path: Jalur mesin host untuk setiap pemasangan tempat disk yang dipasang
ditemukan dan PV lokal dibuat. Jalur default-nya adalah
/mnt/localpv-disk.
storageClassName: Class penyimpanan yang digunakan untuk membuat PV selama
pembuatan cluster. Nilai defaultnya adalah local-disks.
PV dibuat dengan class penyimpanan yang ditentukan di storageClassName. Jumlah
total PV yang dibuat adalah jumlah disk yang dipasang di path
di semua node.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-01 UTC."],[],[],null,["This page shows you how to configure local volumes for Google Distributed Cloud\nclusters.\n\nGoogle Distributed Cloud clusters provide two options for configuring\n[local PVs](https://kubernetes.io/docs/concepts/storage/volumes/#local))\nin the cluster: LVP share and LVP node mounts. LVP share uses directories in a\nshared file system, while LVP node mounts uses dedicated disks.\n| **Caution:** Using a local PV binds the Pod to a specific disk and node. If that disk or node becomes unavailable, then the Pod also becomes unavailable. Workloads using local PVs need to be resilient to this kind of failure, and may require additional orchestration to release the Pod's PVCs and find a new, empty disk on another node.\n\nLVP share\n\nThis storage class creates a local PV backed by subdirectories in a local,\nshared file system on every node in the cluster. These subdirectories are\nautomatically created during cluster creation. Workloads using this storage\nclass will share capacity and IOPS because the PVs are backed by the same shared\nfile system. For better isolation, we recommend configuring disks through LVP\nnode mounts instead.\n\nConfigure an LVP share\n\n1. **Optional**: Before cluster creation, mount a disk using the configured path\n as a mount point so that the created PVs will share the new disk capacity and\n be isolated from the boot disk.\n\n2. Specify the following under `lvpShare` in the cluster CR:\n\n - `path`: The host machine path on each host where subdirectories are created. A local PV is created for each subdirectory. The default path is `/mnt/localpv-share`.\n - `storageClassName`: The storage class that PVs are created with during cluster creation. The default value is `local-shared`.\n - `numPVUnderSharedPath`: Number of subdirectories to create under `path`. The default value is `5`.\n\n The configuration looks similar to the following: \n\n apiVersion: baremetal.cluster.gke.io/v1\n kind: Cluster\n metadata:\n name: cluster1\n namespace: cluster-cluster1\n spec:\n storage:\n lvpShare:\n path: /mnt/localpv-share\n storageClassName: local-shared\n numPVUnderSharedPath: 5\n\nPVs are created with the storage class specified in `storageClassName`. The\ntotal number of local PVs created in the cluster is `numPVUnderSharedPath`\nmultiplied by the number of nodes.\n\nLVP node mounts\n\nThis storage class creates a local PV for each mounted disk in the configured\ndirectory. Each PV maps to a disk with capacity equal to the underlying disk\ncapacity. The total number of local PVs created in the cluster is the number of\ndisks mounted under the path across all nodes. Additional mounts can be added\nafter cluster creation.\n\nConfigure LVP node mounts\n\n1. On nodes that have extra disks for PVs, format and mount each disk under\n path. This can also be done before or after cluster creation. See\n [best practices](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner/blob/master/docs/best-practices.md).\n\n 1. List disks and find the one you want to mount:\n\n sudo lsblk\n\n 2. Format the disk, for example with single ext4 file system:\n\n sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/DEVICE_ID\n\n 3. Under the configured path, create a directory as the mount point for the\n new disk:\n\n sudo mkdir -p /mnt/localpv-disk/MNT_DIR\n\n 4. Mount the disk:\n\n sudo mount -o discard,defaults /dev/DEVICE_ID /mnt/localpv-disk/MNT_DIR &&\n sudo chmod a+w /mnt/localpv-disk/MNT_DIR\n\n 5. Add the disk to the `/etc/fstab` file, so that the device automatically\n mounts again when the instance restarts:\n\n # Backup of your current /etc/fstab file\n sudo cp /etc/fstab /etc/fstab.backup\n\n # Use the blkid command to find the UUID for the zonal persistent disk\n sudo blkid /dev/DEVICE_ID\n\n # Edit /etc/fstab file: create an entry that includes the UUID\n UUID=UUID_VALUE /mnt/localpv-disk/MNT_DIR ext4 discard,defaults,NOFAIL_OPTION 0 2\n\n2. Specify the following under `lvpNodeMounts` in cluster CR:\n\n - `path`: The host machine path for each mount where mounted disks are discovered and a local PV is created. The default path is `/mnt/localpv-disk`.\n - `storageClassName`: The storage class that PVs are created with during cluster creation. The default value is `local-disks`.\n\n The configuration looks something similar to the following: \n\n apiVersion: baremetal.cluster.gke.io/v1\n kind: Cluster\n metadata:\n name: cluster1\n namespace: cluster-cluster1\n spec:\n storage:\n lvpNodeMounts:\n path: /mnt/localpv-disk\n storageClassName: local-disks\n\n PVs are created with the storage class specified in `storageClassName`. The\n total number of PVs created is the number of disks mounted under `path`\n across all nodes.\n\nWhat's next\n\n- Learn how to [configure the default storage class](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/default-storage-class)."]]