Jenkins - Kubernetes Plugin inm OpenShift. Only jnlp containers work The 2019 Stack Overflow Developer Survey Results Are InJenkins Kubernetes plugin spawns one slaveKubernetes plugin containers can't connect back to JenkinsJenkins kubernetes plugin not passing environment variables with PipelineHow to pass jenkins build environment into pod using kubernetes plugin?Jenkins kubernetes plugin not workingJenkins Kubernetes plugin failing to provision jnlp-slave podsDeclarative Jenkins Pipeline use existing Kubernetes Pod Templatejenkins kubernetes plugin - Waiting for agent to connect (1/100)Jenkins Plugin for Kubernetes Deployment (EKS)Jenkins kubernetes plugin. Getting authorization error in connection from agent to Jenkins master

If a poisoned arrow's piercing damage is reduced to 0, do you still get poisoned?

What do hard-Brexiteers want with respect to the Irish border?

Limit the amount of RAM Mathematica may access?

Why isn't airport relocation done gradually?

Does light intensity oscillate really fast since it is a wave?

How long do I have to send payment?

Why is the maximum length of openwrt’s root password 8 characters?

Why is Grand Jury testimony secret?

Any good smartcontract for "business calendar" oracles?

The difference between dialogue marks

Inflated grade on resume at previous job, might former employer tell new employer?

How was Skylab's orbit inclination chosen?

Does it makes sense to buy a new cycle to learn riding?

What is this 4-propeller plane?

Pristine Bit Checking

is usb on wall sockets live all the time with out switches off

How to make payment on the internet without leaving a money trail?

Why could you hear an Amstrad CPC working?

How to answer pointed "are you quitting" questioning when I don't want them to suspect

Landlord wants to switch my lease to a "Land contract" to "get back at the city"

Carnot-Caratheodory metric

Should I use my personal or workplace e-mail when registering to external websites for work purpose?

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

Lethal sonic weapons



Jenkins - Kubernetes Plugin inm OpenShift. Only jnlp containers work



The 2019 Stack Overflow Developer Survey Results Are InJenkins Kubernetes plugin spawns one slaveKubernetes plugin containers can't connect back to JenkinsJenkins kubernetes plugin not passing environment variables with PipelineHow to pass jenkins build environment into pod using kubernetes plugin?Jenkins kubernetes plugin not workingJenkins Kubernetes plugin failing to provision jnlp-slave podsDeclarative Jenkins Pipeline use existing Kubernetes Pod Templatejenkins kubernetes plugin - Waiting for agent to connect (1/100)Jenkins Plugin for Kubernetes Deployment (EKS)Jenkins kubernetes plugin. Getting authorization error in connection from agent to Jenkins master



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am currently working on a build pipeline in OpenShift using the following Configuration



openshift: v3.6.173.0.140

Jenkins: 2.017 (using the redhat images from https://github.com/openshift/jenkins)

Jenkins-Kubernetes plugin 1.12.2



As Jenkins Agents I am using the nodejs agents supplied by the openshift jenkins template and images that build up on them (e.g. one image that I also fittet with a typescript compiler)



Now what I want to do is to run pods with multiple containers (not just the jnlp one but standard node, go etc. containers) Now according to the documentation this should not be a problem (https://github.com/jenkinsci/kubernetes-plugin) as I should just add containers to my podTemplate like



podTemplate(label: mylabel, cloud: 'openshift', 
containers: [
containerTemplate(
name: "jnlp",
resourceRequestMemory: "512Mi",
resourceLimitMemory: "2048Mi",
workingDir: "/home/default",
tty: "false",
imagePullPolicy: "Always",
image: 'private-registry:5000/namespace/nodejs-tsc-jnlp-image:latest',
args: '$computer.jnlpmac $computer.name',
),
containerTemplate(
name: 'node',
resourceRequestMemory: '512Mi',
resourceLimitMemory: '2048Mi',
workingDir: '/home/default',
tty: 'true',
imagePullPolicy: 'Always',
image: 'node:alpine',
command: 'cat'
)
]
)


Now the problem is, that this is not working. Pulling the image for the node container just works fine, and if I use echo test for example instead of cat as command test will show in the containers log, but the container will just pass as completed and it will not execute anything that is described in the pipeline. Again this is completely written like stated in the documentation



node(mylabel){
stage('TEST NODE')
container("node")
sh("echo test node")

container("jnlp")
sh("echo test jnlp")




Any idea what I am doing wrong?










share|improve this question




























    0















    I am currently working on a build pipeline in OpenShift using the following Configuration



    openshift: v3.6.173.0.140

    Jenkins: 2.017 (using the redhat images from https://github.com/openshift/jenkins)

    Jenkins-Kubernetes plugin 1.12.2



    As Jenkins Agents I am using the nodejs agents supplied by the openshift jenkins template and images that build up on them (e.g. one image that I also fittet with a typescript compiler)



    Now what I want to do is to run pods with multiple containers (not just the jnlp one but standard node, go etc. containers) Now according to the documentation this should not be a problem (https://github.com/jenkinsci/kubernetes-plugin) as I should just add containers to my podTemplate like



    podTemplate(label: mylabel, cloud: 'openshift', 
    containers: [
    containerTemplate(
    name: "jnlp",
    resourceRequestMemory: "512Mi",
    resourceLimitMemory: "2048Mi",
    workingDir: "/home/default",
    tty: "false",
    imagePullPolicy: "Always",
    image: 'private-registry:5000/namespace/nodejs-tsc-jnlp-image:latest',
    args: '$computer.jnlpmac $computer.name',
    ),
    containerTemplate(
    name: 'node',
    resourceRequestMemory: '512Mi',
    resourceLimitMemory: '2048Mi',
    workingDir: '/home/default',
    tty: 'true',
    imagePullPolicy: 'Always',
    image: 'node:alpine',
    command: 'cat'
    )
    ]
    )


    Now the problem is, that this is not working. Pulling the image for the node container just works fine, and if I use echo test for example instead of cat as command test will show in the containers log, but the container will just pass as completed and it will not execute anything that is described in the pipeline. Again this is completely written like stated in the documentation



    node(mylabel){
    stage('TEST NODE')
    container("node")
    sh("echo test node")

    container("jnlp")
    sh("echo test jnlp")




    Any idea what I am doing wrong?










    share|improve this question
























      0












      0








      0








      I am currently working on a build pipeline in OpenShift using the following Configuration



      openshift: v3.6.173.0.140

      Jenkins: 2.017 (using the redhat images from https://github.com/openshift/jenkins)

      Jenkins-Kubernetes plugin 1.12.2



      As Jenkins Agents I am using the nodejs agents supplied by the openshift jenkins template and images that build up on them (e.g. one image that I also fittet with a typescript compiler)



      Now what I want to do is to run pods with multiple containers (not just the jnlp one but standard node, go etc. containers) Now according to the documentation this should not be a problem (https://github.com/jenkinsci/kubernetes-plugin) as I should just add containers to my podTemplate like



      podTemplate(label: mylabel, cloud: 'openshift', 
      containers: [
      containerTemplate(
      name: "jnlp",
      resourceRequestMemory: "512Mi",
      resourceLimitMemory: "2048Mi",
      workingDir: "/home/default",
      tty: "false",
      imagePullPolicy: "Always",
      image: 'private-registry:5000/namespace/nodejs-tsc-jnlp-image:latest',
      args: '$computer.jnlpmac $computer.name',
      ),
      containerTemplate(
      name: 'node',
      resourceRequestMemory: '512Mi',
      resourceLimitMemory: '2048Mi',
      workingDir: '/home/default',
      tty: 'true',
      imagePullPolicy: 'Always',
      image: 'node:alpine',
      command: 'cat'
      )
      ]
      )


      Now the problem is, that this is not working. Pulling the image for the node container just works fine, and if I use echo test for example instead of cat as command test will show in the containers log, but the container will just pass as completed and it will not execute anything that is described in the pipeline. Again this is completely written like stated in the documentation



      node(mylabel){
      stage('TEST NODE')
      container("node")
      sh("echo test node")

      container("jnlp")
      sh("echo test jnlp")




      Any idea what I am doing wrong?










      share|improve this question














      I am currently working on a build pipeline in OpenShift using the following Configuration



      openshift: v3.6.173.0.140

      Jenkins: 2.017 (using the redhat images from https://github.com/openshift/jenkins)

      Jenkins-Kubernetes plugin 1.12.2



      As Jenkins Agents I am using the nodejs agents supplied by the openshift jenkins template and images that build up on them (e.g. one image that I also fittet with a typescript compiler)



      Now what I want to do is to run pods with multiple containers (not just the jnlp one but standard node, go etc. containers) Now according to the documentation this should not be a problem (https://github.com/jenkinsci/kubernetes-plugin) as I should just add containers to my podTemplate like



      podTemplate(label: mylabel, cloud: 'openshift', 
      containers: [
      containerTemplate(
      name: "jnlp",
      resourceRequestMemory: "512Mi",
      resourceLimitMemory: "2048Mi",
      workingDir: "/home/default",
      tty: "false",
      imagePullPolicy: "Always",
      image: 'private-registry:5000/namespace/nodejs-tsc-jnlp-image:latest',
      args: '$computer.jnlpmac $computer.name',
      ),
      containerTemplate(
      name: 'node',
      resourceRequestMemory: '512Mi',
      resourceLimitMemory: '2048Mi',
      workingDir: '/home/default',
      tty: 'true',
      imagePullPolicy: 'Always',
      image: 'node:alpine',
      command: 'cat'
      )
      ]
      )


      Now the problem is, that this is not working. Pulling the image for the node container just works fine, and if I use echo test for example instead of cat as command test will show in the containers log, but the container will just pass as completed and it will not execute anything that is described in the pipeline. Again this is completely written like stated in the documentation



      node(mylabel){
      stage('TEST NODE')
      container("node")
      sh("echo test node")

      container("jnlp")
      sh("echo test jnlp")




      Any idea what I am doing wrong?







      jenkins kubernetes jenkins-pipeline openshift






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 8:27









      relief.melonerelief.melone

      684723




      684723






















          2 Answers
          2






          active

          oldest

          votes


















          0














          I would try using as the command: /bin/sh -c and cat as an argument.






          share|improve this answer























          • same outcome unfortunately.

            – relief.melone
            Mar 11 at 7:01


















          0














          Ok,



          it seems like the only mistake I made was the following. Use a stage inside the container and it works. In Openshift it is also better to use official jenkins slave image as the community image ran into problems with the git checkout for me. I also made some changes to use a yamlfile to configure my build pod. So my setup now looks like this (with just a basic stage as example)



          jenkins/BuildPod.yaml



          kind: Pod
          apiVersion: v1
          metadata:
          labels:
          app: my-build-pod
          spec:
          containers:
          - name: jnlp
          image: openshift/jenkins-slave-base-centos7:latest
          - name: nodejs
          image: node:8-alpine
          command:
          - cat


          Jenkinsfile



          node 
          checkout scm
          def label = "mypod-$UUID.randomUUID().toString()"

          podTemplate(
          label: label
          cloud: 'openshift'
          yaml: readFile(file: "jenkins/BuildPod.yaml")
          )
          node(label)
          container('nodejs')
          stage('Check versions')
          sh 'node -v'
          sh 'npm -v'










          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55059303%2fjenkins-kubernetes-plugin-inm-openshift-only-jnlp-containers-work%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I would try using as the command: /bin/sh -c and cat as an argument.






            share|improve this answer























            • same outcome unfortunately.

              – relief.melone
              Mar 11 at 7:01















            0














            I would try using as the command: /bin/sh -c and cat as an argument.






            share|improve this answer























            • same outcome unfortunately.

              – relief.melone
              Mar 11 at 7:01













            0












            0








            0







            I would try using as the command: /bin/sh -c and cat as an argument.






            share|improve this answer













            I would try using as the command: /bin/sh -c and cat as an argument.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 8 at 15:20









            iocaneliocanel

            41622




            41622












            • same outcome unfortunately.

              – relief.melone
              Mar 11 at 7:01

















            • same outcome unfortunately.

              – relief.melone
              Mar 11 at 7:01
















            same outcome unfortunately.

            – relief.melone
            Mar 11 at 7:01





            same outcome unfortunately.

            – relief.melone
            Mar 11 at 7:01













            0














            Ok,



            it seems like the only mistake I made was the following. Use a stage inside the container and it works. In Openshift it is also better to use official jenkins slave image as the community image ran into problems with the git checkout for me. I also made some changes to use a yamlfile to configure my build pod. So my setup now looks like this (with just a basic stage as example)



            jenkins/BuildPod.yaml



            kind: Pod
            apiVersion: v1
            metadata:
            labels:
            app: my-build-pod
            spec:
            containers:
            - name: jnlp
            image: openshift/jenkins-slave-base-centos7:latest
            - name: nodejs
            image: node:8-alpine
            command:
            - cat


            Jenkinsfile



            node 
            checkout scm
            def label = "mypod-$UUID.randomUUID().toString()"

            podTemplate(
            label: label
            cloud: 'openshift'
            yaml: readFile(file: "jenkins/BuildPod.yaml")
            )
            node(label)
            container('nodejs')
            stage('Check versions')
            sh 'node -v'
            sh 'npm -v'










            share|improve this answer



























              0














              Ok,



              it seems like the only mistake I made was the following. Use a stage inside the container and it works. In Openshift it is also better to use official jenkins slave image as the community image ran into problems with the git checkout for me. I also made some changes to use a yamlfile to configure my build pod. So my setup now looks like this (with just a basic stage as example)



              jenkins/BuildPod.yaml



              kind: Pod
              apiVersion: v1
              metadata:
              labels:
              app: my-build-pod
              spec:
              containers:
              - name: jnlp
              image: openshift/jenkins-slave-base-centos7:latest
              - name: nodejs
              image: node:8-alpine
              command:
              - cat


              Jenkinsfile



              node 
              checkout scm
              def label = "mypod-$UUID.randomUUID().toString()"

              podTemplate(
              label: label
              cloud: 'openshift'
              yaml: readFile(file: "jenkins/BuildPod.yaml")
              )
              node(label)
              container('nodejs')
              stage('Check versions')
              sh 'node -v'
              sh 'npm -v'










              share|improve this answer

























                0












                0








                0







                Ok,



                it seems like the only mistake I made was the following. Use a stage inside the container and it works. In Openshift it is also better to use official jenkins slave image as the community image ran into problems with the git checkout for me. I also made some changes to use a yamlfile to configure my build pod. So my setup now looks like this (with just a basic stage as example)



                jenkins/BuildPod.yaml



                kind: Pod
                apiVersion: v1
                metadata:
                labels:
                app: my-build-pod
                spec:
                containers:
                - name: jnlp
                image: openshift/jenkins-slave-base-centos7:latest
                - name: nodejs
                image: node:8-alpine
                command:
                - cat


                Jenkinsfile



                node 
                checkout scm
                def label = "mypod-$UUID.randomUUID().toString()"

                podTemplate(
                label: label
                cloud: 'openshift'
                yaml: readFile(file: "jenkins/BuildPod.yaml")
                )
                node(label)
                container('nodejs')
                stage('Check versions')
                sh 'node -v'
                sh 'npm -v'










                share|improve this answer













                Ok,



                it seems like the only mistake I made was the following. Use a stage inside the container and it works. In Openshift it is also better to use official jenkins slave image as the community image ran into problems with the git checkout for me. I also made some changes to use a yamlfile to configure my build pod. So my setup now looks like this (with just a basic stage as example)



                jenkins/BuildPod.yaml



                kind: Pod
                apiVersion: v1
                metadata:
                labels:
                app: my-build-pod
                spec:
                containers:
                - name: jnlp
                image: openshift/jenkins-slave-base-centos7:latest
                - name: nodejs
                image: node:8-alpine
                command:
                - cat


                Jenkinsfile



                node 
                checkout scm
                def label = "mypod-$UUID.randomUUID().toString()"

                podTemplate(
                label: label
                cloud: 'openshift'
                yaml: readFile(file: "jenkins/BuildPod.yaml")
                )
                node(label)
                container('nodejs')
                stage('Check versions')
                sh 'node -v'
                sh 'npm -v'











                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 12 at 17:39









                relief.melonerelief.melone

                684723




                684723



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55059303%2fjenkins-kubernetes-plugin-inm-openshift-only-jnlp-containers-work%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

                    Алба-Юлія

                    Захаров Федір Захарович