File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
demos/airflow-scheduled-job Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -13,18 +13,18 @@ spec:
13
13
# restarted. Additionally, the db-init job takes a few minutes to complete before the cluster is deployed. The wait/watch steps
14
14
# below are not "water-tight" but add a layer of stability by at least ensuring that the db is initialized and ready and that
15
15
# all pods are reachable (albeit independent of each other).
16
- command : [
17
- " bash" ,
18
- " -c" ,
19
- '
16
+ command :
17
+ - bash
18
+ - -euo
19
+ - pipefail
20
+ - -c
21
+ - |
20
22
kubectl rollout status --watch statefulset/airflow-webserver-default
21
- && kubectl rollout status --watch statefulset/airflow-scheduler-default
22
- && export AIRFLOW_ADMIN_PASSWORD=$(cat /airflow-credentials/adminUser.password)
23
- && export ACCESS_TOKEN=$(curl -XPOST http://airflow-webserver-default-headless:8080/auth/token -H '' Content-Type: application/json'' -d '' {"username": "admin", "password": "'' $AIRFLOW_ADMIN_PASSWORD'' "}'' | jq '' .access_token'' | tr -d '' "'' )
24
- && curl -H "Authorization: Bearer $ACCESS_TOKEN" -H '' Content-Type: application/json'' -XPATCH http://airflow-webserver-default-headless:8080/api/v2/dags/sparkapp_dag -d '' {"is_paused": false}'' | jq
25
- && curl -H "Authorization: Bearer $ACCESS_TOKEN" -H '' Content-Type: application/json'' -XPOST http://airflow-webserver-default-headless:8080/api/v2/dags/sparkapp_dag/dagRuns -d '' {"logical_date": null}'' | jq
26
- ' ,
27
- ]
23
+ kubectl rollout status --watch statefulset/airflow-scheduler-default
24
+ AIRFLOW_ADMIN_PASSWORD=$(cat /airflow-credentials/adminUser.password)
25
+ ACCESS_TOKEN=$(curl -XPOST http://airflow-webserver-default-headless:8080/auth/token -H 'Content-Type: application/json' -d '{"username": "admin", "password": "'$AIRFLOW_ADMIN_PASSWORD'"}' | jq -r .access_token)
26
+ curl -H "Authorization: Bearer $ACCESS_TOKEN" -H 'Content-Type: application/json' -XPATCH http://airflow-webserver-default-headless:8080/api/v2/dags/sparkapp_dag -d '{"is_paused": false}' | jq
27
+ curl -H "Authorization: Bearer $ACCESS_TOKEN" -H 'Content-Type: application/json' -XPOST http://airflow-webserver-default-headless:8080/api/v2/dags/sparkapp_dag/dagRuns -d '{"logical_date": null}' | jq
28
28
volumeMounts :
29
29
- name : airflow-credentials
30
30
mountPath : /airflow-credentials
You can’t perform that action at this time.
0 commit comments