【问题标题】:Overwrite values.yaml in flux helm deplyoment from other source than the helmchart在 flux helm 部署中覆盖来自 helm chart 以外的其他来源的 values.yaml
【发布时间】:2022-11-30 15:48:50
【问题描述】:

我想通过 flux 部署一个 helm chart。掌舵图位于存储库中,例如 artifacthub.io,我无法更改它。

release.yaml 看起来像这样

---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: cp-helmrelease
  namespace: wordpress
spec:
  chart:
    spec:
      chart: wordpress
      sourceRef:
        kind: HelmRepository
        name: artifacthub
        namespace: bitnami
      version: 15.0.18
  serviceAccountName: m2m-sa
  interval: 10m
  install:
    remediation:
      retries: 3

现在我想覆盖 values.yaml。使用 helm,我可以轻松地说出 helm install xyz,然后定义值文件的路径。据我所知,我无法定义通向不在掌舵图中的文件的路径。 是否有机会使用来自 artifacthub 的 helm chart 并将 values.yaml 存储在我的个人 git 存储库中,并将其与 flux 一起部署?

【问题讨论】:

    标签: kubernetes kubernetes-helm helm3


    【解决方案1】:

    官方指南有一个这样的例子,但是 values 是内联在 HelmRelease 而不是在一个单独的文件中(但是显然在你的 Git 仓库中):

    apiVersion: helm.toolkit.fluxcd.io/v2beta1
    kind: HelmRelease
    metadata:
      name: podinfo
      namespace: default
    spec:
      interval: 5m
      chart:
        spec:
          chart: <name|path>
          version: '4.0.x'
          sourceRef:
            kind: <HelmRepository|GitRepository|Bucket>
            name: podinfo
            namespace: flux-system
          interval: 1m
      values:
        replicaCount: 2
    

    见:https://fluxcd.io/flux/guides/helmreleases/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-09
      • 2022-09-28
      • 2022-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-12
      相关资源
      最近更新 更多