Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina mostra come configurare i volumi locali per i cluster Google Distributed Cloud.
I cluster Google Distributed Cloud offrono due opzioni per la configurazione
delle PV locali)
nel cluster: condivisione LVP e montaggi dei nodi LVP. La condivisione LVP utilizza le directory in un sistema di file condiviso, mentre i mount dei nodi LVP utilizzano dischi dedicati.
Quota LVP
Questa classe di archiviazione crea un volume permanente locale supportato da sottodirectory in un file system condiviso locale su ogni nodo del cluster. Queste sottodirectory vengono generate automaticamente durante la creazione del cluster. I workload che utilizzano questa classe di archiviazione condivideranno la capacità e le IOPS perché le VM private sono supportate dallo stesso filesystem condiviso. Per un isolamento migliore, ti consigliamo di configurare i dischi tramite i mount dei nodi LVP.
Configurare una condivisione LVP
(Facoltativo) Prima di creare il cluster, monta un disco utilizzando il percorso configurato come punto di montaggio in modo che i PV creati condividano la capacità del nuovo disco e siano isolati dal disco di avvio.
Specifica quanto segue in lvpShare nel file CR del cluster:
path: il percorso della macchina host su ciascun host in cui vengono create le sottodirectory. Viene creato un PV locale per ogni sottodirectory. Il percorso predefinito è /mnt/localpv-share.
storageClassName: la classe di archiviazione con cui vengono creati i volumi permanenti durante la creazione del cluster. Il valore predefinito è local-shared.
numPVUnderSharedPath: numero di sottodirectory da creare in path.
Il valore predefinito è 5.
I volumi permanenti vengono creati con la classe di archiviazione specificata in storageClassName. Il
numero totale di PV locali creati nel cluster è numPVUnderSharedPath
moltiplicato per il numero di nodi.
Montaggi dei nodi LVP
Questa classe di archiviazione crea un volume permanente locale per ogni disco montato nella directory configurata. Ogni PV viene mappato a un disco con una capacità pari alla capacità del disco sottostante. Il numero totale di PV locali creati nel cluster corrisponde al numero di dischi montati nel percorso in tutti i nodi. È possibile aggiungere altri mount
dopo la creazione del cluster.
Configura i mount dei nodi LVP
Sui nodi con dischi aggiuntivi per i PV, formatta e monta ogni disco in
percorso. Questa operazione può essere eseguita anche prima o dopo la creazione del cluster. Consulta le
best practice.
Elenca i dischi e trova quello che vuoi montare:
sudo lsblk
Formatta il disco, ad esempio con un singolo file system ext4:
Aggiungi il disco al file /etc/fstab in modo che il dispositivo si monti di nuovo automaticamente al riavvio dell'istanza:
# 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
Specifica quanto segue in lvpNodeMounts nel file CR del cluster:
path: il percorso della macchina host per ogni montaggio in cui vengono rilevati i dischi montati e viene creato un volume permanente locale. Il percorso predefinito è
/mnt/localpv-disk.
storageClassName: la classe di archiviazione con cui vengono creati i volumi permanenti durante la creazione del cluster. Il valore predefinito è local-disks.
I volumi permanenti vengono creati con la classe di archiviazione specificata in storageClassName. Il
numero totale di PV creati è il numero di dischi montati in path
su tutti i nodi.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)."]]