【问题标题】:Performance issues of containers in kubernetes podsKubernetes Pod 中容器的性能问题
【发布时间】: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


【解决方案1】:

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

【讨论】:

  • 当然,会试一试...谢谢
猜你喜欢
  • 2020-09-13
  • 2015-08-21
  • 1970-01-01
  • 1970-01-01
  • 2020-03-23
  • 2017-08-25
  • 2019-01-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多