2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GKEでクラスタ作るときのメモ

Last updated at Posted at 2019-01-14

f1-microインスタンスは3個以上でないとGKEクラスタが作れないが、
一度クラスタを作成してからインスタンスグループをスケーリングすることで一個でのクラスタに変更できる。(参考)
f1-microはメモリが0.6GBしかないので、自動でデプロイされるコンテナできちきちな状況。
ログのコンテナとか色々無効にすれば空きはでるものの (参考)、いろんなコンテナデプロイして試すにはやっぱりメモリがある程度欲しいよねってことでn1-standard-1を使うことにした。
n1-standard-1だとノードの数が1個でもクラスタは起動できるみたい。

  1. クラスタを作成

    $ gcloud container clusters create hitochan-cluster \
      --machine-type=n1-standard-1 \
      --num-nodes=1 \
      --disk-size=10 \
      --no-enable-cloud-logging \
      --enable-autorepair \
      --preemptible
    
  2. インスタンスグループの一覧を表示して名前をメモしておく。

    $ gcloud compute instance-groups managed list                                                                                                                            
    NAME                                            LOCATION       SCOPE  BASE_INSTANCE_NAME                          SIZE  TARGET_SIZE  INSTANCE_TEMPLATE                           AUTOSCALED
    gke-hitochan-cluster-default-pool-6618700a-grp  us-central1-a  zone   gke-hitochan-cluster-default-pool-6618700a  1     1            gke-hitochan-cluster-default-pool-6618700a  no
    
  3. 2でメモしたインスタンスグループ名を指定して、インスタンス数を変更する。節約したいので使わないときは0にしておく。

    $ gcloud compute instance-groups managed resize gke-hitochan-cluster-default-pool-6618700a-grp --size=0
    
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?