7
2

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.

EKSで"Insufficient pods"が出てPodがPendingになったときの対処法

Last updated at Posted at 2019-09-12

状況

EKSクラスタに新しくPodをデプロイしたら、PodのStatusがPendingになってしまった。describeで確認すると、"pod insufficient"というメッセージがある。新しくたてたPodのみ全てこの症状で、以前からたっていたPodは問題なく動いている。

$ kubectl get pods       
NAME                                             READY   STATUS    RESTARTS   AGE
<pod-name>                                       0/1     Pending   0          14m

$ kubectl describe <pod-name>
Events:
  Type     Reason            Age                 From               Message
  ----     ------            ----                ----               -------
  Warning  FailedScheduling  57s (x26 over 15m)  default-scheduler  0/2 nodes are available: 2 Insufficient pods.

原因

原因は、EC2に割り当てられるセカンダリIP数の不足だった。この記事を見て知った。(EKS利用時に注意すべきポイント - Qiita)EC2インスタンスは各タイプによって、ネットワークインターフェイスの最大数が決まっていて、その上限を超えてしまっていた。(具体的な上限数などはここを参照 Elastic Network Interface - Amazon Elastic Compute Cloud

例えば、今回開発用に使用していたクラスタは、ワーカーノードに"m5.large"2つを使用していたため、クラスタ全体で、(3*10-1)*2=58 個しかセカンダリIPを使用することができない。つまりPodも58個までしか立てられない。

もちろん、Podの数を確認したら58個のPodがたっていて、それ以降スケジュールしたPodはPendingになっていた。

対処法

eksctlで作成したクラスタだったので、eksctl scaleでワーカーノードを増やした。これで解決した。

// クラスタ名を確認
$ eksctl get cluster --profile <profile>
NAME            REGION
<cluster-name>  ap-northeast-1

// nodegroup名を確認
$ eksctl get nodegroup --cluster=<cluster-name> --profile <profile>
CLUSTER          NODEGROUP          CREATED                 MIN SIZE        MAX SIZE        DESIRED CAPACITY        INSTANCE TYPE   IMAGE ID
<cluster-name>   <nodegroup-name>   2019-07-30T00:31:09Z    2               2               2                       m5.large        ami-0fde798d17145fae1


// node数を3に増やす
$ eksctl scale nodegroup --cluster=<cluster-name> --nodes=3 --name=<nodegroup-name> --profile <profile>
[ℹ]  scaling nodegroup stack "eksctl-<cluster-name>-nodegroup-<nodegroup-name>" in cluster eksctl-<cluster-name>-cluster
[ℹ]  scaling nodegroup, desired capacity from 2 to 3, max size from 2 to 3

参考

7
2
1

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?