Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Standardmäßig sind in einem Datenbankcluster nur Verbindungen aus dem Nutzercluster und demselben Projekt zulässig. So lassen Sie Verbindungen von Arbeitslasten in einem anderen Projekt zu allen Datenbankclustern in Ihrem Projekt zu:
Console
Melden Sie sich mit einem Konto, das an die Rolle project-networkpolicy-admin gebunden ist, in der GDC Console an, um Firewallregeln zu erstellen.
Wählen Sie im Hauptmenü der GDC Console Firewall aus.
Klicken Sie im Bereich Von Nutzern erstellte Regeln auf Erstellen.
Geben Sie unter Firewall rule details (Details zur Firewallregel) einen Namen für die Firewallregel ein.
Wählen Sie im Dialogfeld Traffic-Richtung die Option EINGEHEND aus.
Wählen Sie im Dialogfeld Ziel die Option Dienst und dann dbs aus.
Wählen Sie im Dialogfeld Von die Option Anderes Projekt aus und wählen Sie die Projekt-ID aus, von der Sie Verbindungen zulassen möchten.
Klicken Sie auf Erstellen.
Warten Sie, bis in der Spalte Status der neuen Regel Bereit angezeigt wird.
API
Erstellen Sie eine ProjectNetworkPolicy-Ressource, um Verbindungen von einem Clientprojekt zuzulassen.
[[["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,["# Enable cross-project connections\n\nBy default, a database cluster only allows connections from within the\n[user cluster](/distributed-cloud/hosted/docs/latest/gdch/resources/resource-hierarchy#cluster) and the same project. To allow\nconnections from workloads in another project to all database clusters in your\nproject: \n\n### Console\n\n1. Sign in to the GDC console with an account bound to the `project-networkpolicy-admin` role to create firewall rules.\n2. From the main menu of the GDC console, choose **Firewall**.\n3. In the **User created rules** section, click **Create**.\n4. In **Firewall rule details**, create a name for your firewall rule.\n5. In the **Direction of traffic** dialog, choose **INGRESS**.\n6. In the **Target** dialog, choose **Service** and then select **dbs**.\n7. In the **From** dialog, choose **Another project** and select the project ID from which you would like to allow connectivity.\n8. Click **Create**.\n9. Wait for the **Status** column of the new rule to show **Ready**.\n\n### API\n\nCreate a `ProjectNetworkPolicy` resource to allow connections from a client\nproject. \n\n apiVersion: networking.gdc.goog/v1\n kind: ProjectNetworkPolicy\n metadata:\n name: dbs-allow-from-\u003cvar translate=\"no\"\u003eCLIENT_PROJECT\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eUSER_PROJECT\u003c/span\u003e\u003c/var\u003e\n spec:\n subject:\n managedServices:\n matchTypes:\n - dbs\n subjectType: ManagedService\n ingress:\n - from:\n - projects:\n matchNames:\n - \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eCLIENT_PROJECT\u003c/span\u003e\u003c/var\u003e\n policyType: Ingress\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLIENT_PROJECT\u003c/var\u003e: the name of the project from which you would like to allow connectivity.\n- \u003cvar translate=\"no\"\u003eUSER_PROJECT\u003c/var\u003e: the name of the user project where the database cluster was created."]]