Moved pod agent code from Jenkins master to YAML file in repo
This commit is contained in:
parent
b14e6cf873
commit
cc2f224d60
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@ -1,6 +1,7 @@
|
||||
pipeline {
|
||||
agent {
|
||||
label 'jnlp'
|
||||
label 'kubernetes'
|
||||
yamlfile 'podTemplate.yaml'
|
||||
}
|
||||
|
||||
environment {
|
||||
|
57
podTemplate.yaml
Normal file
57
podTemplate.yaml
Normal file
@ -0,0 +1,57 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
jenkins: "slave"
|
||||
jenkins/label: "kubernetes-agent"
|
||||
spec:
|
||||
containers:
|
||||
- name: jnlp
|
||||
image: jenkins/inbound-agent:alpine
|
||||
tty: false
|
||||
workingDir: /home/jenkins/agent
|
||||
volumeMounts:
|
||||
- name: workspace-volume
|
||||
mountPath: /home/jenkins/agent
|
||||
env:
|
||||
- name: JENKINS_WEB_SOCKET
|
||||
value: "true"
|
||||
- name: REMOTING_OPTS
|
||||
value: "-noReconnectAfter 1d"
|
||||
|
||||
- name: python
|
||||
image: python:3.11.7-alpine
|
||||
command:
|
||||
- cat
|
||||
tty: true
|
||||
workingDir: /home/jenkins/agent
|
||||
volumeMounts:
|
||||
- name: workspace-volume
|
||||
mountPath: /home/jenkins/agent
|
||||
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
command:
|
||||
- dockerd-entrypoint.sh
|
||||
args:
|
||||
- "-H"
|
||||
- "tcp://0.0.0.0:2375"
|
||||
tty: true
|
||||
workingDir: /home/jenkins/agent
|
||||
securityContext:
|
||||
privileged: true
|
||||
env:
|
||||
- name: DOCKER_TLS_CERTDIR
|
||||
value: ""
|
||||
volumeMounts:
|
||||
- name: workspace-volume
|
||||
mountPath: /home/jenkins/agent
|
||||
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
|
||||
restartPolicy: Never
|
||||
|
||||
volumes:
|
||||
- name: workspace-volume
|
||||
emptyDir: {}
|
Loading…
x
Reference in New Issue
Block a user