1

I want to deploy airflow in Openshift.

I am using this values.yaml: https://github.com/bitnami/charts/blob/master/bitnami/airflow/values.yaml

I want to clone my dag files from the Bitbucket repository of my company.

I am modifying the /values.yaml to achieve that:

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

in which part should I insert the info about the secrets in this values.yaml?

1 Answers1

1

First of all, your values.yaml file should have git at the beggining:

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

I assume you have a private repository and you want airflow to access it.
As you can see in the 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

It's about GitHub but I belive it also works with Bitbucket.

Personal access token can be used in Bitbucket Data Center and Server. You can find out how to create it in this Personal access tokens documentation.

NOTE: If you use Bitbucket Cloud it is not possible to create personal access token but you can create app password instead ( look at Personal Access Token for Bitbucket Cloud?).
I have Bitbucket Cloud and tested this scenario with the app password and it works as expected.

matt_j
  • 4,010
  • 1
  • 9
  • 23
  • is it possible to use this Personal token as a environment variable from Openshift? – Bruno Justino Praciano Mar 02 '21 at 14:09
  • 1
    If you mean system environment variables then you can find helpful information in this [answer](https://stackoverflow.com/a/49930497/14801225). If you mean Openshift environment variables (`oc set env`) , I don't think so, but unfortunately I'm not an expert in Openshift. – matt_j Mar 02 '21 at 14:51