我想在AKS上配置群集自动缩放器。缩小时由于PDB而失败:
public class Farming
{
[Key]
public int Id { get; set; }
public string Localization { get; set; }
public List<Animal> Animals { get; set; }//
public List<Worker> Workers { get; set; }//
}
public class Animal
{
[Key]
public int Id { get; set; }
public DateTime BirthDate { get; set; }
public bool Sex { get; set; }
public DateTime ImpregnationDate { get; set; }
[ForeignKey("Farming")]
public int FarmingId { get; set; }
public Farming Farming { get; set; }
}
public class Worker //pracownik
{
[Key]
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Position { get; set; }
public float Salary { get; set; }
public DateTime EmploymentDate { get; set; }
public DateTime EndOfEmploymentDate { get; set; }
[ForeignKey("Farming")]
public int FarmingId { get; set; }
public Farming Farming { get; set; }
}
所有系统Pod均已手动分配了I1207 14:24:09.523313 1 cluster.go:95] Fast evaluation: node aks-nodepool1-32797235-0 cannot be removed: no enough pod disruption budget to move kube-system/metrics-server-5cbc77f79f-44f9w
I1207 14:24:09.523413 1 cluster.go:95] Fast evaluation: node aks-nodepool1-32797235-3 cannot be removed: non-daemonset, non-mirrored, non-pdb-assignedkube-system pod present: cluster-autoscaler-84984799fd-22j42
I1207 14:24:09.523438 1 scale_down.go:490] 2 nodes found to be unremovable in simulation, will re-check them at 2018-12-07 14:29:09.231201368 +0000 UTC m=+8976.856144807
PDB。我可以想象这不适用于仅具有单个副本的POD,例如minAvailable: 1
:
metrics-server
需要进行哪些更改(副本数或PDB配置?),才能进行缩小操作?
答案 0 :(得分:0)
基本上,这是在耗尽由PDB(Pod中断预算)配置的节点时的管理问题
这是因为驱逐被迫遵守您指定的PDB
您有两个选择:
要么用力压手:
kubectl drain foo --force --grace-period=0
您可以从文档中检查其他选项-> https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#drain
或使用驱逐API:
{
"apiVersion": "policy/v1beta1",
"kind": "Eviction",
"metadata": {
"name": "quux",
"namespace": "default"
}
}
无论如何,drain或驱逐api会尝试在pod上删除,以便在完全耗尽节点之前将它们安排在其他地方
如文档中所述:
API可以通过以下三种方式之一进行响应:
对于给定的驱逐请求,有两种情况:
没有与该广告连播匹配的预算。在这种情况下,服务器始终返回200 OK。
至少有一个预算。在这种情况下,以上三个响应中的任何一个都可能适用。
如果卡住,则可能需要手动进行