【发布时间】:2019-07-26 23:51:28
【问题描述】:
我们正在尝试在 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
"""
}
}
}
请帮我解决问题。
【问题讨论】:
-
我认为 kubernetes github 问题是询问“性能”类问题的更好地方......
标签: docker jenkins kubernetes kubernetes-pod