[JIRA] (JENKINS-55887) Allow addition of custom resource limits in kubernetes containers

1 view
Skip to first unread message

seckler@in.tum.de (JIRA)

unread,
Jan 31, 2019, 5:19:03 AM1/31/19
to jenkinsc...@googlegroups.com
Steffen Seckler created an issue
 
Jenkins / New Feature JENKINS-55887
Allow addition of custom resource limits in kubernetes containers
Issue Type: New Feature New Feature
Assignee: Carlos Sanchez
Attachments: image-2019-01-31-11-14-25-885.png
Components: kubernetes-plugin
Created: 2019-01-31 10:18
Labels: kubernetes-plugin
Priority: Minor Minor
Reporter: Steffen Seckler

Description
Currently, it is not possible to add custom resource limits to kubernetes containers unless you write raw yaml.
A rudimentary example would be:

...
   containers:
    - name: NAME
      ...
      resources:
        limits:
          nvidia.com/gpu: 1 # requesting 1 GPU
...

Here the last line cannot be added easily with the interface.

Possible Solution
Add this functionality similar to the EnvVars variable, where multiple limits can be defined by hand with name and value. So basically replace EnvVars with limits in the following screenshot:

Additional Context
A complete example (not for jenkins) would be:

apiVersion: v1
kind: Pod
metadata:
  name: cuda-vector-add
  namespace: nvidia 
spec: 
  restartPolicy: OnFailure
  serviceAccount: nvidia-deviceplugin
  serviceAccountName: nvidia-deviceplugin
  containers:
    - name: cuda-vector-add
      image: "docker.io/mirrorgooglecontainers/cuda-vector-add:v0.1"
      env:
        - name: NVIDIA_VISIBLE_DEVICES
          value: all
        - name: NVIDIA_DRIVER_CAPABILITIES
          value: "compute,utility"
        - name: NVIDIA_REQUIRE_CUDA
          value: "cuda>=5.0"
      securityContext:
        privileged: true
      resources:
        limits:
          nvidia.com/gpu: 1 # requesting 1 GPU
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

seckler@in.tum.de (JIRA)

unread,
Feb 1, 2019, 3:27:02 AM2/1/19
to jenkinsc...@googlegroups.com

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Feb 1, 2019, 3:59:02 AM2/1/19
to jenkinsc...@googlegroups.com
Carlos Sanchez commented on Improvement JENKINS-55887
 
Re: Allow addition of custom resource limits in kubernetes containers

the yaml option is there so we don't need to write new ui/methods for each possible k8s api option

seckler@in.tum.de (JIRA)

unread,
Feb 1, 2019, 5:33:01 AM2/1/19
to jenkinsc...@googlegroups.com
Steffen Seckler edited a comment on Improvement JENKINS-55887
ok, just saying that it would be nice for the more inexperienced users to have an easy option to add these limitations.

Fyi: got the raw input working with:
{code}
spec:

  serviceAccount: nvidia-deviceplugin
  serviceAccountName: nvidia-deviceplugin
  containers:
    - name: cuda-10
      image: "nvidia/cuda:10.0-devel-centos7"

      env:
        - name: NVIDIA_VISIBLE_DEVICES
          value: all
        - name: NVIDIA_DRIVER_CAPABILITIES
          value: "compute,utility"
        - name: NVIDIA_REQUIRE_CUDA
          value: "cuda>=5.0"
        - name: HOME
          value: /home/jenkins
      tty: true
      args:
        - cat
      command:
        - /bin/bash
        - -i
        - -c

      securityContext:
        privileged: true
      resources:
        limits:
          nvidia.com/gpu: 1 # requesting 1 GPU
{code}
especially the tty+command part  should not be forgotten. Do I actually need to infuse the jenkins secrets somehow? or are they only relevant for the default (jnlp) container
?

seckler@in.tum.de (JIRA)

unread,
Feb 1, 2019, 5:33:02 AM2/1/19
to jenkinsc...@googlegroups.com

ok, just saying that it would be nice for the more inexperienced users to have an easy option to add these limitations.

Fyi: got the raw input working with:

spec:
  serviceAccount: nvidia-deviceplugin
  serviceAccountName: nvidia-deviceplugin
  containers:
    - name: cuda-10
      image: "nvidia/cuda:10.0-devel-centos7"

especially the tty+command part should not be forgotten. Do I actually need to infuse the jenkins secrets somehow? or are they only relevant for the default (jnlp) container

jglick@cloudbees.com (JIRA)

unread,
Jul 16, 2019, 3:43:34 PM7/16/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Unassigned
 
Change By: Jesse Glick
Assignee: Carlos Sanchez
Reply all
Reply to author
Forward
0 new messages