<p>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).</p>

<p>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.</p>

<p>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.
<a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/</a></p>

<p>What are we missing?</p>

<p>minikube node capacity</p>

<pre><code>Capacity:
 cpu:     10
 memory:  9206328Ki
 pods:    110
Allocatable:
 cpu:     10
 memory:  9103928Ki
 pods:    110
</code></pre>

<p>Jenkins pipeline code</p>

<pre><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
          """
      }   
  }
  }
</code></pre>

<p>Please help me in troubleshooting.</p>

<p>Your problem may be exactly in using Minikube that uses full-blown virtualization.
My suggestion for you would be to setup <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/" rel="nofollow noreferrer">single master cluster</a> to get native performance and get rid of minikube.
As per experience - using this approach can dramatically increase performance.</p>
