Installer et configurer la CLI Storage pour les projets
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment installer et configurer la CLI gdcloud pour gérer le stockage d'objets lorsque vous travaillez avec des projets Google Distributed Cloud (GDC) isolés. Il explique comment télécharger, installer et configurer les composants et paramètres nécessaires pour utiliser efficacement les buckets et les objets de stockage dans cet environnement isolé.
Cette page s'adresse à des audiences telles que les administrateurs informatiques du groupe des opérateurs d'infrastructure ou les développeurs du groupe des opérateurs d'applications qui souhaitent provisionner et gérer des buckets de stockage d'objets pour des projets dans des environnements GDC isolés. Pour en savoir plus, consultez la documentation sur les audiences pour GDC en mode air-gapped.
Préparer la CLI gdcloud
Pour utiliser la gdcloud CLI, suivez les étapes ci-dessous pour télécharger, installer et configurer le package.
gdcloud config set storage/s3_secret_access_key SECRET_ACCESS_KEY
Remplacez CA_BUNDLE_FILE par le chemin d'accès au certificat de l'autorité de certification :
gdcloud config set storage/s3_custom_ca_certs_file CA_BUNDLE_FILE
Remplacez ENDPOINT par le point de terminaison fourni par votre opérateur d'infrastructure (IO) :
gdcloudconfigsetstorage/s3_endpointENDPOINT
Cette étape diffère légèrement pour les buckets à double zone. Chaque bucket à double zone fournit trois points de terminaison que vous pouvez choisir pour accéder au bucket. Dans la plupart des cas, le point de terminaison global est approprié pour profiter des basculements automatiques :
Point de terminaison de la zone 1 : ce point de terminaison est toujours reçu par la zone 1. Si vous utilisez ce point de terminaison, vous bénéficiez d'une cohérence de type "lecture après écriture" pour tous les objets écrits dans la zone 1. Toutefois, si la zone 1 est hors service, un client doit passer à la zone 2 ou au point de terminaison global pour continuer à lire et à écrire dans ce bucket. Si le client provient d'un cluster d'utilisateur, ce point de terminaison ne sera accessible qu'à partir de la zone 1.
Point de terminaison Zone2 : ce point de terminaison est toujours reçu par Zone2. Si vous utilisez ce point de terminaison, vous bénéficiez d'une cohérence de lecture après écriture pour tous les objets écrits dans la zone 2. Toutefois, si la zone 2 tombe en panne, un client doit passer à l'utilisation du point de terminaison de la zone 1 ou du point de terminaison global pour continuer à lire/écrire dans ce bucket. Si le client provient d'un cluster d'utilisateur, ce point de terminaison ne sera accessible qu'à partir de la zone 2.
Point de terminaison mondial : ce point de terminaison permet de router votre requête vers la zone 1 ou la zone 2. Cette option ne fournit pas d'affinité de session, ce qui signifie que les requêtes effectuées à l'aide de la même session peuvent arriver dans la zone 1 ou la zone 2. Cela signifie qu'il n'existe aucune garantie de lecture après écriture pour les requêtes envoyées au point de terminaison mondial. Le point de terminaison global fournit un basculement automatique en cas de défaillance d'une zone. Les utilisateurs n'ont donc pas besoin de modifier les points de terminaison dans leurs charges de travail comme ils le feraient s'ils utilisaient le point de terminaison zonal. De plus, ce point de terminaison est accessible depuis les clusters d'utilisateur dans toutes les zones.
Exécutez les commandes suivantes pour afficher les points de terminaison globaux/zonaux de votre bucket et choisissez celui que vous souhaitez utiliser :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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 the storage CLI for projects\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}\""]]