[JIRA] (JENKINS-52259) Read pod template yaml from external file

10 views
Skip to first unread message

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Jun 28, 2018, 2:32:01 PM6/28/18
to jenkinsc...@googlegroups.com
Carlos Sanchez created an issue
 
Jenkins / New Feature JENKINS-52259
Read pod template yaml from external file
Issue Type: New Feature New Feature
Assignee: Andrew Bayer
Components: kubernetes-plugin, pipeline-model-definition-plugin
Created: 2018-06-28 18:31
Priority: Minor Minor
Reporter: Carlos Sanchez

When creating a Jenkinsfile I'd like to read the pom template from an external yaml, and not from embedded yaml in the agent definition yaml field which is harder to edit

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

andrew.bayer@gmail.com (JIRA)

unread,
Jun 28, 2018, 2:40:02 PM6/28/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on New Feature JENKINS-52259
 
Re: Read pod template yaml from external file

I think the solution here is to add a yamlFile or whatever parameter for the Kubernetes agent type, and modify KubernetesDeclarativeAgentScript to check if that parameter is given, and then assuming it is and the scm object in the Pipeline context is non-null (i.e., this is either a multibranch Pipeline or a standalone Pipeline with "Pipeline from SCM"), it would use readTrusted to load the yaml and pass it on from there. Seems pretty simple.

andrew.bayer@gmail.com (JIRA)

unread,
Jun 28, 2018, 3:11:02 PM6/28/18
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Jun 28, 2018, 3:11:02 PM6/28/18
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Jun 28, 2018, 3:11:03 PM6/28/18
to jenkinsc...@googlegroups.com
Andrew Bayer started work on New Feature JENKINS-52259
 
Change By: Andrew Bayer
Status: Open In Progress

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Jul 11, 2018, 7:40:02 AM7/11/18
to jenkinsc...@googlegroups.com
Carlos Sanchez updated New Feature JENKINS-52259
 

Merged in 1.10.0

Change By: Carlos Sanchez
Status: In Review Resolved
Resolution: Fixed

me+jenkins@bowlingx.com (JIRA)

unread,
Jul 27, 2018, 6:12:01 PM7/27/18
to jenkinsc...@googlegroups.com
David Heidrich commented on New Feature JENKINS-52259
 
Re: Read pod template yaml from external file

Using yamlFile does not work with parameterized git branch builds.

I'm getting the following exception when the plugin tries to load the file:

hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH} --prune" returned status code 128:
stdout: 
stderr: fatal: Couldn't find remote ref refs/heads/${BRANCH}

me+jenkins@bowlingx.com (JIRA)

unread,
Aug 13, 2018, 7:22:02 PM8/13/18
to jenkinsc...@googlegroups.com
David Heidrich edited a comment on New Feature JENKINS-52259
[~csanchez]. See my previous comment regarding parameterized builds and declarative pipeline.

me+jenkins@bowlingx.com (JIRA)

unread,
Aug 13, 2018, 7:22:02 PM8/13/18
to jenkinsc...@googlegroups.com
David Heidrich reopened an issue
 

See my previous comment regarding parameterized builds and declarative pipeline.

Change By: David Heidrich
Resolution: Fixed
Status: Resolved Reopened

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Aug 14, 2018, 4:39:01 AM8/14/18
to jenkinsc...@googlegroups.com
Carlos Sanchez resolved as Fixed
 

isn't that JENKINS-52623 ?
please do not reopen, and file a new issue instead if that's not the case

Change By: Carlos Sanchez
Status: Reopened Resolved
Resolution: Fixed

ajithkrishna6eng@gmail.com (JIRA)

unread,
Jun 26, 2019, 5:38:02 AM6/26/19
to jenkinsc...@googlegroups.com
Ajith Krishna commented on New Feature JENKINS-52259
 
Re: Read pod template yaml from external file

podTemplate(label: slave_label, cloud: "${cloud_name}", readFile : 'deploy.yml' )

{   }

 
i used deploy.yml and added all pod , namespace , name , image and resources etc.
but pod is not creating . its not even reading the yaml file. instead its going to docker hub internet. but my image is in my own artifactory . i checked kubernetes dashboard pod is not creating due jnlp was not created.
error is like pod bddrunner(my pod mentioned in yaml file) is offline
please help me to fix it.
 
yaml file:
apiVersion: v1kind: Podmetadata: name: bdd-runner namespace: edison-corespec: containers: - name: 'jnlp' image: 'myartifactory/jenkins/jnlp-slave:3.10-1-alpine' command: - cat tty: true - name: 'custom-slave' image: 'myartifactory/xxx' command: - cat tty: true
 

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

ajithkrishna6eng@gmail.com (JIRA)

unread,
Jun 26, 2019, 5:41:02 AM6/26/19
to jenkinsc...@googlegroups.com
Ajith Krishna edited a comment on New Feature JENKINS-52259
podTemplate(label: slave_label, cloud: "${cloud_name}", readFile : 'deploy.yml' ) {
 
}
 
i used deploy.yml and added all pod , namespace , name , image and resources etc.
but pod is not creating . its not even reading the yaml file. instead its going to docker hub internet. but my image is in my own artifactory . i checked kubernetes dashboard pod is not creating due jnlp was not created.
error is like pod bddrunner(my pod mentioned in yaml file) is offline
please help me to fix it.
 
yaml file:
apiVersion: v1kind v1
kind
: Podmetadata Pod
metadata
:
  name: bdd-runner
  namespace: edison- corespec core
spec
:
  containers:
  - name: 'jnlp'
    image: ' myartifactory hc-eu-west-aws-artifactory.cloud.health.ge.com / docker-snapshot-eis/ jenkins/jnlp-slave:3.10-1-alpine'
    command:
    - cat
    tty: true
  - name: 'custom-slave'
    image: ' myartifactory hc-eu-west-aws-artifactory.cloud.health.ge.com / xxx docker-snapshot-eis/eis-test-data/eis-test-data:latest '
    command:
    - cat
    tty: true
 

ajithkrishna6eng@gmail.com (JIRA)

unread,
Jun 26, 2019, 5:42:02 AM6/26/19
to jenkinsc...@googlegroups.com
Ajith Krishna edited a comment on New Feature JENKINS-52259
podTemplate(label: slave_label, cloud: "${cloud_name}", readFile : 'deploy.yml' ) {
 
}
 
i used deploy.yml and added all pod , namespace , name , image and resources etc.
but pod is not creating . its not even reading the yaml file. instead its going to docker hub internet. but my image is in my own artifactory . i checked kubernetes dashboard pod is not creating due jnlp was not created.
error is like pod bddrunner(my pod mentioned in yaml file) is offline
please help me to fix it.
 
yaml file:
apiVersion: v1
kind: Pod

metadata:
  name: bdd-runner
  namespace: edison-core
spec:
  containers:
  - name: 'jnlp'
    image: ' hc-eu-west-aws-artifactory.cloud.health.ge.com myartifactory / docker-snapshot-eis/ jenkins/jnlp-slave:3.10-1-alpine'

    command:
    - cat
    tty: true
  - name: 'custom-slave'
    image: ' hc my artifactorydocker - eu-west-aws-artifactory.cloud.health.ge.com/docker- snapshot- eis abs /eis-test-data/ eis-test-data absdata :latest'

    command:
    - cat
    tty: true

ajithkrishna6eng@gmail.com (JIRA)

unread,
Jun 26, 2019, 5:48:02 AM6/26/19
to jenkinsc...@googlegroups.com
Ajith Krishna edited a comment on New Feature JENKINS-52259
podTemplate(label: slave_label, cloud: "${cloud_name}", readFile : 'deploy.yml' ) {
 
}
 
i used deploy.yml and added all pod , namespace , name , image and resources etc.
but pod is not creating . its not even reading the yaml file. instead its going to docker hub internet. but my image is in my own artifactory . i checked kubernetes dashboard pod is not creating due jnlp was not created.
error is like pod bddrunner(my pod mentioned in yaml file) is offline
please help me to fix it.
 
yaml file:
apiVersion: v1
kind: Pod
metadata:
  name: bdd-runner
  namespace: edison-core
spec:
  containers:
  - name: 'jnlp'
    image: 'myartifactory/jenkins/jnlp-slave:3.10-1-alpine'

    command:
    - cat
    tty: true
  - name: 'custom-slave'
    image: 'my artifactorydocker-snapshot-abs/eis-test-data/absdata:latest'

    command:
    - cat
    tty: true

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:55 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages