Comments (6)
airflow is weird. The whole purpose of this setting is to let the scheduler kills itself periodically to reload DAGs. In kubernetes this does not have a huge impact since it will be restarted automatically, and the whole kill/restart cicle can take a while, but airflow does not do sub seconds precision.
-1 means you can never update your DAG, 1 means scheduler kills itself at every task launch
from kube-airflow.
I feel like it would have less impact in Docker, but with Kube managing the pods it ends up putting the cluster in a not-happy state with backoffs because the exiting script looks like a crash. Thanks for the heads up on the motivation to exit after a few task runs - I'm going to modify the start shell script in my version of the Docker container. I think it makes sense to run the scheduler in a while loop but break if it returns a bad error code, so Kube can still manage those incidents as real crashes.
from kube-airflow.
feel free to submit a pull request. I do have my scheduler restarting regularly, I don't see problems except it takes a few minutes to power on (so delaying next dag start)
from kube-airflow.
The issue that I had with kubernetes is that it tracks the number of restarts, so if you run this application indefinitely you could see large reset numbers over a long period of time which would be a red flag to an administrator that runs "kubectl get pods" on the cluster, unless I am understanding it wrong.
As a solution, maybe this pod could be run as a kubernetes cronjob or kubernetes job.
Change in YAML would be similar to below but have not fully debugged yet.
Would this break the way the scheduler works?
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: scheduler
labels:
app: airflow
tier: scheduler
spec:
schedule: "*/2 * * * *" #every 5 minutes
jobTemplate:
spec:
template:
spec:
restartPolicy: Never
containers:
- name: scheduler
image: <image-location>
# volumes:
# - /localpath/to/dags:/usr/local/airflow/dags
env:
- name: AIRFLOW_HOME
value: "/usr/local/airflow"
args: ["scheduler", "-n", "5"]
from kube-airflow.
@gsemet How/where did you change the config for the scheduler to restart automatically? I'm not seeing it in airflow.cfg.
from kube-airflow.
@gsemet when scheduler args n != -1 it will restart and then go to CrashLoopBackOff later. You can see it in helm chart
from kube-airflow.
Related Issues (20)
- Log does not show when browsing Logs on web UI HOT 4
- scheduler pods is in CrashLoopBackOff mode HOT 4
- Need support for plugins. HOT 1
- (ImportError: No module named 'MySQLdb') celery executor issue HOT 2
- SU pwd?
- Embedded dags - handling deployments HOT 1
- Error when accessing logfile HOT 1
- enable daemon in scheduler ?
- helm installation fail HOT 1
- where is the dags floder?
- Run the test "tutorial" HOT 1
- Allow DNS to resolve workers HOT 3
- How do i add dags
- What is the difference between make helm-install and just using helm-install
- Using external databse. HOT 1
- Library issues in puckel/docker-airflow
- Yaml for the StatefulSets worker
- Rabbitmq not reachable
- Pinning rabbitmq without a minor version broke when a default timeout was added to rabbitmq
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube-airflow.