【问题标题】:Evicted pods policy settings in AKSAKS 中的逐出 pod 策略设置
【发布时间】:2020-07-08 08:08:42
【问题描述】:

我有一个 AKS。托管集群,Microsoft 正在管理主服务器。一切都很好,除了我看到很多被驱逐的豆荚,我不时去删除这些“被驱逐的豆荚”。我应该如何/在哪里设置策略来专门在 Azure AKS 中自动清理这些 Evited pod。

【问题讨论】:

    标签: kubernetes azure-aks kubelet


    【解决方案1】:

    在 Kubernetes 控制器管理器组件中有一个标志 --terminated-pod-gc-threshold。但是由于集群是由微软管理的,所以不能修改flag并将默认值设置为较低。

    --terminated-pod-gc-threshold int32     Default: 12500
    Number of terminated pods that can exist before the terminated pod garbage collector starts deleting terminated pods. If <= 0, the terminated pod garbage collector is disabled.
    

    所以最好的办法是编写一个脚本并按计划运行。

    https://gist.github.com/psxvoid/71492191b7cb06260036c90ab30cc9a0

    【讨论】:

    • 谢谢萨杜。没有办法在我理解的 AKS .script 中的工作节点上配置 kubelet,但我必须为此登录工作节点,然后设置一个 cronjob。如果添加新节点会怎样
    • 此脚本使用 kubectl 与 Kubernetes API 服务器对话...运行脚本,您无需登录工作节点
    猜你喜欢
    • 2021-04-17
    • 2019-08-08
    • 2013-12-14
    • 1970-01-01
    • 1970-01-01
    • 2019-08-03
    • 2020-12-03
    • 2018-11-12
    • 2018-07-17
    相关资源
    最近更新 更多