部署 Jenkins 的 Helm Chart 时出现错误,镜像名称无效,尽管它是正确的。如何解决?

部署 Jenkins 的 Helm Chart 时出现错误,镜像名称无效,尽管它是正确的。如何解决?

部署 Jenkins 的 Helm Chart 时出现错误,镜像名称无效,尽管它是正确的。如何解决?

kubectl get po -n jenkins
NAME        READY   STATUS                  RESTARTS   AGE
jenkins-0   0/2     Init:InvalidImageName   0          46s

我的 values.yaml 文件:

#https://github.com/jenkinsci/helm-charts/blob/main/charts/jenkins/values.yaml
controller: # renamed from master
  image: jenkins/jenkins:lts
  imagePullPolicy: Always
  serviceType: LoadBalancer
  adminSecret: true #useSecurity: true
  adminUser: admin
  adminPassword: password
  #jenkinsUrl: http://jenkins.example.com/
  jenkinsUriPrefix: "/jenkins"
  agents:
    enabled: true
    jnlp:
      enabled: true
    kubernetes:
      enabled: true
      namespace: default
      label: jenkins-slave
      podName: jenkins-slave-${UUID}
      volumes:
        - type: Secret
          secretName: jenkins-k8s-secret
          mountPath: /var/jenkins_home/.kube
        - type: Secret
          secretName: jenkins-k8s-config
          mountPath: /home/jenkins/.kube/config
      serviceAccountName: jenkins
      image: jenkins/jnlp-slave
      privileged: true
      alwaysPullImage: true
      idleMinutes: 5
      containerCap: 10
  installPlugins:
    - kubernetes:3734.v562b_b_a_627ea_c
    - workflow-aggregator:590.v6a_d052e5a_a_b_5
    - git:4.13.0
    - configuration-as-code:1569.vb_72405b_80249
  overwritePluginsFromImage: true
  # Set to false to download the minimum required version of all dependencies.
  installLatestPlugins: true

  # Set to true to download latest dependencies of any plugin that is requested to have the latest version.
  installLatestSpecifiedPlugins: false
  usePodSecurityContext: true
  runAsUser: 1000
  fsGroup: 1000
  healthProbes: true
  probes:
    startupProbe:
      httpGet:
        path: '{{ default "" .Values.controller.jenkinsUriPrefix }}/login'
        port: http
      periodSeconds: 10
      timeoutSeconds: 5
      failureThreshold: 12
    livenessProbe:
      failureThreshold: 5
      httpGet:
        path: '{{ default "" .Values.controller.jenkinsUriPrefix }}/login'
        port: http
      periodSeconds: 10
      timeoutSeconds: 5
      # If Startup Probe is not supported on your Kubernetes cluster, you might want to use "initialDelaySeconds" instead.
      # It delays the initial liveness probe while Jenkins is starting
      # initialDelaySeconds: 60
    readinessProbe:
      failureThreshold: 3
      httpGet:
        path: '{{ default "" .Values.controller.jenkinsUriPrefix }}/login'
        port: http
      periodSeconds: 10
      timeoutSeconds: 5
      # If Startup Probe is not supported on your Kubernetes cluster, you might want to use "initialDelaySeconds" instead.
      # It delays the initial readyness probe while Jenkins is starting
      # initialDelaySeconds: 60

执行的命令:

kubectl create ns jenkins
helm install jenkins jenkins/jenkins -f ./values.yaml --namespace jenkins

答案1

您需要添加标签

lts-jdk11

相关内容