Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Die Networking API verwendet benutzerdefinierte Kubernetes-Ressourcen und basiert auf dem Kubernetes-Ressourcenmodell (KRM).
Netzwerke in der Air-Gap-Appliance von Google Distributed Cloud (GDC) über die Networking API mit der kubectl CLI erstellen und verwalten.
Dienstendpunkt
Der API-Endpunkt für die Networking API ist https://MANAGEMENT_API_SERVER_ENDPOINT/apis/networking.gdc.goog/v1, wobei MANAGEMENT_API_SERVER_ENDPOINT der Endpunkt des Management API-Servers ist.
Discovery-Dokument
Verwenden Sie den kubectl proxy-Befehl, um einen Proxy zum API-Server auf Ihrem lokalen Computer zu öffnen. Von dort aus können Sie über die folgende URL auf das Discovery-Dokument zugreifen: http://127.0.0.1:8001/apis/networking.gdc.goog/v1.
Beispiel für eine projektübergreifende Richtlinie für eingehenden Traffic
Das Folgende ist ein Beispiel für ein ProjectNetworkPolicy-Objekt, mit dem Arbeitslasten im Projekt project-1 Verbindungen von Arbeitslasten im Projekt project-2 sowie den Rücklauftraffic für dieselben Flows zulassen können:
[[["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,["# Overview of Networking API\n\nThe Networking API uses Kubernetes custom resources and relies on\nthe Kubernetes Resource Model (KRM).\n\nCreate and manage networking in Google Distributed Cloud (GDC) air-gapped appliance through the Networking API using the `kubectl` CLI.\n\nService endpoint\n----------------\n\nThe API endpoint for the Networking API is\n`https://`\u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_ENDPOINT\u003c/var\u003e`/apis/networking.gdc.goog/v1`,\nwhere \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_ENDPOINT\u003c/var\u003e is the endpoint of\nthe Management API server.\n\nDiscovery document\n------------------\n\nUse the `kubectl proxy` command to open a proxy to the API server on your local\nmachine. From there, you can access the discovery document at the\nfollowing URL: `http://127.0.0.1:8001/apis/networking.gdc.goog/v1`.\n\nExample ingress cross-project traffic policy\n--------------------------------------------\n\nThe following is an example of a `ProjectNetworkPolicy` object that enables workloads in the `project-1` project to permit connections from workloads in the `project-2` project, as well as the return traffic for the same flows: \n\n apiVersion: networking.gdc.goog/v1\n kind: ProjectNetworkPolicy\n metadata:\n namespace: project-1\n name: allow-ingress-traffic-from-project-2\n spec:\n policyType: Ingress\n subject:\n subjectType: UserWorkload\n ingress:\n - from:\n - projects:\n matchNames:\n - project-2"]]