LoginSignup
15
8

More than 3 years have passed since last update.

3パターンあるGKE Private Cluster構成の違い

Posted at

はじめに

GKE Private Clusterの構成は、以下の3パターン構成ありますが、マニュアルを読んでもイメージしづらいため整理してみました。

  • 1. No client access to the public endpoint
  • 2. Limited access to the public endpoint
  • 3. Unrestricted access to the public endpoint

GKE Private Clusterとは

Private Clusterは、ワーカーノードにPublic IPが付与されていないGKE Clusterです。Master nodeで起動しているAPI serverに対してkubectlを実行するエンドポイントの設定方法によって3つの種類が構成可能です。

Google Kubernetes Engine(GKE)で限定公開クラスタを作成する方法について説明します。限定公開クラスタでは、ノードに RFC 1918 の内部 IP アドレスのみがあるため、ワークロードが公共のインターネットから隔離されるようになります。限定公開クラスタの仕組みについて詳しくは、限定公開クラスタをご覧ください

前提となる用語の説明

Private Node: Public IPがアタッチされていないWorker Node。
Public Endpoint: GCP Managed VPC上で起動しているMaster Nodeにアクセスするためインターネットに公開されたエンドポイント。
Private Endpoint: GCP Managed VPC上で起動しているMasterNodeにVPC Peeringを使って接続するためのエンドポイント。インターネットを経由しない。
Master Authorized Network: Public Endpointへのアクセスが許可されたネットワーク。

Public Cluster

Private Clusterを有効しないでGKE Clusterを作成すると、Public Clusterになります。
Public Clusterは、Worker NodeにPublic IPが付与されています。また、Master NodeへのアクセスはPublic Endpoint経由になります。

image.png

1.No client access to the public endpoint

Woker NodeにPublic IPが付与されおらず、Master NodeにアクセスするためのPublic Endpointもない構成です。Worker node(Kubeletなど)からMaster Node(API Server)の通信は、VPC Peeringを経由して行います。kubectlなどの処理も、VPC Peeringを経由してPrivate Endpointに対してアクセスします。
kubectlは、Worker NodeがホストされたVPC内にGCEインスタンスを起動するとアクセス可能となります。

image.png

2.Limited access to the public endpoint

Woker NodeにPublic IPが付与されていないが、Master NodeにアクセスするためのPublic Endpointは提供された構成です。ただし、Master NodeのPublic Endpointにアクセス可能なネットワークを制限します。許可されたネットワークは、マスター認証済みネットワークと呼びます。
VPC内のGCEインスタンスを立ててkubectl叩いてもMaster Nodeにはアクセスできない。

image.png

3.Unrestricted access to the public endpoint

Woker NodeにPublic IPが付与されていないが、Master NodeにアクセスするためのPublic Endpointは提供された構成です。Master NodeのPublic Endpointにアクセス可能なネットワークを制限しません。
VPC内のGCEインスタンスを立ててkubectl叩いてもMaster Nodeにはアクセスできない。

image.png

表で整理してみる

表で整理すると以下になります。
image.png

Cluster作成時のgcloudコマンドのオプションの違いとしては以下になります。
image.png

投稿内容は私個人の意見であり、所属企業・部門見解を代表するものではありません。

15
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
8