Skip to content

Commit 0720971

Browse files
committed
adapt listener changes
1 parent d2e31a3 commit 0720971

File tree

3 files changed

+28
-17
lines changed

3 files changed

+28
-17
lines changed

demos/airflow-scheduled-job/03-enable-and-run-spark-dag.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ spec:
1313
# restarted. Additionally, the db-init job takes a few minutes to complete before the cluster is deployed. The wait/watch steps
1414
# below are not "water-tight" but add a layer of stability by at least ensuring that the db is initialized and ready and that
1515
# all pods are reachable (albeit independent of each other).
16-
command: ["bash", "-c", "
17-
kubectl rollout status --watch statefulset/airflow-webserver-default
18-
&& kubectl rollout status --watch statefulset/airflow-scheduler-default
19-
&& export AIRFLOW_ADMIN_PASSWORD=$(cat /airflow-credentials/adminUser.password)
20-
&& export ACCESS_TOKEN=$(curl -XPOST http://airflow-webserver-default:8080/auth/token -H 'Content-Type: application/json' -d '{\"username\": \"admin\", \"password\": \"'$AIRFLOW_ADMIN_PASSWORD'\"}' | jq '.access_token' | tr -d '\"')
21-
&& curl -H \"Authorization: Bearer $ACCESS_TOKEN\" -H 'Content-Type: application/json' -XPATCH http://airflow-webserver-default:8080/api/v2/dags/sparkapp_dag -d '{\"is_paused\": false}' | jq
22-
&& curl -H \"Authorization: Bearer $ACCESS_TOKEN\" -H 'Content-Type: application/json' -XPOST http://airflow-webserver-default:8080/api/v2/dags/sparkapp_dag/dagRuns -d '{\"logical_date\": null}' | jq
23-
"]
16+
command: [
17+
"bash",
18+
"-c",
19+
'
20+
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+
]
2428
volumeMounts:
2529
- name: airflow-credentials
2630
mountPath: /airflow-credentials

demos/airflow-scheduled-job/04-enable-and-run-date-dag.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ spec:
1313
# restarted. Additionally, the db-init job takes a few minutes to complete before the cluster is deployed. The wait/watch steps
1414
# below are not "water-tight" but add a layer of stability by at least ensuring that the db is initialized and ready and that
1515
# all pods are reachable (albeit independent of each other).
16-
command: ["bash", "-c", "
17-
kubectl rollout status --watch statefulset/airflow-webserver-default
18-
&& kubectl rollout status --watch statefulset/airflow-scheduler-default
19-
&& export AIRFLOW_ADMIN_PASSWORD=$(cat /airflow-credentials/adminUser.password)
20-
&& export ACCESS_TOKEN=$(curl -XPOST http://airflow-webserver-default:8080/auth/token -H 'Content-Type: application/json' -d '{\"username\": \"admin\", \"password\": \"'$AIRFLOW_ADMIN_PASSWORD'\"}' | jq '.access_token' | tr -d '\"')
21-
&& curl -H \"Authorization: Bearer $ACCESS_TOKEN\" -H 'Content-Type: application/json' -XPATCH http://airflow-webserver-default:8080/api/v2/dags/date_demo -d '{\"is_paused\": false}' | jq
22-
&& curl -H \"Authorization: Bearer $ACCESS_TOKEN\" -H 'Content-Type: application/json' -XPOST http://airflow-webserver-default:8080/api/v2/dags/date_demo/dagRuns -d '{\"logical_date\": null}' | jq
23-
"]
16+
command: [
17+
"bash",
18+
"-c",
19+
'
20+
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/date_demo -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/date_demo/dagRuns -d ''{"logical_date": null}'' | jq
26+
',
27+
]
2428
volumeMounts:
2529
- name: airflow-credentials
2630
mountPath: /airflow-credentials

stacks/airflow/airflow.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ spec:
2626
mountPath: /dags/pyspark_pi.yaml
2727
subPath: pyspark_pi.yaml
2828
webservers:
29+
roleConfig:
30+
listenerClass: external-unstable
2931
config:
3032
resources:
3133
cpu:
@@ -34,7 +36,6 @@ spec:
3436
memory:
3537
limit: 2Gi
3638
gracefulShutdownTimeout: 30s
37-
listenerClass: external-unstable
3839
roleGroups:
3940
default:
4041
envOverrides:
@@ -302,6 +303,8 @@ data:
302303
memory:
303304
limit: 1024Mi
304305
replicas: 3
306+
307+
305308
# {% endraw %}
306309
---
307310
apiVersion: v1

0 commit comments

Comments
 (0)