I try to build springboot and vue to use jenkins on k8s
However Im stuck in the job
I make the podtemplate like this
podTemplate(
label: 'jenkins-slave-pod',
containers: [
containerTemplate(name: 'git', image: 'alpine/git', command: 'cat', ttyEnabled: true),
containerTemplate(name: "maven", image: "maven:latest", ttyEnabled: true, command: "cat"),
containerTemplate(name: "docker", image: "docker:latest", ttyEnabled: true, command: "cat"),
containerTemplate(name: "node", image: "node:lts-slim", command: "cat", ttyEnabled: true)
//containerTemplate(name: "kubectl", image: "lachlanevenson/k8s-kubectl", command: "cat", ttyEnabled: true)
],
//volume mount
volumes: [
hostPathVolume(hostPath: "/var/run/docker.sock", mountPath: "/var/run/docker.sock")
]
)
and when the stage to build like this
stage('build the source code via npm') {
container('node') {
sh 'npm install && npm run build'
}
}
stage('maven') {
steps {
container('maven') {
sh 'mvn package'
sh 'bash build.sh'
}
}
}
I though the codes can work but it was not. the error below
spring boot, maven
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/3.2.2/spring-boot-starter-parent-3.2.2.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for kr.ac.kdischool:sugang-base:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:3.2.2 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Try again and 'parent.relativePath' points at wrong local POM @ line 5, column 13
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project kr.ac.kdischool:sugang-base:0.0.1-SNAPSHOT (/home/jenkins/agent/workspace/k8stest/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for kr.ac.kdischool:sugang-base:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:3.2.2 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Try again and 'parent.relativePath' points at wrong local POM @ line 5, column 13: Unknown host repo.maven.apache.org: Try again -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
npm, vue js
+ npm install
npm error code EAI_AGAIN
npm error syscall getaddrinfo
npm error errno EAI_AGAIN
npm error request to https://registry.npmjs.org/@vue%2fcli-service failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-08-05T10_04_59_848Z-debug-0.log
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE
I tried to solve the problem but there are not many information for it.
Network has no problem. ping, curl work well on server
It only does not work in POD
I guess it may be DNS PROBLEM but Im not sure
so if anybody figure out this problem, please help me
I tried to use the images to build by docker, it worked well
it does not work on k8s probably, it looks like network issue on k8s
user26643265 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.