Performance issues of containers in kubernetes pods

3/5/2019

We are trying to setup scalable jenkins on a kubernetes cluster to build and deploy our app. Able to successfully scale jenkins slaves using kubernetes on a Dev Machine(Spec: 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. Whereas building the same application on the same image inside a slave pod takes ~5hrs.

Tried setting the CPU/Mem (limits, requests) on the slave pod and also tried setting multiple default values in limitrange. but it has no effect on build time. https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

What are we missing?

minikube node capacity

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.

-- JimK
docker
jenkins
kubernetes
kubernetes-pod

1 Answer

3/6/2019

Your problem may be exactly in using Minikube that uses full-blown virtualization. My suggestion for you would be to setup single master cluster to get native performance and get rid of minikube. As per experience - using this approach can dramatically increase performance.

-- VKR
Source: StackOverflow