k8s-1.25.0(helm部署最新 Jenkins 2.346.3)
k8s版本:k8s-1.25.0(containerd运行时)
jenkins版本:Jenkins 2.346.3
1、先部署动态存储 local-path-provisioner
2、再 helm 部署 jenkins
动态存储:Local Path Provisioner
基于HostPath使用动态PV
1、部署 local-path-provisioner
# 版本:local-path-provisioner-0.0.22wget https://github.com/rancher/local-path-provisioner/archive/refs/tags/v0.0.22.tar.gz# github.com下载加速地址wget https://hub.fastgit.xyz/rancher/local-path-provisioner/archive/refs/tags/v0.0.22.tar.gztar xf v0.0.22.tar.gz && rm -rf v0.0.22.tar.gz# 修改存储地址(/data/local-path-provisioner)sed -i 's/opt/data/g' ~/local-path-provisioner-0.0.22/deploy/local-path-storage.yaml
kubectl apply -f ~/local-path-provisioner-0.0.22/deploy/local-path-storage.yamlkubectl get pod -A -l app=local-path-provisionerkubectl get pod -n local-path-storagekubectl get storageclass
2、helm 部署 Jenkins(官方)
helm repo add jenkinsci https://charts.jenkins.iohelm repo updatehelm search repo jenkinsci/jenkins
helm fetch jenkinsci/jenkinstar xf jenkins-4.1.17.tgz && cd jenkins
cat > jenkins-values.yaml <<'EOF'controller:adminUser: "Admin"adminPassword: "Admin@2022"persistence:enabled: truestorageClass: "local-path"size: "2Ti"EOF
kubectl create ns jenkins1
helm upgrade --install -n jenkins1 jenkins -f jenkins-values.yaml .
