How To Configure Agent Pod Resources Using the Helm Chart

Hello! I am setting up a new Jenkins system in Kubernetes using the Helm chart. I am using the official docs from jenkins.io to do so and am having an issue providing my agent with enough memory.

Here’s how I’ve configured the agent section in the values.yaml file:

  agent:
    enabled: true
    podName: "jenkins-agent-temp"
    namespace: testing
    image: docker.io/my-image-with-everything
    tag: stable
    imagePullSecretName: dockerhub-secret
    runAsUser: pyuser
    alwaysPullImage: true
    connectTimeout: 500
    workingDir: /home/pyuser/agent
    command: "/opt/bin/entry_point.sh"
    TTYEnabled: false
    idleMinutes: 20
    podRetention: "Never"
    resources:
      limits:
        cpu: 2000m
        memory: 6144Mi
      requests:
        cpu: 1500m
        memory: 4608Mi

Note: my-image-with-everything includes a jenkins agent, python, our testing libraries, Selenium standalone and Chrome so we can run UI tests.

(Almost) Everything works great. When I launch a job, it creates a pod and a container that runs that custom image. It’s able to use all of the software installed. However, the resource limits aren’t reflected. When I look at the running pod I only see 512 MB of RAM allocated.

How should I be configuring the resource limits? Should I create a new Podtemplate and then add my container there and set disableDefaultAgent = true?

Good news! I was able to solve the problem by simply restarting the controller and killing all of the agents that were running at the time. I guess the issue was that I had made a lot of big changes to the helm chart and not restarted the controller in a while.