Member-only story
動作中のKubernetes Cluster Autoscaler(後半)
Sep 20, 2022
Kubernetes Cluster Autoscalerに関しての記事です。長い記事なので、前半と後半の2つに分けて投稿いたします。今回は後半です。
さて、それではCluster Autoscalerの helm chartをインストールしましょう。
$ git clone https://github.com/pavan-kumar-99/medium-manifests.git \-b cluster-autoscaler-gce$ helm repo add autoscaler https://kubernetes.github.io/autoscaler$ helm upgrade -i medium-ca-gce autoscaler/cluster-autoscaler -f as.yaml
ログから、Managed Instanceグループが自動的に検出されたことが確認できるはずです。
kubectl logs medium-ca-gce-cluster-autoscaler-568f44fc67–675dx
kubectl get no | awk ‘{print $1}’
NAME
master-us-central1-a-l918
nodes-us-central1-a-q9ns
これが、マスターノード 1 台とワーカーノード 1 台からなるクラスタ トポロジです。シンプルな nginx デプロイメントを作成し、100 レプリカまでスケールさせてみましょう。
kubectl create deploy nginx — image=nginx
kubectl scale deploy nginx — replicas=40
私のPodがペンディング状態になると、CAは必要なノード数を計算し、新しいノードのスケーリングをトリガーします。