Installa e configura l'interfaccia a riga di comando dello storage
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina ti guida su come installare e configurare la CLI gdcloud per gestire l'archiviazione di oggetti quando lavori con progetti air-gap di Google Distributed Cloud (GDC). Spiega come scaricare, installare e configurare i componenti e le impostazioni necessari per utilizzare in modo efficace i bucket e gli oggetti di archiviazione in questo ambiente isolato.
Questa pagina è rivolta a segmenti di pubblico come gli amministratori IT all'interno del gruppo di operatori dell'infrastruttura o gli sviluppatori all'interno del gruppo di operatori dell'applicazione che vogliono eseguire il provisioning e gestire i bucket di archiviazione degli oggetti per i progetti all'interno degli ambienti air-gap di GDC. Per saperne di più, consulta la documentazione relativa ai segmenti di pubblico per GDC air-gapped.
Prepara gcloud CLI
Per utilizzare gcloud CLI, segui questi passaggi per scaricare, installare e configurare il pacchetto.
gdcloud config set storage/s3_secret_access_key SECRET_ACCESS_KEY
Sostituisci CA_BUNDLE_FILE con il percorso del certificato CA:
gdcloud config set storage/s3_custom_ca_certs_file CA_BUNDLE_FILE
Sostituisci ENDPOINT con l'endpoint fornito dall'operatore dell'infrastruttura (IO):
gdcloudconfigsetstorage/s3_endpointENDPOINT
Questo passaggio è leggermente diverso per i bucket a doppia zona. Ogni bucket dual-region fornisce tre endpoint che puoi scegliere per accedere al bucket. Nella maggior parte dei casi, l'endpoint globale è appropriato per sfruttare i failover automatici:
Endpoint zona1: questo endpoint viene sempre ricevuto dalla zona1. Se utilizzi questo endpoint, hai una coerenza read-after-write per tutti gli oggetti scritti nella zona 1. Tuttavia, se la zona 1 non è disponibile, un client deve passare all'utilizzo dell'endpoint della zona 2 o globale per continuare a leggere/scrivere in questo bucket. Se il client proviene da un cluster utente, questo endpoint sarà accessibile solo dall'interno di zona1.
Endpoint Zone2: questo endpoint viene sempre ricevuto da Zone2. Se utilizzi questo endpoint, hai una coerenza di lettura dopo scrittura per tutti gli oggetti scritti in zona2. Tuttavia, se la zona 2 non è disponibile, un client deve passare all'utilizzo dell'endpoint della zona 1 o globale per continuare a leggere/scrivere in questo bucket. Se il client proviene da un cluster utente, questo endpoint sarà accessibile solo dall'interno della zona 2.
Endpoint globale: questo endpoint fa sì che la tua richiesta venga indirizzata alla zona 1 o alla zona 2. Questa opzione non fornisce l'affinità sessione, il che significa che le richieste effettuate utilizzando la stessa sessione potrebbero arrivare nella zona 1 o nella zona 2. Ciò significa che non esiste alcuna garanzia di lettura dopo la scrittura per le richieste effettuate all'endpoint globale. L'endpoint globale fornisce il failover automatico nel caso in cui una zona non sia più disponibile, quindi gli utenti non dovranno modificare gli endpoint nei loro carichi di lavoro come dovrebbero fare se utilizzassero l'endpoint zonale. Inoltre, questo endpoint è accessibile dai cluster utente in tutte le zone.
Esegui i seguenti comandi per visualizzare gli endpoint globali/zonali per il bucket e scegli quello che vuoi utilizzare:
[[["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-04 UTC."],[[["\u003cp\u003eThe gdcloud CLI tool is used for managing object storage, and this guide provides steps on how to set it up.\u003c/p\u003e\n"],["\u003cp\u003eDownloading the gdcloud CLI is the first step, as detailed in the gdcloud CLI overview document.\u003c/p\u003e\n"],["\u003cp\u003eInstalling the storage dependencies component is required to use the storage command tree, and this can be achieved by running \u003ccode\u003egdcloud components install storage-cli-dependencies\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring the gdcloud CLI for object storage involves setting the access key ID, secret access key, CA certificate path, and endpoint using \u003ccode\u003egdcloud config set\u003c/code\u003e commands.\u003c/p\u003e\n"]]],[],null,["# Install and configure storage CLI\n\nThis page guides you through how to install and configure the gdcloud CLI for managing object storage when working with Google Distributed Cloud (GDC) air-gapped projects. It covers how to download, install, and configure the necessary components and settings essential for effectively using storage buckets and objects in this isolated environment.\n\nThis page is for audiences such as IT admins within the infrastructure operator group or developers within the application operator group who are looking to provision and manage object storage buckets for projects within GDC air-gapped environments. For more information, see [Audiences for GDC air-gapped documentation](/distributed-cloud/hosted/docs/latest/gdch/resources/audiences).\n\nPrepare the gdcloud CLI\n-----------------------\n\nTo use the gdcloud CLI, see the following steps to download, install, and configure the package.\n\n### Download the gdcloud CLI\n\nTo download the gdcloud CLI, see the\n[gdcloud CLI overview](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-overview).\n\n### Install the gdcloud CLI\n\nIn order to use the storage command tree, the storage dependencies component must be installed.\n\n1. Follow [Install gdcloud CLI](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-install).\n\n2. To install the storage dependencies component, run the following commands:\n\n gdcloud components install storage-cli-dependencies\n\n For more information on the `components install` command, see [Install gdcloud CLI](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-install).\n\n| **Note:** This command only installs the dependencies onto the client machine. For configuring the gdcloud CLI follow [Configure gdcloud CLI for object storage](#gdcloud-storage-configure).\n\n### Configure the gdcloud CLI for object storage\n\nThe following configurations must be set to use the gdcloud CLI for object storage.\n\n1. Replace `ACCESS_KEY_ID` with the access key ID obtained from the secret in [getting access credentials](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/grant-obtain-storage-access#getting_bucket_access_credentials):\n\n gdcloud config set storage/s3_access_key_id ACCESS_KEY_ID\n\n2. Replace `SECRET_ACCESS_KEY` with the secret key obtained from the secret in [getting access credentials](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/grant-obtain-storage-access#getting_bucket_access_credentials):\n\n gdcloud config set storage/s3_secret_access_key SECRET_ACCESS_KEY\n\n3. Replace `CA_BUNDLE_FILE` with the path to the CA Certificate:\n\n gdcloud config set storage/s3_custom_ca_certs_file CA_BUNDLE_FILE\n\n | **Note:** If the CA Certs for GDC are already installed on the environment then you can set this to `/etc/ssl/certs/ca-certificates.crt`\n4. Replace `ENDPOINT` with the endpoint your Infrastructure Operator (IO) provides:\n\n gdcloud config set storage/s3_endpoint ENDPOINT\n\n | **Note:** This is the full endpoint beginning with `https://`.\n\n This step differs slightly for dual-zone buckets. Each dual-zone bucket provides three endpoints that you can choose to access the bucket. For most situations, the global endpoint is appropriate in order to take advantage of automatic failovers:\n - Zone1 endpoint: This endpoint is always received by zone1. If using this endpoint, you have read-after-write consistency for any objects written to zone1. However, if zone1 goes down, a client needs to change to using either the zone2 or global endpoint to continue reading/writing to this bucket. If the client is coming from a user cluster, then this endpoint will only be accessible from within zone1.\n - Zone2 endpoint: This endpoint is always received by zone2. If using this endpoint, you have read-after-write consistency for any objects written to zone2. However, if zone2 goes down, a client needs to change to using either the zone1 or global endpoint to continue reading/writing to this bucket. If the client is coming from a user cluster, then this endpoint will only be accessible from within zone2.\n - Global endpoint: This endpoint results in your request being routed to either zone1 or zone2. This option doesn't provide session affinity, meaning that requests made using the same session may arrive in either zone1 or zone2. This means that there is no read-after-write guarantee for requests made to the global endpoint. The global endpoint provides automatic failover in the event that a zone goes down, so users won't have to change endpoints in their workloads the way they would need to if using the zonal endpoint. In addition, this endpoint is accessible from user clusters in all zones.\n\n Run the following commands to view the global/zonal endpoints for your bucket and choose the one you want to use: \n\n kgo get buckets $BUCKET_NAME -n $PROJECT_NAME -o jsonpath=\"{.status.globalEndpoint}\"\n\n kgo get buckets $BUCKET_NAME -n $PROJECT_NAME -o jsonpath=\"{.status.zonalEndpoints}\""]]