gpt4 book ai didi

docker - Kubernetes Pod 中容器的性能问题

转载 作者:行者123 更新时间:2023-12-02 12:17:16 25 4
gpt4 key购买 nike

我们正在尝试在 kubernetes 集群上设置可扩展的 jenkins 来构建和部署我们的应用程序。
能够在开发机器上使用 kubernetes 成功扩展 jenkins slave(规范:CentoOS 7, 12 cpu/core, 16G)。

然而,应用程序构建时间正在受到极大的影响。
在 CentOS 主机上,在 debian docker 镜像上构建应用程序所需的时间是 1.5 小时。而在从属 pod 内的相同镜像上构建相同的应用程序需要大约 5 小时。

尝试在从属 pod 上设置 CPU/Mem(限制、请求),并尝试在 limitrange 中设置多个默认值。但它对构建时间没有影响。
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

我们缺少什么?

minikube 节点容量

Capacity:
cpu: 10
memory: 9206328Ki
pods: 110
Allocatable:
cpu: 10
memory: 9103928Ki
pods: 110

Jenkins 管道代码
def label = "slave-${UUID.randomUUID().toString()}"

podTemplate(label: label, containers: [
containerTemplate(name: 'todebian',
image: 'registry.gitlab.com/todebian:v1',
command: 'cat',
ttyEnabled: true,
resourceRequestCpu: '2',
resourceLimitCpu: '3',
resourceRequestMemory: '1024Mi',
resourceLimitMemory: '2048Mi')
],
volumes: [
hostPathVolume(mountPath: '/workspace', hostPath: '/hosthome/workspace_linux1')
]) {
node(label) {
container('todebian'){
sh """
cd /workspace
./make
"""
}
}
}

请帮助我进行故障排除。

最佳答案

您的问题可能正是在使用使用成熟虚拟化的 Minikube 时。
我的建议是设置 single master cluster获得 native 性能并摆脱 minikube。
根据经验 - 使用这种方法可以显着提高性能。

关于docker - Kubernetes Pod 中容器的性能问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55004055/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com