Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
L'API Networking utilizza risorse personalizzate Kubernetes e si basa sul
modello di risorse Kubernetes (KRM).
Crea e gestisci il networking nell'appliance isolata di Google Distributed Cloud (GDC) tramite l'API Networking utilizzando la CLI kubectl.
Endpoint di servizio
L'endpoint API per l'API Networking è
https://MANAGEMENT_API_SERVER_ENDPOINT/apis/networking.gdc.goog/v1,
dove MANAGEMENT_API_SERVER_ENDPOINT è l'endpoint del
server API Management.
Documento di rilevamento
Utilizza il comando kubectl proxy per aprire un proxy al server API sulla tua macchina locale. Da qui, puoi accedere al documento di rilevamento all'URL seguente: http://127.0.0.1:8001/apis/networking.gdc.goog/v1.
Esempio di criterio di traffico in entrata tra progetti
Di seguito è riportato un esempio di oggetto ProjectNetworkPolicy che consente ai carichi di lavoro nel progetto project-1 di consentire le connessioni dai carichi di lavoro nel progetto project-2, nonché il traffico di ritorno per gli stessi flussi:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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"]]