Membuat kebijakan jaringan project untuk layanan terkelola
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini memberikan petunjuk untuk membuat kebijakan jaringan project untuk layanan terkelola di Google Distributed Cloud (GDC) yang terisolasi.
Layanan terkelola GDC adalah layanan yang dibuat dan dikelola oleh Google. Fitur ini tersedia secara default untuk semua pengguna dan dapat diakses melalui konsol web GDC atau menggunakan command line. Layanan terkelola dapat berupa software yang dikembangkan oleh Google atau software open source yang telah diintegrasikan Google dengan GDC.
Sebelum memulai
Untuk mengonfigurasi kebijakan jaringan pembuatan project untuk layanan terkelola, Anda harus memiliki hal berikut:
Project yang ada. Untuk mengetahui informasi selengkapnya, lihat Membuat project.
Membuat kebijakan untuk layanan terkelola
Secara default, layanan terkelola hanya mengizinkan koneksi dari project yang membuat layanan tersebut. Operator dapat mengekspos layanan terkelola ke project selain project yang membuat layanan menggunakan kebijakan jaringan project.
Anda dapat membuat kebijakan global untuk layanan terkelola yang berlaku untuk semua zona di organisasi Anda. Untuk mengetahui informasi selengkapnya tentang resource global di semesta GDC, lihat
Ringkasan multi-zona.
Membuat kebijakan global untuk layanan terkelola
ProjectNetworkPolicy berikut mengekspos Database Service (DBS) sebagai layanan terkelola:
GLOBAL_API_SERVER: jalur kubeconfig server API global. Untuk mengetahui informasi selengkapnya, lihat Server API global dan zonal. Jika Anda belum membuat file kubeconfig untuk server API, lihat Login untuk mengetahui detailnya.
PROJECT_1: nama project sumber.
PROJECT_2 project tujuan. Setelah menerapkan kebijakan, beban kerja di project PROJECT_2 dapat terhubung ke beban kerja di layanan terkelola DBS.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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."]]