可以使用稳定/头盔启动詹金斯吗

时间:2019-09-04 14:20:07

标签: jenkins kubernetes-helm

我正在尝试使用稳定/头盔图表设置Jenkins,但在描述Jenkins吊舱时,Jenkins吊舱始终处于Init状态,并且不给出任何错误。我无法调试,因为它处于Init状态。

我已经创建了PV和PVC,并在值文件中分配了PVC。 下面是我的配置:


master:
  componentName: "jenkins-master"
  image: "jenkins/jenkins"
  tag: "lts"
  imagePullPolicy: "IfNotPresent"
  lifecycle:
  numExecutors: 0
  customJenkinsLabels: []
  useSecurity: true

  enableXmlConfig: true
  securityRealm: |-
    <securityRealm class="hudson.security.LegacySecurityRealm"/>
  authorizationStrategy: |-
     <authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">
       <denyAnonymousReadAccess>true</denyAnonymousReadAccess>
     </authorizationStrategy>
  hostNetworking: false
  adminUser: "admin"
  adminPassword: "admin"
  rollingUpdate: {}
  resources:
    requests:
      cpu: "50m"
      memory: "256Mi"
    limits:
      cpu: "2000m"
      memory: "2048Mi"
  usePodSecurityContext: true
  servicePort: 8080
  targetPort: 8080
  serviceType: NodePort
  serviceAnnotations: {}
  deploymentLabels: {}
  serviceLabels: {}
  podLabels: {}
  nodePort: 32323
  healthProbes: true
  healthProbesLivenessTimeout: 5
  healthProbesReadinessTimeout: 5
  healthProbeLivenessPeriodSeconds: 10
  healthProbeReadinessPeriodSeconds: 10
  healthProbeLivenessFailureThreshold: 5
  healthProbeReadinessFailureThreshold: 3
  healthProbeLivenessInitialDelay: 90
  healthProbeReadinessInitialDelay: 60
  slaveListenerPort: 50000
  slaveHostPort:
  disabledAgentProtocols:
    - JNLP-connect
    - JNLP2-connect
  csrf:
    defaultCrumbIssuer:
      enabled: true
      proxyCompatability: true
  cli: false
  slaveListenerServiceType: "ClusterIP"
  slaveListenerServiceAnnotations: {}
  slaveKubernetesNamespace:

  loadBalancerSourceRanges:
  - 0.0.0.0/0
  extraPorts:
  installPlugins:
    - kubernetes:1.18.1
    - workflow-job:2.33
    - workflow-aggregator:2.6
    - credentials-binding:1.19
    - git:3.11.0
    - blueocean:1.18.1
    - kubernetes-cd:2.0.0

  enableRawHtmlMarkupFormatter: false
  scriptApproval:
  initScripts:
  jobs: {}
  JCasC:
    enabled: false
    pluginVersion: "1.27"
    supportPluginVersion: "1.18"
    configScripts:
      welcome-message: |
        jenkins:
          systemMessage: Welcome to our CI\CD server.  This Jenkins is configured and managed 'as code'.

  customInitContainers: []

  sidecars:
    configAutoReload:
      enabled: false
      image: shadwell/k8s-sidecar:0.0.2
      imagePullPolicy: IfNotPresent
      resources: {}
      sshTcpPort: 1044
      folder: "/var/jenkins_home/casc_configs"
  nodeSelector: {}
  tolerations: []
  podAnnotations: {}

  customConfigMap: false
  overwriteConfig: false

  overwriteJobs: false

  ingress:
    enabled: false
    apiVersion: "extensions/v1beta1"
    labels: {}
    annotations: {}
    hostName:
    tls:

  backendconfig:
    enabled: false
    apiVersion: "extensions/v1beta1"
    name:
    labels: {}
    annotations: {}
    spec: {}

  route:
    enabled: false
    labels: {}
    annotations: {}

  additionalConfig: {}

  hostAliases: []

  prometheus:
    enabled: false
    serviceMonitorAdditionalLabels: {}
    scrapeInterval: 60s
    scrapeEndpoint: /prometheus
    alertingRulesAdditionalLabels: {}
    alertingrules: []

agent:
  enabled: true
  image: "jenkins/jnlp-slave"
  tag: "3.27-1"
  customJenkinsLabels: []
  imagePullSecretName:
  componentName: "jenkins-slave"
  privileged: false
  resources:
    requests:
      cpu: "200m"
      memory: "256Mi"
    limits:
      cpu: "200m"
      memory: "256Mi"
  alwaysPullImage: false
  podRetention: "Never"
  envVars:
  volumes:
  nodeSelector: {}

  command:
  args:
  sideContainerName: "jnlp"
  TTYEnabled: false
  containerCap: 10
  podName: "default"
  idleMinutes: 0
  yamlTemplate:

persistence:
  enabled: true
  existingClaim: jenkins-pvc
  storageClass:
  annotations: {}
  accessMode: "ReadWriteOnce"
  size: "2Gi"
  volumes:
  mounts:

networkPolicy:
  enabled: false
  apiVersion: networking.k8s.io/v1

rbac:
  create: true

serviceAccount:
  create: true
  name:
  annotations: {}

serviceAccountAgent:
  create: false
  name:
  annotations: {}

backup:
  enabled: false
  componentName: "backup"
  schedule: "0 2 * * *"
  annotations:
    iam.amazonaws.com/role: "jenkins"
  image:
    repository: "nuvo/kube-tasks"
    tag: "0.1.2"
  extraArgs: []
  existingSecret: {}
  env:
  - name: "AWS_REGION"
    value: "us-east-1"
  resources:
    requests:
      memory: 1Gi
      cpu: 1
    limits:
      memory: 1Gi
      cpu: 1
  destination: "s3://nuvo-jenkins-data/backup"
checkDeprecation: true```

1 个答案:

答案 0 :(得分:1)

我们最近在尝试使用头盔运行Jenkins时遇到了这个问题。问题是,由于Jenkins尝试配置自身并从jenkins.io提取更新时发生错误,导致pod无法初始化。您可以使用类似于以下命令的命令找到这些日志消息:

Resolvers

用头盔为您的jenkins吊舱分配的任何名称替换上面的kubectl logs solemn-quoll-jenkins-abc78900-xxx -c copy-default-config 。问题出在solemn-quoll-jenkins-abc78900-xxx容器中,因此copy-default-config选项可让您查看jenkins容器内该容器的日志。在我们的案例中,这是一个http代理问题,其中-c容器由于无法连接到https://updates.jenkins.io/而无法下载插件更新而失败。您可以通过进入values.yaml文件并在yaml文件的copy-default-config标题下注释掉所有插件来测试它是否是插件更新问题。

例如:

installPlugins: