비공개 클러스터는 내부 IP 주소에만 의존하는 Virtual Private Cloud(VPC) 기반 클러스터입니다.
즉, 노드와 포드는 기본적으로 인터넷에서 격리되어 있습니다. 이 페이지에서는 Cloud Code를 사용하여 공개 엔드포인트 액세스 유무에 관계없이 비공개 클러스터에 연결하고 비공개 클러스터가 Google Cloud외부의 리소스에 액세스하도록 허용하는 방법을 설명합니다.
공개 엔드포인트가 사용 설정된 클러스터의 경우 클러스터를 추가하면 KubeConfig의 클러스터 주소가 외부 IP로 설정됩니다.
공개 엔드포인트가 사용 중지된 클러스터의 경우 클러스터를 추가하면 KubeConfig의 클러스터 주소가 클러스터의 내부 VPC IP로 설정됩니다.
승인된 네트워크를 기존 클러스터에 추가하려면 이 클러스터에 승인된 네트워크가 사용 설정되어 있으므로 승인된 네트워크에 연결되어 있는지 확인합니다.
외부 IP 주소 없이 VM에 연결하는 방법에 대한 자세한 내용은 VM 인스턴스에 안전하게 연결을 참조하세요.
만든 인스턴스를 관리/삭제하려면 VM 인스턴스를 참조하세요.
비공개 클러스터에 연결하려면 Cloud Code가 클러스터 네트워크의 머신에서 실행되거나 프록시 서버, Cloud Interconnect 또는 Cloud VPN을 사용하는 것과 같이 클러스터의 네트워크에 액세스할 수 있어야 합니다.
Cloud Code에서 GKE 클러스터를 만들고 기존 GKE 클러스터를 Cloud Code에 추가하는 단계는 GKE 클러스터 만들기 및 구성을 참조하세요.
Cloud Code에서 Google Cloud 콘솔을 열어 클러스터를 만듭니다.
클러스터를 생성한 후 클러스터 생성 중에 설정되지 않은 경우 클러스터에서 아웃바운드 인터넷 연결을 사용 설정하도록 Cloud NAT를 구성합니다. 만든 네트워크를 관리/삭제하려면 VPC 네트워크를 참조하세요.
비공개 클러스터 연결 문제 해결
개발 환경이 비공개 클러스터에 액세스하도록 올바르게 구성되지 않은 경우 문제를 해결하는 방법에 대한 권장사항은 다음 컨텍스트에 표시됩니다.
Kubernetes 탐색기에서 Cloud Code를 연결할 수 없는 클러스터는 클러스터 이름 옆에 오류 아이콘이 표시됩니다.
비공개 클러스터 구성의 잠재적인 문제로 인해 액세스할 수 없는 클러스터에서 작업을 실행하려 하면 도움말에 잠재적인 문제 및 가능한 해결 방법에 대한 자세한 설명과 함께 오류 메시지가 표시됩니다. 오류 메시지를 보려면 오류 아이콘이 있는 클러스터 위에 마우스 포인터를 올려놓습니다.
비공개 클러스터 문서를 보려면 클러스터를 마우스 오른쪽 버튼으로 클릭하고 비공개 클러스터 문서 보기를 선택합니다.
클러스터에 대한 프록시 서버 구성
공개 엔드포인트가 사용 중지된 GKE 클러스터와 같이 제어 영역 API를 공개적으로 사용할 수 없는 경우 클러스터와 동일한 네트워크 또는 VPC의 프록시 서버를 통해 제어 영역에 요청을 프록시하도록 Cloud Code를 구성할 수 있습니다.
Cloud Code에 추가한 클러스터의 이름을 마우스 오른쪽 버튼으로 클릭한 다음 Kubectl 프록시 설정을 클릭합니다. 표시되는 메시지에 따라 클러스터의 proxy-url 필드에 저장된 프록시 서버의 이름을 입력합니다. Kubernetes 탐색기가 새로고침되어 연결된 클러스터를 표시합니다.
Kubernetes 프록시 취소
Kubernetes 프록시용으로 구성한 클러스터의 이름을 마우스 오른쪽 버튼으로 클릭한 다음 Kubectl 프록시 취소를 클릭합니다. Cloud Code는 KubeConfig에서 proxy-url 필드를 설정 해제하여 클러스터에 대한 프록시 요청을 중지합니다.
클러스터에서 Google Cloud 외부 리소스에 액세스
GKE 비공개 클러스터의 모든 구성은 노드에 인터넷 액세스 권한을 제공하지 않습니다. 따라서 클러스터는 공개 인터넷에서 API에 연결할 수 없습니다. 클러스터는 예를 들어 클러스터가 Artifact Registry에서 이미지를 가져올 수 있도록 비공개 Google 액세스로 자동으로 구성됩니다. 노드에서 아웃바운드 인터넷 연결을 허용하는 추가 구성 없이 Google Cloud 외부의 API 및 이미지 레지스트리에 액세스할 수 없습니다.
이러한 연결을 제공하려면 Cloud Code에서 VPC에 Cloud NAT를 설정하면 됩니다.
Kubernetes 탐색기에서 클러스터를 마우스 오른쪽 버튼으로 클릭하고 비공개 GKE 인터넷 부여를 선택합니다.
[[["이해하기 쉬움","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\u003ePrivate clusters in Cloud Code are VPC-native and isolate nodes and pods from the public internet by default, relying on internal IP addresses.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code can connect to private clusters both with and without public endpoint access, using either the external or internal IP address in the KubeConfig.\u003c/p\u003e\n"],["\u003cp\u003eTo connect to a private cluster, Cloud Code must be on a machine within the cluster's network or have access via a proxy server, Cloud Interconnect, or Cloud VPN.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code can configure a proxy server for clusters without public API access to enable communication with the control plane.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code can enable outbound internet connections for private clusters to access external resources through Cloud NAT.\u003c/p\u003e\n"]]],[],null,["# Configure a private cluster in Cloud Code for IntelliJ\n\nA *private cluster* is a Virtual Private Cloud (VPC)-native cluster that only\ndepends on [internal IP addresses](/kubernetes-engine/docs/concepts/alias-ips#internal_ip_addresses).\nThis means that nodes and pods are isolated from the internet by default. This\npage explains how to use Cloud Code to connect to private\nclusters with and without public endpoint access and permit private clusters to\naccess resources from outside Google Cloud.\n\nFor information about private clusters, see\n[Private clusters](/kubernetes-engine/docs/concepts/private-cluster-concept).\nFor steps to configure private clusters, see\n[Creating a private cluster](/kubernetes-engine/docs/how-to/private-clusters).\n\nAdd a private GKE cluster to your KubeConfig\n--------------------------------------------\n\nAdding a private cluster in Cloud Code has the following behavior:\n\n- For clusters that have the public endpoint enabled, adding the cluster sets\n the cluster address in the KubeConfig to the external IP.\n\n- For clusters that have the public endpoint turned off, adding the cluster sets\n the cluster address in the KubeConfig to be the internal VPC IP of the\n cluster.\n\nTo add an authorized network to an existing cluster, make sure you are connected\nto an authorized network, as this cluster has [authorized networks enabled](/kubernetes-engine/docs/how-to/authorized-networks#add).\n\nTo learn more about connecting to VMs without external IP addresses, see\n[Securely connecting to VM instances](/solutions/connecting-securely#external).\nTo manage/delete the instances that you created, see\n[VM instances](https://console.cloud.google.com/compute/instances).\n\nTo successfully connect to the private cluster, Cloud Code must be\nrunning on a machine in the cluster's network or be able to access the cluster's\nnetwork, such as by using a proxy server, Cloud Interconnect, or\nCloud VPN.\n\nFor steps to create GKE clusters in Cloud Code\nand add existing GKE clusters to Cloud Code, see\n[create and configure a GKE cluster](/code/docs/intellij/create-configure-gke-cluster).\nCloud Code opens the Google Cloud console to create your cluster.\n\nAfter you create the cluster, [configure Cloud NAT](/nat/docs/gke-example?_ga=2.200274222.-1614030937.1640827593#gcloud)\nto enable outbound internet connections from your cluster if this was not set up\nduring cluster creation. To manage/delete the networks that you created, see\n[VPC networks](https://console.cloud.google.com/networking/networks/list).\n\nTroubleshoot issues connecting to private clusters\n--------------------------------------------------\n\nIf your dev environment isn't configured correctly to access a private cluster,\nrecommendations about how to resolve the issue appear in the following contexts:\n\n- In the Kubernetes Explorer, clusters that Cloud Code can't\n connect to appear with an error icon next to the cluster name.\n\n- When you try to run operations on a cluster that's inaccessible because of\n potential issues with the private cluster's configuration, a tooltip displays\n an error message with a longer explanation of the potential issue and\n potential workarounds. To view the error message, hold the pointer over a\n cluster with an error icon.\n\n- To view private cluster docs, right-click a cluster and select **View Private\n Cluster Docs**.\n\nConfigure a proxy server for a cluster\n--------------------------------------\n\nIf the\n[control plane API](https://kubernetes.io/docs/concepts/overview/kubernetes-api/)\nisn't available publicly, such as in a GKE cluster with public\nendpoint turned off, you can configure Cloud Code to proxy\nrequests to the control plane through a proxy server on the same network or VPC\nas the cluster:\n\n1. Configure a proxy server on the same network as your cluster if you haven't already. For steps to set up a Compute Engine VM as a basic proxy server, see [Remotely access a private cluster using a bastion host](/kubernetes-engine/docs/tutorials/private-cluster-bastion). For additional details, see [Creating Google Kubernetes Engine private clusters with network proxies for controller access](/architecture/creating-kubernetes-engine-private-clusters-with-net-proxies).\n2. Right-click the name of a cluster you've [added to Cloud Code](#private) and then click **Setup Kubectl Proxying** . Follow the prompts to enter the name of your proxy server, which is stored in the cluster's `proxy-url` field. The Kubernetes Explorer reloads to display the connected cluster.\n\n### Cancel Kubernetes proxying\n\nRight-click the name of a cluster you've configured for Kubernetes proxying and\nthen click **Cancel Kubectl Proxying** . Cloud Code\nstops proxying requests for the cluster by unsetting the `proxy-url` field\nin the KubeConfig.\n\nAccess resources outside Google Cloud from clusters\n---------------------------------------------------\n\nAll configurations of GKE private clusters don't provide nodes\nwith internet access. As a result, clusters can't reach APIs on the public\ninternet. Clusters are automatically configured with\n[Private Google Access](/vpc/docs/private-google-access),\nwhich, for example, permits clusters to pull images from Artifact Registry. APIs and\nimage registries outside of Google Cloud are inaccessible without\nadditional configuration to allow outbound internet connections from the nodes.\nTo provide these connections, you can set up\n[Cloud NAT](/nat/docs/overview#NATwithGKE) on your VPC from\nCloud Code:\n\n1. In the Kubernetes Explorer, right-click a cluster and select **Grant Private\n GKE Internet**.\n2. In the terminal, edit the [`gcloud compute routers create`](/sdk/gcloud/reference/compute/routers/create) and [`gcloud beta compute routers nats create`](/sdk/gcloud/reference/beta/compute/routers/nats/create) commands to specify the values for your application. Make sure that you choose the `{REGION}` where the private cluster is located. For a list of supported regions, see [Regions and zones](/compute/docs/regions-zones).\n3. To run the commands, press `Enter`.\n4. To manage/delete the routers that you created, see [Cloud Routers](https://console.cloud.google.com/hybrid/routers/list).\n\nWhat's next\n-----------\n\n- Learn about [Shared Virtual Private Cloud networks](/vpc/docs/shared-vpc).\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]