导入Helm源

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

修改values.yaml

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"

修改中文注释部分。

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