LoginSignup
3
3

More than 5 years have passed since last update.

GKE(google kubernetes engine)の スペック変更方法

Posted at
  • gcloud インストール
  • gcloud コマンド環境設定
  • kubernetes スペック変更
    • クラスタ数 変更
    • CPU,メモリ変更

gcloud インストール

$ curl https://sdk.cloud.google.com | bash

インストール中の質問は全てエンターキーで問題ありません。

gcloudコマンド環境設定

  • アカウントログイン
$ gcloud auth login
$ gcloud auth application-default login
  • 現状のgcloud 設定確認
$ gcloud config list
  • 基本プロジェクトの設定
$ gcloud config set project (自分のプロジェクトID)
$ gcloud 
  • リージョンとゾーンの設定
    (日本はasia-east1を選択がいいと思います。)
$ gcloud config set compute/zone asia-east1
  • 再度のgcloud 設定確認
$ gcloud config list

【アカウント設定の参考URL】
https://cloud.google.com/kubernetes-engine/docs/tutorials/migrating-node-pool?hl=ja

Kubernetes スペック変更

クラスタ数 変更

$ gcloud container clusters resize (クラスタ名) --size (半角数字)

例:(この例だった場合のコマンド)
クラスタ名 : test-cluster
クラスタサイズ : 5

$ gcloud container clusters resize test-cluster --size 5

【kubernetesのクラスタ変更参考URL】
https://cloud.google.com/kubernetes-engine/docs/resize-cluster?hl=ja

CPU,メモリの増減(インスタンスの変更)

CPU設定

  • 2.6 GHz Intel Xeon E5(Sandy Bridge)
  • 2.5 GHz Intel Xeon E5 v2(Ivy Bridge)
  • 2.3 GHz Intel Xeon E5 v3(Haswell)
  • 2.2 GHz Intel Xeon E5 v4(Broadwell)
  • 2.0 GHz Intel Xeon(Skylake)
gcloud container node-pools create n1s8-pool --cluster $CLUSTER_NAME --machine-type=n1-standard-8 --num-nodes=2 --enable-autoscaling --min-nodes=2 --max-nodes=10

最小VMの設定

gcloud compute instances create example-instance --zone europe-west1-b --min-cpu-platform "Intel Haswell"
3
3
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
3
3