Resize instance types on Container Engine cluster

前端 未结 5 708
半阙折子戏
半阙折子戏 2020-11-28 13:20

Some of our containers run better with memory above the instance type currently deployed in our Container Engine cluster. Is there a recommended practice to rebuild the con

5条回答
  •  旧巷少年郎
    2020-11-28 14:11

    A different approach would be:

    (1) to create a new node-pool to the GKE cluster with vertically scaled machine types ...

    $ gcloud container node-pools create pool-n1std2 --zone europe-west1-d --cluster prod-cluster-1 --machine-type  n1-standard-2  --image-type gci --disk-size=250 --num-nodes 3
    

    (2) then, migrate the workloads off the old nodes ...

    $ kubectl drain gke-prod-cluster-1-default-pool-f1eabad5-9ml5 --delete-local-data --force
    

    (3) and finally, to delete the old node-pool

    $ gcloud container node-pools delete default-pool --cluster=prod-cluster-1
    

    Notes:

    • Warning: Step 2 deletes node local volumes like emptyDir !!!
    • Step 2 needs to be repeated for each node in the pool
    • Instead of draining the nodes, one might configure a proper nodeSelector to schedule the pods onto the new pool. Label to be matched against would be cloud.google.com/gke-nodepool: pool-n1std2

提交回复
热议问题