[JIRA] (JENKINS-51353) In declarative pipeline, volumes and imagepullsecrets needed

2 views
Skip to first unread message

luckyhorang@nate.com (JIRA)

unread,
May 16, 2018, 4:12:02 AM5/16/18
to jenkinsc...@googlegroups.com
Hokwang Lee created an issue
 
Jenkins / Improvement JENKINS-51353
In declarative pipeline, volumes and imagepullsecrets needed
Issue Type: Improvement Improvement
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2018-05-16 08:11
Priority: Major Major
Reporter: Hokwang Lee

Hello.

 

I can use scripted pipeline with imagepullsecrets and volumes like below,

but in declaritive pipeline, I can't use it.

 

podTemplate(
  label: 'mypod',
  imagePullSecrets: [ 'regcred' ],
  containers: [
    containerTemplate(name: 'test', image: '1.2.3.4/ubuntu_14.04_w_c', ttyEnabled: true, command: 'cat')
  ],
  volumes: [
  hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock')
  ]
) {
}
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

jenkins-ci@carlossanchez.eu (JIRA)

unread,
May 17, 2018, 6:03:01 PM5/17/18
to jenkinsc...@googlegroups.com

luckyhorang@nate.com (JIRA)

unread,
May 20, 2018, 9:14:02 PM5/20/18
to jenkinsc...@googlegroups.com

jenkins-ci@carlossanchez.eu (JIRA)

unread,
May 25, 2018, 4:22:02 AM5/25/18
to jenkinsc...@googlegroups.com
Carlos Sanchez resolved as Not A Defect
 
Change By: Carlos Sanchez
Status: Open Resolved
Resolution: Not A Defect

luckyhorang@nate.com (JIRA)

unread,
May 28, 2018, 2:23:02 AM5/28/18
to jenkinsc...@googlegroups.com
Hokwang Lee closed an issue as Not A Defect
Change By: Hokwang Lee
Status: Resolved Closed

luckyhorang@nate.com (JIRA)

unread,
May 28, 2018, 2:33:02 AM5/28/18
to jenkinsc...@googlegroups.com
 
Re: In declarative pipeline, volumes and imagepullsecrets needed

Yes, yaml syntax works well! Thank you for your cooperation.

abergmeier@gmx.net (JIRA)

unread,
Nov 23, 2018, 8:13:01 AM11/23/18
to jenkinsc...@googlegroups.com

YAML is not the same as `volumes`, though. The latter automatically applies to all containers. With config in YAML you have to write a whole lot more declarations.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

tony_manimala@yahoo.co.in (JIRA)

unread,
Jul 3, 2019, 2:04:03 AM7/3/19
to jenkinsc...@googlegroups.com

Hi,

Please help what is wrong here.?

Tried with yaml format and it didnt worked.

Any help appreciated.

pipeline {

agent {
kubernetes {
  label machine_label
  inheritFrom 'jenkins-slave'
  namespace '${slave_namespace}'
  nodeSelector '${slave_nodeselector}'
  yaml """
kind: Pod
metadata:
spec:
containers:
- name: 'launcher'
image: ${launcher_img}
imagePullPolicy: IfNotPresent
imagePullSecrets: '${img_key}'
command:
- cat
tty: true
volumeMounts:
  - hostpath: '/etc/passwd'
    mountPath: '/etc/passwd'
"""
}

Reply all
Reply to author
Forward
0 new messages