修改 Airflow Helm 图表值

Modifying Airflow Helm chart values

我想在 Openshift 中部署 airflow。

我正在使用这个 values.yaml:https://github.com/bitnami/charts/blob/master/bitnami/airflow/values.yaml

我想从我公司的 Bitbucket 存储库中克隆我的 dag 文件。

我正在修改 /values.yaml 来实现:

  dags:
    ## Enable in order to download DAG files from git repositories.
    ##
    enabled: true
    repositories:
      - repository: 
        branch: master
        name: dags
        path: docker-image/dags

我应该把这个values.yaml中的秘密信息插入到哪一部分?

首先,您的 values.yaml 文件开头应该有 git

git:
  dags:
    ## Enable in order to download DAG files from git repositories.
    ##
    enabled: true
    repositories:
      - repository: 
        branch: master
        name: dags
        path: docker-image/dags

我假设您有一个私有存储库并且您希望 airflow 访问它。
正如您在 Bitnami Apache Airflow Helm chart documentation:

中看到的

If you use a private repository from GitHub, a possible option to clone the files is using a Personal Access Token and using it as part of the URL: https://USERNAME:PERSONAL_ACCESS_TOKEN@github.com/USERNAME/REPOSITORY

关于 GitHub 但我相信它也适用于 Bitbucket

个人访问令牌可用于 Bitbucket Data CenterServer。您可以在 Personal access tokens documentation.

中了解如何创建它

注意: 如果您使用 Bitbucket Cloud,则无法创建个人访问令牌,但您可以创建 app password instead ( look at Personal Access Token for Bitbucket Cloud?)。
我有 Bitbucket Cloud 并使用应用程序密码测试了这个场景,它按预期工作。