当虚拟保证 Pod 正在运行时,保证应用程序 Pod 处于待处理状态
在我的项目中,我需要测试保证应用程序 Pod 是否应驱逐任何正在运行的虚拟应用程序 Pod。如何实现应用程序 Pod 始终具有最高优先级?
In my project, I need to test if Guaranteed Application pods should evict any dummy application pods which are running. How do I achieve that application pods always have the highest priority?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
P.... 提供的答案非常好且有用。通过 Pod 优先级和抢占,您可以实现您的目标最多。
然而,除此之外,您还可以使用专用解决方案,例如在云中。查看 Google 云示例:
针对其他云的其他指南:
请参阅还有这个有用的教程。
The answer provided by the P.... is very good and useful. By Pod Priority and Preemption you can achieve what you are up to.
However, apart from that, you can use dedicated solutions, for example in the clouds. Look at the Google cloud example:
Additional guides for other clouds:
See also this useful tutorial.
您可以使用 kind: PriorityClass 为您的应用程序提供比普通 Pod 更高的优先级。
You can make use of kind: PriorityClass to give your application a higher priority then normal pods.
驱逐是基于 Pod 的优先级、QoS 和 Pod 的实际使用情况。如果Pod属于更高优先级的Pod,它的创建将抢占bestEffort,然后是burstable,最后是保证的Pod。
例如:在我的集群中,我有以下 优先级类:
为了举例,我使用了
system-cluster-ritic
类。不要这样做,有你的优先级。接下来的 Pod 将导致其他 Pod 被驱逐。在其他 pod 的描述中,您将看到以下内容:
请注意,如果您的集群中没有全局默认的优先级,则没有任何优先级的 pod 的优先级将为零(最小优先级)。因此,根据应用程序的类型,您应该创建和使用多个优先级类别。
The eviction is based on the priority of the Pod, QoS, and the actual usage of the Pod. If the Pod belongs to a higher priority pod, its creation will preempt the bestEffort, followed by burstable followed by guaranteed pods.
For example: In my cluster, I have the following priority classes:
For the sake of example, I used the
system-cluster-critical
class. Do not do this, have your priority class. The following Pod would lead to the eviction of other pods.In the description of the other pods, you would see the following:
Note that if in your cluster there is no priority class with global default then the priority of the pods without any priority class would be zero(minimum priority). So based on the type of application you should have multiple priority classes created and used.