当前位置:网站首页>Helm install Jenkins (official)
Helm install Jenkins (official)
2022-04-21 21:42:00 【wnfee】
List of articles
1. Search for
# add to repo
helm repo add jenkins https://charts.jenkins.io
helm repo update
[root@master helm]# helm search repo jenkins/jenkins
NAME CHART VERSION APP VERSION DESCRIPTION
jenkins/jenkins 3.11.10 2.332.2 Jenkins - Build great things at any scale! The ...
2. my-values.yaml
cat <<EOF> my-values.yaml
controller:
image: "registry.cn-shanghai.aliyuncs.com/wanfei/jenkins"
# tag: "2.332.2-jdk11"
tagLabel: jdk11
imagePullPolicy: "IfNotPresent"
adminUser: "admin"
adminPassword: "www19930327"
ingress:
enabled: true
apiVersion: "networking.k8s.io/v1"
ingressClassName: nginx
hostName: jenkins.tophant.wang
persistence:
enabled: true
storageClass: "nfs-storage"
size: "2Gi"
EOF
3. Deploy
helm install jenkins jenkins/jenkins --version 3.11.10 -f my-values.yaml
helm install jenkins -f my-values.yaml .
# uninstall
helm uninstall jenkins
jenkins repoDownload speed is very slow
4. Verification deployment
[root@master jenkins]# kubectl get pods | grep jenkins
jenkins-0 2/2 Running 0 47m
[root@master jenkins]# kubectl get svc | grep jenkins
jenkins ClusterIP 10.106.137.1 <none> 8080/TCP 49m
jenkins-agent ClusterIP 10.101.182.60 <none> 50000/TCP 49m
Add locally hosts
192.168.4.27 jenkins.tophant.wang
visit http://jenkins.tophant.wang
If you forget the password , You can check the password
kubectl exec --namespace default -it svc/jenkins -c jenkins -- /bin/cat /run/secrets/chart-admin-password && echo
Enter the account and password admin/www19930327

5. Install Chinese plug-in
Search for Localization: Chinese (Simplified), Click the second

Restart after installation ( Check Restart)

6 add to gitee The credentials
Later, the test needs to start from the code cloud (
gitee) Download code
6.1 install gitee plug-in unit
Search for gitee, Click the second

6.2 To configure gitee Private key
Click on 【 System management 】-【 manage credentials 】, Click as shown in the figure below 【Jenkins】

Click on 【 Global credentials 】

Click on 【 Add credentials 】

Now copy gitee Private key , Sign in gitee after , Click on the picture , And then click 【 Set up 】, Click on 【 Private token 】, And then click 【 Generate a new token 】

Fill in the token description , Then select permissions according to actual needs , Click on the submit

Input gitee Password authentication

Go back to the new credentials page , choice 【Gitee API token 】, Then paste the private key copied in the previous step here , Then add the description , Click ok

here Gitee The private key is added

6.3 Gitee The plug-in configuration
Click on 【 System management 】-【 The system configuration 】
find Gitee To configure , Link name customization , such as Gitee, Domain name filling https://gitee.com, Certificate token selection step 1 Credentials added in , It opens at 【 senior 】, Check Ignore SSL Check , And then click 【 Test connection 】, Success is shown below, i.e OK

If
Test connectionHas been an error , Need to installjersey 2 APIplug-in unit , And then it's all right
Reference resources https://blog.csdn.net/m0_65787443/article/details/123031292
6.4 add to gitee Account credentials

6.5 Create a gitee Code warehouse pull code task

And then click Build immediately
You can see that a Agent default-0k406 To carry out the task


7. Pipeline deployment
7.1 Configure clusters
kubernetesThe plug-in is installed by default
System management -> Node management

Click on Configure Clouds, I found that the default settings are all configured , Click connection test succeeded

View the default label jenkins-jenkins-agent

7.2 Assembly line task

Pipelined scripts
node('jenkins-jenkins-agent'){
stage("clone Code "){
echo " Code clone"
}
stage(" The code to build "){
echo " The code to build "
}
stage(" Code testing "){
echo " Code testing "
}
stage(" Code deployment "){
echo " Code deployment "
}
}

8. Jenkinsfiel Pipeline deployment
establish protal-dev Assembly line task

To configure gitee project , There must be... In the project Jenkinsfile file

The project structure is as follows

script: It containsdockerBuild a mirror imagepushMirror scripts andchartTemplatesJenkinsfile: Pipeline process
Because it quotes maven-pvc, So you need to create , Used to store maven jar package
cat <<EOF> maven-pvc.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: maven-pv
spec:
capacity:
storage: 4Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Delete
nfs:
server: 192.168.4.27
path: /nfsdata
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: maven-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 4Gi
EOF
kubectl apply -f maven-pvc.yaml
At present
StorageClassThere can be no default , Otherwise, it will be created automaticallypv, Don't use the abovepv
Click build now

Created a Pod: kubernetes default/slave-26c42db4-79ad-49ab-89c8-e7cdf41b501a-z5frp-0vds3 Execute the current deployment , Automatically delete after deployment

At present jar Package storage path
[root@master jenkins]# ls /nfsdata/repository/
com commons-io io org
版权声明
本文为[wnfee]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204212133310257.html
边栏推荐
- 【C语言进阶9——指针的进阶(6)- 回调函数】
- How to set the South parameter when streaming from libvlc library
- Add subtitles to PR video
- FFmpeg连载1-环境搭建
- 虚拟机关闭之后,重启linux之后,重启里面oracle的监听
- PHP数组函数extract 使用详解
- 硬核实力,多方认可|云扩科技作为RPA核心厂商入选《2022中国RPA采购指南》
- Operation instructions of archives management system
- Reflection 111
- 想要从数字化转型获得收益,你该怎么做?
猜你喜欢

分析师认为三星Galaxy Z Fold 4和Z Flip 4可能比其前代产品更便宜

联想公布ESG新进展:承诺2025年全线计算机产品100%含有再生塑料

Pay off 900000 housing loans to get the resignation certificate? Tencent response: inconsistent with the actual situation

135, 137, 138, 139 and 445 port explanation and closing method

"Three wars" Hong Kong stock exchange, and "Guo Qi Wang Hong" green tea restaurant can't tell a new story?

Anshui Cup 2021 Crypto Réapparition

3D打印机CR-10S CR10S PRO Ender-3 Ender 3PRO Ender 5更换BMG挤出机,挤出电机的脉冲值或传动值E如何修改

【Selenium 自学系列】(一)Selenium第一个例子及交互原理

虚拟机关闭之后,重启linux之后,重启里面oracle的监听

JVM 从入门到放弃之 ZGC 垃圾收集器精讲
随机推荐
2022起重机司机(限桥式起重机)上岗证题库及在线模拟考试
Eeasybi report system data source selection code development manual
想要从数字化转型获得收益,你该怎么做?
Anshui Cup 2021 Crypto Réapparition
力扣解法汇总824-山羊拉丁文
我国工业互联网产业发展成效显著,但技术挑战仍是一项长期工程
Communication between parent and child processes (I) -- working principle of pipeline + pipeline creation function pipe
安洵杯2021_Crypto_复现
Use try-with-resources or close this “FileOutputStream“
POI Point of interesting.
Multi tenant points system function list
ZGC garbage collector from getting started to giving up JVM
12 SQL tips you may not know
智能云事业群组(ACG)
[charming Java] - data types and variables
Cyclone IV E系列介绍
JMeter (XVI) - from introduction to mastery - JMeter preprocessor (detailed tutorial)
Reflex WMS study experience shelf principle
数据库小练习
Introduction to qmenqu