From 946fe63dc978870262ad6fb0c63b3891b1bedc03 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:15:46 +0200 Subject: [PATCH 1/2] Document service restart --- .../pages/usage-guide/operations/restart.adoc | 33 +++++++++++++++++++ docs/modules/airflow/partials/nav.adoc | 1 + 2 files changed, 34 insertions(+) create mode 100644 docs/modules/airflow/pages/usage-guide/operations/restart.adoc diff --git a/docs/modules/airflow/pages/usage-guide/operations/restart.adoc b/docs/modules/airflow/pages/usage-guide/operations/restart.adoc new file mode 100644 index 00000000..5e464385 --- /dev/null +++ b/docs/modules/airflow/pages/usage-guide/operations/restart.adoc @@ -0,0 +1,33 @@ += Service Restarts + +== Manual Restarts + +Sometimes it is necessary to restart services deployed in Kubernetes. A service restart should induce as little disruption as possible, ideally none. + +Kubernetes offers rollout mechanism for this purpose. You can use `kubectl rollout restart statefulset` to restart the Airflow `scheduler`, `webserver` or `worker` Pods. + +For example, given the following stateful sets deployed for an Airflow cluster: + +---- +❯ kubectl get sts +NAME READY AGE +airflow-scheduler-default 1/1 61m +airflow-webserver-default 1/1 61m +airflow-worker-default 2/2 61m +postgresql-airflow 1/1 64m +redis-airflow-master 1/1 64m +redis-airflow-replicas 1/1 64m +---- + +To restart the Airflow scheduler, run: + +---- +❯ kubectl rollout restart statefulset airflow-scheduler-default +statefulset.apps/airflow-scheduler-default restarted +---- + +NOTE: When using Airflow's https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/executor/kubernetes.html[Kubernetes executor], `worker` Pods are created dynamically by DAGs when needed, this in general it's not necessary to restart them. + +== Automatic Restarts + +The Commons Operator of the Stackable Platform might restart Pods automatically, for example to ensure that security certificates are up to date. For details, see the xref:commons:index.adoc[Commons Operator documentation]. \ No newline at end of file diff --git a/docs/modules/airflow/partials/nav.adoc b/docs/modules/airflow/partials/nav.adoc index 8eff2fde..16fa5410 100644 --- a/docs/modules/airflow/partials/nav.adoc +++ b/docs/modules/airflow/partials/nav.adoc @@ -17,3 +17,4 @@ *** xref:airflow:usage-guide/operations/pod-placement.adoc[] *** xref:airflow:usage-guide/operations/pod-disruptions.adoc[] *** xref:airflow:usage-guide/operations/graceful-shutdown.adoc[] +*** xref:airflow:usage-guide/operations/restart.adoc[] From d469cdf16d25de7a05636a2793579664a68e376a Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:21:36 +0200 Subject: [PATCH 2/2] Attempt at fixing some language lints. --- .../modules/airflow/pages/usage-guide/operations/restart.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/modules/airflow/pages/usage-guide/operations/restart.adoc b/docs/modules/airflow/pages/usage-guide/operations/restart.adoc index 5e464385..c0ad96f2 100644 --- a/docs/modules/airflow/pages/usage-guide/operations/restart.adoc +++ b/docs/modules/airflow/pages/usage-guide/operations/restart.adoc @@ -8,6 +8,7 @@ Kubernetes offers rollout mechanism for this purpose. You can use `kubectl rollo For example, given the following stateful sets deployed for an Airflow cluster: +[source,shell] ---- ❯ kubectl get sts NAME READY AGE @@ -21,6 +22,7 @@ redis-airflow-replicas 1/1 64m To restart the Airflow scheduler, run: +[source,shell] ---- ❯ kubectl rollout restart statefulset airflow-scheduler-default statefulset.apps/airflow-scheduler-default restarted @@ -30,4 +32,4 @@ NOTE: When using Airflow's https://airflow.apache.org/docs/apache-airflow/stable == Automatic Restarts -The Commons Operator of the Stackable Platform might restart Pods automatically, for example to ensure that security certificates are up to date. For details, see the xref:commons:index.adoc[Commons Operator documentation]. \ No newline at end of file +The Commons Operator of the Stackable Platform might restart Pods automatically, for example to ensure that security certificates are up-to-date. For details, see the xref:commons:index.adoc[Commons Operator documentation]. \ No newline at end of file