Projektnetzwerkrichtlinien für verwaltete Dienste erstellen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite finden Sie eine Anleitung zum Erstellen von Projektnetzwerkrichtlinien für verwaltete Dienste in Google Distributed Cloud (GDC) Air-Gapped.
Ein von GDC verwalteter Dienst ist ein Dienst, der von Google entwickelt und gewartet wird. Sie ist standardmäßig für alle Nutzer verfügbar und kann über die GDC-Webkonsole oder über die Befehlszeile aufgerufen werden. Verwaltete Dienste können entweder von Google entwickelte Software oder Open-Source-Software sein, die Google in GDC integriert hat.
Hinweise
Zum Konfigurieren von Richtlinien für das Erstellen von Projektnetzwerken für verwaltete Dienste benötigen Sie Folgendes:
Ein vorhandenes Projekt. Weitere Informationen finden Sie unter Projekt erstellen.
Richtlinie für einen verwalteten Dienst erstellen
Standardmäßig lässt ein verwalteter Dienst nur Verbindungen von dem Projekt zu, in dem der Dienst erstellt wurde. Ein Betreiber kann den verwalteten Dienst für andere Projekte als das Projekt, in dem der Dienst erstellt wurde, über eine Projektnetzwerkrichtlinie verfügbar machen.
Sie können eine globale Richtlinie für einen verwalteten Dienst erstellen, die für alle Zonen in Ihrer Organisation gilt. Weitere Informationen zu globalen Ressourcen in einem GDC-Universum finden Sie unter Übersicht über mehrere Zonen.
Globale Richtlinie für einen verwalteten Dienst erstellen
Im Folgenden wird der DatabaseService (DBS) als verwalteter Dienst verfügbar gemacht:ProjectNetworkPolicy
GLOBAL_API_SERVER: Der kubeconfig-Pfad des globalen API-Servers. Weitere Informationen finden Sie unter Globale und zonale API-Server. Wenn Sie noch keine kubeconfig-Datei für den API-Server generiert haben, finden Sie weitere Informationen unter Anmelden.
PROJECT_1: der Name des Quellprojekts.
PROJECT_2 das Zielprojekt. Nachdem die Richtlinie angewendet wurde, können Arbeitslasten im Projekt PROJECT_2 eine Verbindung zu Arbeitslasten im verwalteten DBS-Dienst herstellen.
[[["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)."],[[["\u003cp\u003eThis page outlines how to create project network policies for managed services within Google Distributed Cloud (GDC) air-gapped environments.\u003c/p\u003e\n"],["\u003cp\u003eManaged services, built and maintained by Google, are accessible by default to all users in GDC and can be managed via the web console or command line.\u003c/p\u003e\n"],["\u003cp\u003eBy default, a managed service only allows connections from the project that created it, but a project network policy can expose it to other projects.\u003c/p\u003e\n"],["\u003cp\u003eGlobal project network policies can be created to apply to all zones in an organization, enabling broader access to managed services.\u003c/p\u003e\n"],["\u003cp\u003eThe provided example demonstrates how to use \u003ccode\u003ekubectl\u003c/code\u003e to create a \u003ccode\u003eProjectNetworkPolicy\u003c/code\u003e that allows a specific project to access the Database Service (DBS) managed service.\u003c/p\u003e\n"]]],[],null,["# Create project network policies for managed services\n\nThis page provides instructions to create project network policies for managed services in Google Distributed Cloud (GDC) air-gapped.\nA GDC managed service is a service that is built and maintained by Google. It is available by default to all users and can be accessed through the GDC web console or using the command line. Managed services can be either software developed by Google or open-source software that Google has integrated with GDC.\n\nBefore you begin\n----------------\n\nTo configure create project network policies for managed services, you must have the following:\n\n- The necessary identity and access roles. For more information, see [Prepare predefined roles and access](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/pnp/pnp-overview#prepare-predefined-roles-and-access).\n- An existing project. For more information, see [Create a project](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/create-a-project).\n\nCreate a policy for a managed service\n-------------------------------------\n\nBy default, a managed service only allows connections from the project that\ncreated the service. An operator can expose the managed service to projects\nother than the project that created the service by using a project network\npolicy.\n\nYou can create a global policy for a managed service that\napplies to all zones in your organization. For more information on global resources in a GDC universe, see\n[Multi-zone overview](/distributed-cloud/hosted/docs/latest/gdch/resources/multi-zone/mz-overview).\n\n### Create a global policy for a managed service\n\nThe following `ProjectNetworkPolicy` exposes the Database\nService (DBS) as a managed service: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eGLOBAL_API_SERVER\u003c/var\u003e apply -f - \u003c\u003cEOF\n apiVersion: networking.global.gdc.goog/v1\n kind: ProjectNetworkPolicy\n metadata:\n namespace: \u003cvar translate=\"no\"\u003ePROJECT_1\u003c/var\u003e\n name: allow-inbound-traffic-from-project-2-to-dbs-service\n spec:\n subject:\n subjectType: ManagedService\n managedServices:\n matchTypes:\n - 'dbs'\n ingress:\n - from:\n - projectSelector:\n projects:\n matchNames:\n - \u003cvar translate=\"no\"\u003ePROJECT_2\u003c/var\u003e\n EOF\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eGLOBAL_API_SERVER\u003c/var\u003e: the global API server's kubeconfig path. For more information, see [Global and zonal API servers](/distributed-cloud/hosted/docs/latest/gdch/resources/multi-zone/api-servers). If you have not yet generated a kubeconfig file for the API server, see [Sign in](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/iam/sign-in#cli) for details.\n- \u003cvar translate=\"no\"\u003ePROJECT_1\u003c/var\u003e: the source project name.\n- \u003cvar translate=\"no\"\u003ePROJECT_2\u003c/var\u003e the destination project. After applying the policy, workloads in the \u003cvar translate=\"no\"\u003ePROJECT_2\u003c/var\u003e project can connect to workloads in the DBS managed service."]]