Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite finden Sie eine Übersicht über die Distributed Cloud CLI sowie eine Anleitung zum Herunterladen und Konfigurieren für die Verwendung mit GDC Sandbox.
Übersicht über die gcloud CLI
Die gdcloud CLI ist eine Reihe von Tools zum Erstellen und Verwalten von Air-Gap-Ressourcen für Google Distributed Cloud (GDC).
Sie ist nur für Linux verfügbar.
Mit diesen Tools können Sie gängige Aufgaben über die Befehlszeile oder über Skripts und Automatisierung ausführen. Mit der gdcloud-Befehlszeile können Sie die Infrastruktur einrichten, die Authentifizierung verwalten und lokale Konfigurationen anpassen. Diese unterscheidet sich von der gcloud-CLI, die zum Verwalten vonGoogle Cloudverwendet wird.
Auf dieser Seite finden Sie vereinfachte Anleitungen speziell für die GDC-Sandbox. Weitere Informationen zur gcloud CLI im Allgemeinen, einschließlich Konfiguration, Upgrade, automatischer Vervollständigung und Barrierefreiheit, finden Sie in der Dokumentation zu GDC Air-Gapped gdcloud.
gdcloud-Befehlszeile herunterladen
Folgen Sie dieser Anleitung, wenn Sie über sshuttle eine Verbindung zur GDC Sandbox herstellen. Wenn Sie über Remote Desktop eine Verbindung zum Gateway Ihrer Instanz herstellen, müssen Sie das Tool nicht herunterladen, da gdcloud auf dem Gateway-Computer unter dem Pfad /usr/share/gdcloud vorinstalliert ist.
Laden Sie das gdcloud CLI-Bundle aus der GDC Console herunter.
Extrahieren Sie das CLI-Bundle in einem Terminalfenster:
cd~/Downloads
tar-xfgdcloud_cli.tar.gz
Fügen Sie die gdcloud-Befehlszeile zu Ihrem PATH hinzu, damit Sie den Speicherort nicht bei jedem Befehl angeben müssen. Der folgende Befehl setzt voraus, dass das CLI-Bundle heruntergeladen und in das Verzeichnis Downloads des Nutzers extrahiert wurde und dass sich das Shell-Profil des Nutzers in ~/.bashrc befindet.
Für die Ausführung von Befehlen in gdcloud ist eine Authentifizierung erforderlich. Wenn Sie es mit GDC Sandbox verwenden möchten, laden Sie zuerst ein Zertifikat aus der GDC Sandbox-Instanz herunter.
Rufen Sie das Zertifikat ab, um die Anmeldung zu autorisieren. Mit dem folgenden Befehl wird das Zertifikat in den Ordner /tmp heruntergeladen. Sie können es aber auch an einem anderen Ort herunterladen.
Melden Sie sich mit dem heruntergeladenen Zertifikat in der gcloud CLI an. Im folgenden Beispiel wird davon ausgegangen, dass das Zertifikat in den Ordner /tmp heruntergeladen wurde.
Mit diesem Befehl wird ein Browserfenster zum OIDC-Portal geöffnet. Wählen Sie noch einmal Fake OIDC Provider und Platform Admin aus (oder den Nutzer, den Sie für die Entwicklung verwenden möchten). Achten Sie darauf, dass Sie der Rolle den richtigen Zugriff gewähren.
Wiederholen Sie diesen Authentifizierungsschritt nach Bedarf, wenn die Sitzung abläuft.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[],[],null,["# Set up the gdcloud CLI\n\nThis page contains an overview of the Distributed Cloud CLI, and\ninstructions on how to download and configure it for usage with\nGDC Sandbox.\n\nOverview of the gdcloud CLI\n---------------------------\n\nThe gdcloud CLI is a set of tools to create and manage\nGoogle Distributed Cloud (GDC) air-gapped resources.\nIt is available for Linux only.\nUse these tools to perform common tasks from the\ncommand line or through scripts and automation. The `gdcloud` CLI can be used to\nbootstrap infrastructure, manage authentication, and customize local\nconfigurations. Note that this is distinct from the `gcloud` CLI used to manage\nGoogle Cloud.\n\nThis page contains simplified instructions that are specific to\nGDC Sandbox. For more detail on the gdcloud CLI in general, including\nconfiguration, upgrade, autocomplete, and accessibility, see the\n[GDC air-gapped `gdcloud` documentation](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-overview).\n\nDownload the gdcloud CLI\n------------------------\n\nFollow these instructions if you are connecting to the GDC Sandbox using\n`sshuttle`. If you are connecting to your instance's gateway over remote desktop,\nthere is no need to download the tool, as `gdcloud` is pre-installed on the\ngateway machine at the path `/usr/share/gdcloud`.\n\n1. Download the gdcloud CLI bundle from the GDC console.\n 1. Navigate to your GDC console as described in [Connect to your instance](/distributed-cloud/sandbox/latest/connect).\n 2. Navigate to the **Connect with CLI** section.\n 3. Click **Download CLI Bundle**.\n2. In a terminal window, extract the CLI bundle:\n\n cd ~/Downloads\n tar -xf gdcloud_cli.tar.gz\n\n3. Add the `gdcloud` CLI to your PATH so that you don't have to specify\n the location with every command. The following command assumes the CLI\n bundle was downloaded and extracted to the user's `Downloads` directory, and\n that the user's shell profile lives in `~/.bashrc`.\n\n echo 'export PATH=$PATH:~/Downloads/google-distributed-cloud-hosted-cli/bin' \u003e\u003e ~/.bashrc\n source ~/.bashrc\n\n4. Open a new terminal and run `gdcloud version` to confirm the command\n worked.\n\n5. Install the `auth` plugin. This plugin is required for using the kubeconfigs generated through the CLI.\n\n gdcloud components install gdcloud-k8s-auth-plugin\n\nConfigure gdcloud\n-----------------\n\n1. Configure the CLI by setting the organization URL to the URL of the\n GDC console.\n\n gdcloud config set core/organization_console_url https://console.org-1.zone1.google.gdch.test\n\n### Download the certificate\n\nThe gdcloud requires authentication in order to perform commands. To use it\nwith GDC Sandbox, start by downloading a certificate from the\nGDC Sandbox instance.\n\n1. Retrieve the certificate to authorize sign in. The following command\n downloads the certificate to the `/tmp` folder; you can choose\n to download it wherever you prefer.\n\n echo -n | \\\n openssl s_client -showcerts -connect console.org-1.zone1.google.gdch.test:443 | \\\n sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \u003e /tmp/org-1-web-tls-ca.cert\n\nAuthenticate with gdcloud\n-------------------------\n\n1. Sign in to the gdcloud CLI, using the downloaded certificate. The\n following example assumes that the cert was downloaded into the\n `/tmp` folder.\n\n gdcloud auth login --login-config-cert=/tmp/org-1-web-tls-ca.cert\n\n This command opens a browser window to the OIDC portal. Select\n **fake OIDC Provider** , and **Platform Admin** again (or whatever user you\n want to use for development, make sure you give the right access to the\n role).\n\n Repeat this authentication step as needed, when the session times out."]]