导入Helm源

1
2
helm repo add jenkins https://charts.jenkins.io
helm pull jenkins/jenkins --untar

修改values.yaml

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
controller:
# -- Used for label app.kubernetes.io/component
componentName: "jenkins-controller"
image:
# -- Controller image registry
registry: "docker.io"
# -- Controller image repository
repository: "jenkins/jenkins"
# -- Controller image tag override; i.e., tag: "2.440.1-jdk17"
tag:

tagLabel: jdk17
pullPolicy: "IfNotPresent"
imagePullSecretName:
lifecycle: {}
disableRememberMe: false

numExecutors: 0
executorMode: "NORMAL"
customJenkinsLabels: []

hostNetworking: false
admin:
username: "admin"
# jenkins密码
password: "admin"
...
...
...
installPlugins:
- kubernetes:4253.v7700d91739e5
- workflow-aggregator:600.vb_57cdd26fdd7
- git:5.2.2
- configuration-as-code:1836.vccda_4a_122a_a_e
# 安装中文插件
- localization-zh-cn:371.v23851f835d6b_
...
...
...
ingress
# 开启Ingress
enabled: true
paths: []
apiVersion: "extensions/v1beta1"
# -- Ingress labels
labels: {}
# -- Ingress annotations
annotations: {}
# 设置ingress
ingressClassName: nginx

# Set this path to jenkinsUriPrefix above or use annotations to rewrite path
# -- Ingress path
path:

# configures the hostname e.g. jenkins.example.com
# -- Ingress hostname
hostName:
# -- Hostname to serve assets from
resourceRootUrl:
# -- Ingress TLS configuration
# 设置存在的自签名证书的secret
tls:
- secretName: devops-tls
hosts:
- jenkins.sreok.cn
...
...
...
persistence:
# -- Enable the use of a Jenkins PVC
enabled: true
# -- Provide the name of a PVC
existingClaim:
# -- Storage class for the PVC
storageClass:
# -- Annotations for the PVC
annotations: {}
# -- Labels for the PVC
labels: {}
# -- The PVC access mode
accessMode: "ReadWriteOnce"
# -- The size of the PVC
# 适当修改PVC大小
size: "200Gi"

修改中文注释部分。

1
2
3
4
5
6
7
8
9
cd jenkins/
helm upgrade --install -n devops jenkins --create-namespace \
--set controller.jenkinsUrl="jenkins.sreok.cn" \
--set controller.admin.password="admin" \
--set controller.ingress.enabled=true \
--set controller.ingress.ingressClassName="nginx" \
--set controller.ingress.tls[0].secretName="devops-tls" \
--set controller.ingress.tls[0].hosts[0]="jenkins.sreok.cn" \
--set persistence.size="20Gi" .

jenkins plugin代理:https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json