Instala y configura la CLI de almacenamiento para proyectos
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta página, se explica cómo instalar y configurar la CLI de gdcloud para administrar el almacenamiento de objetos cuando se trabaja con proyectos aislados de Google Distributed Cloud (GDC). En él, se explica cómo descargar, instalar y configurar los componentes y parámetros de configuración necesarios para usar de manera eficaz los buckets y objetos de almacenamiento en este entorno aislado.
Esta página está dirigida a públicos como los administradores de TI del grupo de operadores de infraestructura o los desarrolladores del grupo de operadores de aplicaciones que desean aprovisionar y administrar buckets de almacenamiento de objetos para proyectos en entornos aislados de GDC. Para obtener más información, consulta Audiences for GDC air-gapped documentation (Públicos para la documentación de GDC aislada del aire).
Prepara la CLI de gdcloud
Para usar la CLI de gdcloud, consulta los siguientes pasos para descargar, instalar y configurar el paquete.
gdcloud config set storage/s3_secret_access_key SECRET_ACCESS_KEY
Reemplaza CA_BUNDLE_FILE por la ruta de acceso al certificado de CA:
gdcloud config set storage/s3_custom_ca_certs_file CA_BUNDLE_FILE
Reemplaza ENDPOINT por el extremo que proporciona tu operador de infraestructura (IO):
gdcloudconfigsetstorage/s3_endpointENDPOINT
Este paso varía ligeramente para los buckets de doble zona. Cada bucket de doble zona proporciona tres extremos que puedes elegir para acceder al bucket. En la mayoría de los casos, el extremo global es adecuado para aprovechar las conmutaciones por error automáticas:
Extremo de Zone1: Zone1 siempre recibe este extremo. Si usas este extremo, tendrás coherencia de lectura después de escritura para cualquier objeto escrito en zone1. Sin embargo, si la zona1 deja de funcionar, un cliente debe cambiar para usar el extremo de la zona2 o el extremo global para seguir leyendo o escribiendo en este bucket. Si el cliente proviene de un clúster de usuario, solo se podrá acceder a este extremo desde la zona1.
Extremo de Zone2: Zone2 siempre recibe este extremo. Si usas este extremo, tendrás coherencia de lectura después de escritura para cualquier objeto escrito en zone2. Sin embargo, si la zona2 deja de funcionar, un cliente debe cambiar al extremo de la zona1 o al extremo global para seguir leyendo o escribiendo en este bucket. Si el cliente proviene de un clúster de usuario, solo se podrá acceder a este extremo desde la zona2.
Extremo global: Este extremo hace que tu solicitud se enrute a la zona1 o a la zona2. Esta opción no proporciona afinidad de sesión, lo que significa que las solicitudes realizadas con la misma sesión pueden llegar a la zona1 o a la zona2. Esto significa que no hay garantía de lectura después de escritura para las solicitudes realizadas al extremo global. El extremo global proporciona una conmutación por error automática en caso de que una zona deje de funcionar, por lo que los usuarios no tendrán que cambiar los extremos en sus cargas de trabajo como lo harían si usaran el extremo zonal. Además, se puede acceder a este extremo desde los clústeres de usuarios en todas las zonas.
Ejecuta los siguientes comandos para ver los extremos globales y zonales de tu bucket y elige el que quieras usar:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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}\""]]