Code Monkey home page Code Monkey logo

Comments (9)

raphaelauv avatar raphaelauv commented on May 31, 2024 1

in the Triggerer

[2022-03-11 10:41:14,176] {triggerer_job.py:356} INFO - Trigger <astronomer.providers.cncf.kubernetes.triggers.wait_container.WaitContainerTrigger kubernetes_conn_id=None, hook_params={'cluster_context': None, 'config_file': None, 'in_cluster': None}, pod_name=airflow-test-pod.3279ee5034e046e2baa4b22d746cabf4, container_name=base, pod_namespace=default, pending_phase_timeout=120, poll_interval=10> (ID 9) starting
2022-03-11T10:41:14.186014105Z [2022-03-11 10:41:14,176] {kube_config.py:482} WARNING - Config not found: ~/.kube/config

I can fix the problem by doing this ->

    KubernetesPodOperatorAsync(
        config_file=os.getenv("AIRFLOW__KUBERNETES__CONFIG_FILE"),
        ...

from astronomer-providers.

dstandish avatar dstandish commented on May 31, 2024 1

actually i would prefer if we do not add support for using the config. as @raphaelauv has pointed out, users can set the config file in operator param. and once we add support for k8s hook in kpo, then users can just set it in k8s connection.

if we add support for taking values from conf, then we'll have to make a major release in astro operators to remove it. it seems that if we document this difference, then when switching to this operator they can also take care to set param.

what do yall think?

from astronomer-providers.

kaxil avatar kaxil commented on May 31, 2024 1

Yup agreed, thank you both

from astronomer-providers.

kaxil avatar kaxil commented on May 31, 2024

@raphaelauv Where did you see this log, on Triggerer or Scheduler ?

cc @dstandish

from astronomer-providers.

kaxil avatar kaxil commented on May 31, 2024

Looks like we have the same thing with KubernetesPodOperator, currently that setting is mostly for KubernetesExecutor and we can make it explicit in Airflow docs or start using the configs for KPO too :)

The other thing you could do is:

    KubernetesPodOperatorAsync(
        config_file=conf.get("kubernetes", "config_file"),
        namespace=conf.get("kubernetes", "namespace"),
        ...

That way, it will work for all different ways of settings Airflow configs: Secrets Backend, Env Vars, airflow.cfg :)

from astronomer-providers.

raphaelauv avatar raphaelauv commented on May 31, 2024

No AIRFLOW__KUBERNETES__CONFIG_FILE work with the KubernetesPodOperator because of this line

https://github.com/apache/airflow/blob/3452f7ce45607af04bade5e5edebaa18fdc13819/airflow/kubernetes/kube_client.py#L133

call by https://github.com/apache/airflow/blob/3452f7ce45607af04bade5e5edebaa18fdc13819/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py#L320

I've been using for long time the KPO without explicitly passing the config_file thanks to that env_var

from astronomer-providers.

kaxil avatar kaxil commented on May 31, 2024

Oh yes, you are absolutely right, we will fix it and release a new version soon :)

from astronomer-providers.

dstandish avatar dstandish commented on May 31, 2024

Yeah more work needs to be done to (1) make KPO use K8s hook and (2) no longer depend on internal kubernetes utils. There are a few PRs in flight concerning this. I am thinking we should add support for AIRFLOW__KUBERNETES__CONFIG_FILE with a deprecation warning and signal that in future everything will have to be configured through the hook. Let me look into this.

from astronomer-providers.

raphaelauv avatar raphaelauv commented on May 31, 2024

I agree with you, using a K8S connection will be nicer, so let's not add this feature to the KPOA.

from astronomer-providers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.