0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Google Kubernetes Engine (GKE)

Last updated at Posted at 2025-08-24

GKEとは

  • Googleが開発したKubernetesを本家として提供するマネージドサービス。

  • 数クリック・数コマンドでクラスターを構築可能。

  • ノードの管理やアップグレードはGoogleに任せられるため、ユーザーはアプリケーション開発に集中できる。

GKEのモード

Standardモード

  • ユーザーがノード(VM)の管理を行う従来型。

  • 柔軟なカスタマイズが可能。

  • 料金はノード数・サイズに基づく。

Autopilotモード

  • 完全マネージド型。ノード管理は不要。

  • Pod単位での課金モデル。

  • 運用負荷が非常に小さく、小規模プロジェクトや検証環境にも最適。

代表的な機能

  • オートスケーリング(Pod / ノード両方対応)

  • 自動アップグレード(マイナーバージョンの適用をGoogleに任せられる)

  • VPCネイティブモードによるPodごとのIP割り当て

  • Cloud Monitoring / Loggingとの統合で運用性が高い

使い始める手順の例

# クラスタ作成(Autopilot)
gcloud container clusters create-auto my-cluster \
  --region=asia-northeast1

# Podデプロイ
kubectl create deployment hello-server \
  --image=gcr.io/google-samples/hello-app:1.0

# Service公開
kubectl expose deployment hello-server \
  --type=LoadBalancer --port 80 --target-port 8080

数コマンドでアプリをデプロイできるのが、GKEの分かりやすさ。

Blue/Green デプロイ(ゼロダウンタイム切替)

概要

  • Blue/Green は「現在稼働中(Blue)」と「新バージョン(Green)」を同時に立て、疎通確認後に瞬時に切替える方式です。

  • ロールバックは Service の selector を戻すだけ なので高速・安全です。

  • シンプルに実装するなら Kubernetes Service の selector 切替で実現できます(加重配分が不要な場合)。

構成イメージ

  • Deployment: hello-blue(安定版 v1)、hello-green(新 v2)

  • Service: hello(外部公開)。selector で color=blue ⇔ color=green を切替

flowchart LR
  subgraph Cluster[GKE Cluster]
    SVC[(Service: hello)]
    BLUE[Deployment: hello-blue\nlabels: app=hello, color=blue]
    GREEN[Deployment: hello-green\nlabels: app=hello, color=green]
  end
  Client((Users)) -->|HTTP| SVC
  SVC --> BLUE
  %% 切替時は SVC --> GREEN に付け替え

EKSとの比較

GKE:UIや自動化が充実しており、学習コストが低い。

EKS:AWSサービス群との統合が強力だが、設定項目が多く学習コストは高め。

どちらも「サーバレス的利用(GKE Autopilot / EKS on Fargate)」に対応。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?