简体   繁体   English

Kubernetes Pod 中容器的性能问题

[英]Performance issues of containers in kubernetes pods

We are trying to setup scalable jenkins on a kubernetes cluster to build and deploy our app.我们正在尝试在 kubernetes 集群上设置可扩展的 jenkins 来构建和部署我们的应用程序。 Able to successfully scale jenkins slaves using kubernetes on a Dev Machine(Spec: CentoOS 7, 12 cpu/core, 16G).能够在开发机器上使用 kubernetes 成功扩展 jenkins slaves(规格:CentoOS 7, 12 cpu/core, 16G)。

However Application build time is being effected drastically.然而,应用程序构建时间受到了极大的影响。 Time taken to build an application on a debian docker image is 1.5hrs on a CentOS host.在 CentOS 主机上,在 debian docker 映像上构建应用程序所需的时间为 1.5 小时。 Whereas building the same application on the same image inside a slave pod takes ~5hrs.而在从属 Pod 内的同一图像上构建相同的应用程序需要大约 5 小时。

Tried setting the CPU/Mem (limits, requests) on the slave pod and also tried setting multiple default values in limitrange.尝试在从属 Pod 上设置 CPU/Mem(限制、请求),并尝试在 limitrange 中设置多个默认值。 but it has no effect on build time.但它对构建时间没有影响。 https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

What are we missing?我们缺少什么?

minikube node capacity minikube 节点容量

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

Jenkins pipeline code詹金斯管道代码

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
          """
      }   
  }
  }

Please help me in troubleshooting.请帮我排除故障。

Your problem may be exactly in using Minikube that uses full-blown virtualization.您的问题可能恰恰在于使用使用全面虚拟化的 Minikube。 My suggestion for you would be to setup single master cluster to get native performance and get rid of minikube.我对您的建议是设置单个主集群以获得本机性能并摆脱 minikube。 As per experience - using this approach can dramatically increase performance.根据经验 - 使用这种方法可以显着提高性能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM