Skip to content

Commit d896761

Browse files
razvannightkrsbernauer
authored
Document restarts (#478)
* Document service restarts * Fix xref and some cleanup * Update modules/concepts/pages/operations/cluster_operations.adoc Co-authored-by: Natalie <nat@nullable.se> * Update modules/concepts/pages/operations/cluster_operations.adoc Co-authored-by: Natalie <nat@nullable.se> * Remove code quotes. * Rename stacklet to myairflow * Typo * Example with HDFS * Update modules/concepts/pages/operations/cluster_operations.adoc Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de> * Update modules/concepts/pages/operations/cluster_operations.adoc Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de> * Update modules/concepts/pages/operations/cluster_operations.adoc Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de> --------- Co-authored-by: Natalie <nat@nullable.se> Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
1 parent 7dbcabe commit d896761

File tree

1 file changed

+51
-3
lines changed

1 file changed

+51
-3
lines changed

modules/concepts/pages/operations/cluster_operations.adoc

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Stackable operators offer different cluster operations to control the reconcilia
66
* `reconciliationPaused` - Stop the operator from reconciling the cluster spec. The status will still be updated.
77
* `stopped` - Stop all running pods but keep updating all deployed resources like `ConfigMaps`, `Services` and the cluster status.
88
9+
If not specified, `clusterOperation.reconciliationPaused` and `clusterOperation.stopped` default to `false`.
10+
911
== Example
1012

1113
[source,yaml]
@@ -15,8 +17,54 @@ include::example$cluster-operations.yaml[]
1517
<1> The `clusterOperation.reconciliationPaused` flag set to `true` stops the operator from reconciling any changes to the cluster spec. The cluster status is still updated.
1618
<2> The `clusterOperation.stopped` flag set to `true` stops all pods in the cluster. This is done by setting all deployed `StatefulSet` replicas to 0.
1719

18-
== Notes
19-
20-
If not specified, `clusterOperation.reconciliationPaused` and `clusterOperation.stopped` default to `false`.
2120

2221
IMPORTANT: When setting `clusterOperation.reconciliationPaused` and `clusterOperation.stopped` to true in the same step, `clusterOperation.reconciliationPaused` will take precedence. This means the cluster will stop reconciling immediately and the `stopped` field is ignored. To avoid this, the cluster should first be stopped and then paused.
22+
23+
== Service Restarts
24+
25+
=== Manual Restarts
26+
27+
Sometimes it is necessary to restart services deployed in Kubernetes. A service restart should induce as little disruption as possible, ideally none.
28+
29+
Most operators create StatefulSet objects for the products they manage and Kubernetes offers a rollout mechanism to restart them. You can use `kubectl rollout restart statefulset` to restart a StatefulSet previously created by an operator.
30+
31+
To illustrate how to use the command line to restart one or more Pods, we will assume you used the Stackable HDFS Operator to deploy an HDFS stacklet called `dumbo`.
32+
33+
This stacklet will consist, among other things, of three StatefulSets created for each HDFS role: `namenode`, `datanode` and `journalnode`. Let's list them:
34+
35+
[source,shell]
36+
----
37+
❯ kubectl get statefulset -l app.kubernetes.io/instance=dumbo
38+
NAME READY AGE
39+
dumbo-datanode-default 2/2 4m41s
40+
dumbo-journalnode-default 1/1 4m41s
41+
dumbo-namenode-default 2/2 4m41s
42+
----
43+
44+
To restart the HDFS DataNode Pods, run:
45+
46+
[source,shell]
47+
----
48+
❯ kubectl rollout restart statefulset dumbo-datanode-default
49+
statefulset.apps/dumbo-datanode-default restarted
50+
----
51+
52+
Sometimes you want to restart all Pods of a stacklet and not just individual roles. This can be achieved in a similar manner by using labels instead of StatefulSet names. Continuing with the example above, to restart all HDFS Pods you would have to run:
53+
54+
[source,shell]
55+
----
56+
❯ kubectl rollout restart statefulset --selector app.kubernetes.io/instance=dumbo
57+
----
58+
59+
To wait for all Pods to be running again:
60+
61+
[source,shell]
62+
----
63+
❯ kubectl rollout status statefulset --selector app.kubernetes.io/instance=dumbo
64+
----
65+
66+
Here we used the label `app.kubernetes.io/instance=dumbo` to select all Pods that belong to a specific HDFS stacklet. This label is created by the operator and `dumbo` is the name of the HDFS stacklet as specified in the custom resource. You can add more labels to make finer grained restarts.
67+
68+
== Automatic Restarts
69+
70+
The Commons Operator of the Stackable Platform may restart Pods automatically, for purposes such as ensuring that TLS certificates are up-to-date. For details, see the xref:commons-operator:index.adoc[Commons Operator documentation].

0 commit comments

Comments
 (0)