1

我有一个在 Azure Kubernetes 服务上运行的现有 Kubernetes 集群,我正在尝试使用 Jenkins X cli 安装 Jenkins X。我的操作系统是 Windows 10。

我已经jx bootjenkins-x-boot-config目录中克隆并执行了命令。这是输出:

Attempting to resolve version for boot config https://github.com/jenkins-x/jenkins-x-boot-config from https://github.com/jenkins-x/jenkins-x-versions.git
Current HEAD HEAD in . is not an ancestor of v1.0.81, the boot config version from the version stream.
Proceeding with current HEAD.
Booting Jenkins X
WARNING: failed to load ConfigMap jenkins-x-docker-registry in namespace jx: failed to get configmap jenkins-x-docker-registry in namespace jx, configmaps "jenkins-x-docker-registry" not found
WARNING: failed to load ConfigMap jenkins-x-docker-registry in namespace jx: failed to get configmap jenkins-x-docker-registry in namespace jx, configmaps "jenkins-x-docker-registry" not found

STEP: validate-git command: /bin/sh -c jx step git validate in dir: C:\Users\drioux.guidry\Documents\jenkins-x-boot-config\workspace\source

error: failed to interpret pipeline file jenkins-x.yml: failed to run '/bin/sh -c jx step git validate' command in directory 'workspace\source', output: ''

jx boot在 bash 和 Windows 命令提示符中运行时,我收到相同的错误。奇怪的是,我能够成功手动执行失败的命令,尽管我必须将参数括在引号中(尽管我尝试在jenkins-x.yml文件中用引号括起参数,但我仍然收到上面显示的相同错误) :

$ /bin/sh -c "jx step git validate"
WARNING

Traditional Jenkins masters are being deprecated and removed from all new Jenkins X releases starting on April 20, 2020.
We strongly recommend using the default Tekton-based configuration instead for all Jenkins X activity going forward. We do not recommend using the Jenkins X workflow based around Jenkins masters.

For more information: https://jenkins-x.io/blog/2020/03/11/tekton/
Git configured for user: Dr** **** and email dr*****@******.com

我已经jx安装了cli。这是运行命令的输出jx version

NAME               VERSION
jx                 2.0.1215
Kubernetes cluster v1.14.8
kubectl            v1.15.2
helm client        v2.16.1+gbbdfe5e
helm server        v2.16.1+gbbdfe5e
git                2.25.1.windows.1
Operating System   Windows 10 Enterprise 1903 build 18362


verifying packages

WARNING: jx version 2.0.1263 is available in the version stream. You are using 2.0.1215. We highly recommend you upgrade to it.

这是我的jenkins-x-boot-config/jenkins-x.yml

buildPack: none
pipelineConfig:
  pipelines:
    pullRequest:
      pipeline:
        agent:
          image: gcr.io/jenkinsxio/builder-go
        stages:
        - name: pr-checks
          options:
            containerOptions:
              name: ""
              resources: {}
              volumeMounts:
              - mountPath: /builder/home/.jx/localSecrets/currentCluster
                name: local-secrets
                readOnly: true
            volumes:
            - name: local-secrets
              secret:
                optional: true
                secretName: local-param-secrets
          steps:
          - args:
            - step
            - verify
            - values
            - --values-file=parameters.yaml
            - --schema-file=parameters.tmpl.schema.json
            command: jx
            dir: /workspace/source/env
            name: verify-parameters
          - args:
            - build
            command: make
            dir: /workspace/source/env
            name: lint-env-helm
    release:
      pipeline:
        agent:
          image: gcr.io/jenkinsxio/builder-go
        environment:
        - name: DEPLOY_NAMESPACE
          value: jx
        stages:
        - name: release
          options:
            containerOptions:
              name: ""
              resources: {}
              volumeMounts:
              - mountPath: /builder/home/.jx/localSecrets/currentCluster
                name: local-secrets
                readOnly: true
            volumes:
            - name: local-secrets
              secret:
                optional: true
                secretName: local-param-secrets
          steps:
          - args:
            - step
            - git
            - validate
            command: jx
            dir: .
            name: validate-git
          - args:
            - step
            - verify
            - preinstall
            - --provider-values-dir="kubeProviders"
            command: jx
            dir: /env
            name: verify-preinstall
          - args:
            - upgrade
            - crd
            command: jx
            name: install-jx-crds
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - velero
            command: jx
            dir: /workspace/source/systems/velero
            env:
            - name: DEPLOY_NAMESPACE
              value: velero
            name: install-velero
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - velero-backups
            command: jx
            dir: /workspace/source/systems/velero-backups
            env:
            - name: DEPLOY_NAMESPACE
              value: velero
            name: install-velero-backups
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - jxing
            command: jx
            dir: /workspace/source/systems/jxing
            env:
            - name: DEPLOY_NAMESPACE
              value: kube-system
            name: install-nginx-controller
          - args:
            - step
            - create
            - install
            - values
            - -b
            command: jx
            dir: /workspace/source/env
            name: create-install-values
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - exdns
            command: jx
            dir: /workspace/source/systems/external-dns
            name: install-external-dns
          - args:
            - apply
            - --wait
            - --validate=false
            - -f
            - https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml
            command: kubectl
            dir: /workspace/source
            env:
            - name: DEPLOY_NAMESPACE
              value: cert-manager
            name: install-cert-manager-crds
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - cm
            command: jx
            dir: /workspace/source/systems/cm
            env:
            - name: DEPLOY_NAMESPACE
              value: cert-manager
            name: install-cert-manager
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - acme
            command: jx
            dir: /workspace/source/systems/acme
            name: install-acme-issuer-and-certificate
          - args:
            - step
            - boot
            - vault
            - --provider-values-dir
            - ../../kubeProviders
            command: jx
            dir: /workspace/source/systems/vault
            name: install-vault
          - args:
            - step
            - create
            - values
            - --name
            - parameters
            command: jx
            dir: /workspace/source/env
            name: create-helm-values
          - args:
            - step
            - create
            - templated
            - --parameters-file=../../env/parameters.yaml
            - --requirements-dir=../../
            - --template-file=jx-auth-configmap.tmpl.yaml
            - --config-file=templates/jx-auth-configmap.yaml
            command: jx
            dir: /workspace/source/systems/jx-auth
            name: create-jx-auth-config
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - jx-auth
            command: jx
            dir: /workspace/source/systems/jx-auth
            name: install-jx-auth-config
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --name
            - jenkins-x
            - --provider-values-dir
            - ../kubeProviders
            command: jx
            dir: /workspace/source/env
            name: install-jenkins-x
          - args:
            - step
            - verify
            - env
            command: jx
            dir: /workspace/source
            name: verify-jenkins-x-environment
          - args:
            - step
            - helm
            - apply
            - --boot
            - --name
            - repos
            command: jx
            dir: /workspace/source/repositories
            name: install-repositories
          - args:
            - step
            - scheduler
            - config
            - apply
            - --direct=true
            command: jx
            dir: /workspace/source/prowConfig
            name: install-pipelines
          - args:
            - update
            - webhooks
            - --verbose
            - --warn-on-fail
            command: jx
            dir: /workspace/source/repositories
            name: update-webhooks
          - args:
            - step
            - verify
            - install
            - --pod-wait-time
            - 30m
            command: jx
            dir: /workspace/source/env
            name: verify-installation

如果我应该提供任何其他详细信息来帮助解决此问题,请告诉我。

4

1 回答 1

1

尝试在版本为 v1.16.7 的 AKS 中创建新的 Kubernetes 集群后,我仍然收到相同的错误。此外,使用命令在 Google Cloud Platform 中创建集群jx create cluster gke --skip-installation然后运行会jx boot导致与此堆栈溢出问题中共享的相同错误。

我在 Stack Overflow 上提出了另一个问题,“stackoverflow.com/questions/61806267/...”,有人建议使用 Windows Linux 子系统,它证明可以成功地将 Jenkins X 安装到我的 GKE 集群中,而无需遵循本文中定义的任何步骤堆栈溢出问题。这是我使用的设置 WSL 的链接:docs.microsoft.com/en-us/windows/wsl/install-win10

于 2020-05-13T19:02:02.557 回答