이 문서에서는 Google Cloud Apache Spark용 서버리스 네트워크 구성에 필요한 요구사항을 설명합니다.
가상 프라이빗 클라우드 서브넷 요구사항
이 문서에서는Google Cloud Apache Spark 일괄 워크로드 및 대화형 세션용 서버리스의 가상 프라이빗 클라우드 네트워크 요구사항을 설명합니다.
비공개 Google 액세스
Apache Spark용 서버리스 일괄 워크로드 및 대화형 세션은 내부 IP 주소만 있는 VM에서 실행되며 서브넷에 비공개 Google 액세스 (PGA)가 자동으로 사용 설정된 리전 서브넷에서 실행됩니다.
서브넷을 지정하지 않으면 Apache Spark용 서버리스가 배치 워크로드 또는 세션 리전의 default 서브넷을 배치 워크로드 또는 세션의 서브넷으로 선택합니다.
워크로드에 외부 네트워크 또는 인터넷 액세스가 필요한 경우(예: PyTorch Hub 또는 Hugging Face에서 ML 모델과 같은 리소스를 다운로드하는 경우) VPC 네트워크에서 내부 IP를 사용하여 아웃바운드 트래픽을 허용하도록 Cloud NAT를 설정할 수 있습니다.
서브넷 연결 열기
Apache Spark용 서버리스 일괄 워크로드 또는 대화형 세션에 대해 선택한 리전의 VPC 서브넷은 VM 인스턴스 간의 모든 포트에서 내부 서브넷 통신을 허용해야 합니다.
다음 Google Cloud CLI 명령어는 모든 포트에서 모든 프로토콜을 사용하여 VM 간 내부 인그레스 통신을 허용하는 네트워크 방화벽을 서브넷에 연결합니다.
SUBNET_RANGES:VM 사이에 내부 인그레스 연결 허용을 참조하세요.
모든 포트 (tcp:0-65535, udp:0-65535, icmp protocols:ports)에서 인그레스 통신을 허용하는 default-allow-internal 방화벽 규칙이 있는 프로젝트의 default VPC 네트워크는 open-subnet-connectivity 요구사항을 충족합니다. 하지만 이 규칙은 네트워크의 모든 VM 인스턴스를 통한 인그레스도 허용합니다.
Apache Spark용 서버리스 및 VPC-SC 네트워크
VPC 서비스 제어를 사용하면 네트워크 관리자가 Google 관리형 서비스의 리소스 주위에 보안 경계를 정의하여 해당 서비스 간의 통신을 제어할 수 있습니다.
Apache Spark용 서버리스에서 VPC-SC 네트워크를 사용할 때는 다음 전략에 유의하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eDataproc Serverless for Spark workloads and interactive sessions require a Virtual Private Cloud (VPC) subnetwork.\u003c/p\u003e\n"],["\u003cp\u003eThe selected VPC subnet must have Private Google Access enabled to ensure internal IP address functionality, and it must allow internal subnet communication on all ports between VM instances.\u003c/p\u003e\n"],["\u003cp\u003eFor workloads needing external access, you can use Cloud NAT to enable outbound traffic via internal IPs on your VPC network.\u003c/p\u003e\n"],["\u003cp\u003eWhen using VPC Service Controls (VPC-SC), you should set up private connectivity and consider using a custom container image for pre-installing dependencies outside the VPC-SC perimeter.\u003c/p\u003e\n"]]],[],null,["# Serverless for Apache Spark network configuration\n\nThis document describes the requirements needed for Google Cloud Serverless for Apache Spark\nnetwork configuration.\n\nVirtual Private Cloud subnetwork requirements\n---------------------------------------------\n\nThis document explains the Virtual Private Cloud network requirements for\nGoogle Cloud Serverless for Apache Spark batch workloads and interactive sessions.\n\n### Private Google Access\n\nServerless for Apache Spark batch workloads and interactive sessions\nrun on VMs with internal IP addresses only and on a regional subnet with\n[Private Google Access (PGA)](/vpc/docs/configure-private-google-access)\nautomatically enabled on the subnet.\n\nIf you don't specify a subnet, Serverless for Apache Spark selects the\n`default` subnet in the batch workload or session region as the subnet for a\nbatch workload or session.\n\nIf your workload requires external network or internet\naccess, for example to download resources such as ML models from\n[PyTorch Hub](https://pytorch.org/hub/) or [Hugging Face](https://huggingface.co/),\nyou can set up [Cloud NAT](/nat/docs/overview) to allow outbound traffic\nusing internal IPs on your VPC network.\n\n### Open subnet connectivity\n\nThe VPC subnet for the region selected for the\nServerless for Apache Spark batch workload or interactive session must\nallow internal subnet communication on all ports between VM instances.\n| **Note:** To prevent malicious scripts in one workload from affecting other workloads, Serverless for Apache Spark deploys [default security measures](/dataproc-serverless/docs/concepts/security).\n\nThe following Google Cloud CLI command attaches a network firewall to a\nsubnet that allows internal ingress communications among VMs using all protocols\non all ports: \n\n```\ngcloud compute firewall-rules create allow-internal-ingress \\\n --network=NETWORK_NAME \\\n --source-ranges=SUBNET_RANGES \\\n --destination-ranges=SUBNET_RANGES \\\n --direction=ingress \\\n --action=allow \\\n --rules=all\n```\n\nNotes:\n\n- \u003cvar translate=\"no\"\u003eSUBNET_RANGES:\u003c/var\u003e See\n [Allow internal ingress connections between VMs](/firewall/docs/using-firewalls#common-use-cases-allow-internal).\n The `default` VPC network in a project with the\n `default-allow-internal` firewall rule, which allows ingress communication on\n all ports (`tcp:0-65535`, `udp:0-65535`, and `icmp protocols:ports`),\n meets the open-subnet-connectivity requirement. However, this rule also allows\n ingress by any VM instance on the network.\n\n | **Use network tags to limit connectivity**. In production, the recommended practice is to limit firewall rules to the IP addresses used by your Spark workloads.\n\nServerless for Apache Spark and VPC-SC networks\n-----------------------------------------------\n\nWith [VPC Service Controls](/vpc-service-controls/docs),\nnetwork administrators can define a security perimeter around resources of\nGoogle-managed services to control communication to and between those services.\n\nNote the following strategies when using VPC-SC\nnetworks with Serverless for Apache Spark:\n\n- [Set up private connectivity](/vpc-service-controls/docs/set-up-private-connectivity).\n\n- Create a [custom container image](/dataproc-serverless/docs/guides/custom-containers)\n that pre-installs dependencies outside the VPC-SC perimeter,\n and then [submit a Spark batch workload](/dataproc-serverless/docs/guides/custom-containers#submit_a_spark_batch_workload_using_a_custom_container_image)\n that uses your custom container image.\n\nFor more information, see\n[VPC Service Controls---Serverless for Apache Spark](/vpc-service-controls/docs/supported-products#table_dataproc_serverless)."]]