Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Allow dags_in_image option for k8s #88

Open
cal-pratt opened this issue Jun 7, 2019 · 0 comments
Open

Allow dags_in_image option for k8s #88

cal-pratt opened this issue Jun 7, 2019 · 0 comments

Comments

@cal-pratt
Copy link

cal-pratt commented Jun 7, 2019

I was trying to run this project using k8s executor and the dags_in_image option and having no dags section

apiVersion: airflow.k8s.io/v1alpha1
kind: AirflowCluster
metadata:
  name: pk-cluster
spec:
  executor: Kubernetes
  config:
    airflow:
      AIRFLOW__KUBERNETES__DAGS_IN_IMAGE: "1"
  ui:
    image: "my-custom-airflow-image"
    version: "1.10.2"
    replicas: 1
  scheduler:
    image: "my-custom-airflow-image"
    version: "1.10.2"
  worker:
    image: "my-custom-airflow-image"
    version: "1.10.2"
  airflowbase:
    name: pc-base

However, I was getting errors when trying to run the operator:

  Conditions:
    Last Transition Time:  2019-06-06T06:39:42Z
    Last Update Time:      2019-06-06T06:39:42Z
    Message:               templates/airflow-configmap.yaml:template: tmpl:174:25: executing "tmpl" at <.Cluster.Spec.DAGs.G...>: can't evaluate field Repo in type *v1alpha1.GitSpec
    Reason:                ErrorSeen
    Status:                True
    Type:                  Error

I believe the issue is caused by doing a hardcoded lookup on the spec values for git

git_repo = {{.Cluster.Spec.DAGs.Git.Repo}}
git_branch = {{.Cluster.Spec.DAGs.Git.Branch}}
git_subpath = {{.Cluster.Spec.DAGs.DagSubdir}}
git_dags_folder_mount_point = /usr/local/airflow/dags/
git_sync_dest = gitdags
git_user =
git_password =

Not exactly sure how to fix this in a proper manner, but removing these lines in the operator image was enough to get me past this issue.

Thanks a lot

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant