ArgoCD Helm 图表 - 无法访问存储库

问题描述

我正在尝试向 ArgoCD 添加舵图 (https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack)。

执行此操作时,出现以下错误:

无法保存更改:应用程序规范无效:InvalidSpecError:无法访问存储库:未找到存储库

你们能帮帮我吗?我认为我做的一切都是正确的,但似乎有些不对劲...

这是 yaml 项目。

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: prom-oper
  namespace: argocd
spec:
  project: prom-oper

  source:
    repoURL: https://prometheus-community.github.io/helm-charts
    targetRevision: "13.2.1"
    path: prometheus-community/kube-prometheus-stack

    helm:
      # Release name override (defaults to application name)
      releaseName: prom-oper
      version: v3
      values: |
        ... redacted

    directory:
      recurse: false


  destination:
    server: https://kubernetes.default.svc
    namespace: prom-oper

  syncPolicy:
    automated: # automated sync by default retries failed attempts 5 times with following delays between attempts ( 5s,10s,20s,40s,80s ); retry controlled using `retry` field.
      prune: false # Specifies if resources should be pruned during auto-syncing ( false by default ).
      selfHeal: false # Specifies if partial app sync should be executed when resources are changed only in target Kubernetes cluster and no git change detected ( false by default ).
      allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
    syncOptions:     # Sync options which modifies sync behavior
    - CreateNamespace=true # Namespace Auto-Creation ensures that namespace specified as the application destination exists in the destination cluster.
    # The retry feature is available since v1.7
    retry:
      limit: 5 # number of failed sync attempt retries; unlimited number of attempts if less than 0
      backoff:
        duration: 5s # the amount to back off. Default unit is seconds,but could also be a duration (e.g. "2m","1h")
        factor: 2 # a factor to multiply the base duration after each failed retry
        maxDuration: 3m # the maximum amount of time allowed for the backoff strategy

还有我添加 helm repo 的 configmap

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cm
  namespace: argocd
data:
  admin.enabled: "false"
  repositories: |
    - type: helm
      url: https://prometheus-community.github.io/helm-charts
      name: prometheus-community

解决方法

您收到此错误的原因是应用程序的定义方式,Argo 认为它是 Git 存储库而不是 Helm。

使用“图表”属性而不是“路径”来定义源对象,如下所示:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: prom-oper
  namespace: argocd
spec:
  project: prom-oper

  source:
    repoURL: https://prometheus-community.github.io/helm-charts
    targetRevision: "13.2.1"
    chart: kube-prometheus-stack

您可以在 Argo 的 application-crd.yaml 中的 line 128 上看到它的定义

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...