Ch01_Introduction
Yang Haoran 9/19/2022 Jenkins
# Introduction

# k8s install jenkins
https://blog.csdn.net/qq_34285557/article/details/124763695
https://www.jenkins.io/doc/book/installing/kubernetes/#install-jenkins-with-yaml-files
https://www.cnblogs.com/diskld/p/15736588.html
# deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins
spec:
replicas: 1
selector:
matchLabels:
app: jenkins
template:
metadata:
labels:
app: jenkins
spec:
containers:
- name: jenkins
image: jenkins/jenkins:lts-jdk11
ports:
- containerPort: 8080
volumeMounts:
- name: jenkins-home
mountPath: /var/jenkins_home
volumes:
- name: jenkins-home
emptyDir: { }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Service
apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
type: NodePort
ports:
- port: 7096
targetPort: 8080
selector:
app: jenkins
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11