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;
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
add a comment |
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
add a comment |
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
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
jenkins
asked Mar 8 at 8:27
relief.melonerelief.melone
684723
684723
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I would try using as the command: /bin/sh -c and cat as an argument.
same outcome unfortunately.
– relief.melone
Mar 11 at 7:01
add a comment |
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'
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
I would try using as the command: /bin/sh -c and cat as an argument.
same outcome unfortunately.
– relief.melone
Mar 11 at 7:01
add a comment |
I would try using as the command: /bin/sh -c and cat as an argument.
same outcome unfortunately.
– relief.melone
Mar 11 at 7:01
add a comment |
I would try using as the command: /bin/sh -c and cat as an argument.
I would try using as the command: /bin/sh -c and cat as an argument.
answered Mar 8 at 15:20
iocaneliocanel
41622
41622
same outcome unfortunately.
– relief.melone
Mar 11 at 7:01
add a comment |
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
add a comment |
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'
add a comment |
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'
add a comment |
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'
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'
answered Mar 12 at 17:39
relief.melonerelief.melone
684723
684723
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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