Skip to content

Commit c9ac5c3

Browse files
authored
Merge pull request #68160 from jeana-redhat/OSDOCS-8741-machine-phases-lifecycle
[OSDOCS-8741] Machine phases and lifecycle
2 parents 6ac164e + e88ff31 commit c9ac5c3

8 files changed

+180
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,6 +2165,8 @@ Topics:
21652165
File: manually-scaling-machineset
21662166
- Name: Modifying a compute machine set
21672167
File: modifying-machineset
2168+
- Name: Machine phases and lifecycle
2169+
File: machine-phases-lifecycle
21682170
- Name: Deleting a machine
21692171
File: deleting-machine
21702172
- Name: Applying autoscaling to a cluster

machine_management/deleting-machine.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ include::modules/machine-lifecycle-hook-deletion-etcd.adoc[leveloffset=+2]
2828
[id="additional-resources_unhealthy-etcd-member"]
2929
== Additional resources
3030

31+
* xref:../machine_management/machine-phases-lifecycle.adoc#machine-phases-lifecycle[Machine phases and lifecycle]
3132
* xref:../backup_and_restore/control_plane_backup_and_restore/replacing-unhealthy-etcd-member.adoc#replacing-unhealthy-etcd-member[Replacing an unhealthy etcd member]
3233
* xref:../machine_management/control_plane_machine_management/cpmso-using.adoc#cpmso-using[Managing control plane machines with control plane machine sets]

machine_management/index.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ The Machine API Operator provisions the following resources:
2424
2525
include::modules/machine-api-overview.adoc[leveloffset=+1]
2626

27+
[role="_additional-resources"]
28+
.Additional resources
29+
* xref:../machine_management/machine-phases-lifecycle.adoc#machine-phases-lifecycle[Machine phases and lifecycle]
30+
2731
[id="machine-mgmt-intro-managing-compute_{context}"]
2832
== Managing compute machines
2933

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="machine-phases-lifecycle"]
3+
= Machine phases and lifecycle
4+
include::_attributes/common-attributes.adoc[]
5+
:context: machine-phases-lifecycle
6+
7+
toc::[]
8+
9+
Machines move through a _lifecycle_ that has several defined phases. Understanding the machine lifecycle and its phases can help you verify whether a procedure is complete or troubleshoot undesired behavior. In {product-title}, the machine lifecycle is consistent across all supported cloud providers.
10+
11+
//Machine phases
12+
include::modules/machine-about-phases.adoc[leveloffset=+1]
13+
14+
//The machine lifecycle
15+
include::modules/machine-about-lifecycle.adoc[leveloffset=+1]
16+
17+
[id="machine-determine-phase_{context}"]
18+
== Determining the phase of a machine
19+
20+
You can find the phase of a machine by using the {oc-first} or by using the web console. You can use this information to verify whether a procedure is complete or to troubleshoot undesired behavior.
21+
22+
//Determining the phase of a machine by using the CLI
23+
include::modules/machine-determine-phase-cli.adoc[leveloffset=+2]
24+
25+
//Determining the phase of a machine by using the web console
26+
include::modules/machine-determine-phase-gui.adoc[leveloffset=+2]
27+
28+
[role="_additional-resources"]
29+
== Additional resources
30+
31+
* xref:../machine_management/deleting-machine.adoc#machine-lifecycle-hook-deletion_deleting-machine[Lifecycle hooks for the machine deletion phase]

modules/machine-about-lifecycle.adoc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/machine-phases-lifecycle.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="machine-about-lifecycle_{context}"]
7+
= The machine lifecycle
8+
9+
The lifecycle begins with the request to provision a machine and continues until the machine no longer exists.
10+
11+
//.Machine lifecycle
12+
//image::to-do-machine-lifecycle.png["The sequence of events in the machine lifecycle."]
13+
14+
The machine lifecycle proceeds in the following order. Interruptions due to errors or lifecycle hooks are not included in this overview.
15+
16+
. There is a request to provision a new machine for one of the following reasons:
17+
** A cluster administrator scales a machine set such that it requires additional machines.
18+
** An autoscaling policy scales machine set such that it requires additional machines.
19+
** A machine that is managed by a machine set fails or is deleted and the machine set creates a replacement to maintain the required number of machines.
20+
21+
. The machine enters the `Provisioning` phase.
22+
23+
. The infrastructure provider creates an instance for the machine.
24+
25+
. The machine has a provider ID or address and enters the `Provisioned` phase.
26+
27+
. The Ignition configuration file is processed.
28+
29+
. The kubelet issues a certificate signing request (CSR).
30+
31+
. The cluster machine approver approves the CSR.
32+
33+
. The machine becomes a node and enters the `Running` phase.
34+
35+
. An existing machine is slated for deletion for one of the following reasons:
36+
** A user with `cluster-admin` permissions uses the `oc delete machine` command.
37+
** The machine gets a `machine.openshift.io/delete-machine` annotation.
38+
** The machine set that manages the machine marks it for deletion to reduce the replica count as part of reconciliation.
39+
** The cluster autoscaler identifies a node that is unnecessary to meet the deployment needs of the cluster.
40+
** A machine health check is configured to replace an unhealthy machine.
41+
42+
. The machine enters the `Deleting` phase, in which it is marked for deletion but is still present in the API.
43+
44+
. The machine controller removes the instance from the infrastructure provider.
45+
46+
. The machine controller deletes the `Node` object.

modules/machine-about-phases.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/machine-phases-lifecycle.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="machine-about-phases_{context}"]
7+
= Machine phases
8+
9+
As a machine moves through its lifecycle, it passes through different phases. Each phase is a basic representation of the state of the machine.
10+
11+
`Provisioning`:: There is a request to provision a new machine. The machine does not yet exist and does not have an instance, a provider ID, or an address.
12+
13+
`Provisioned`:: The machine exists and has a provider ID or an address. The cloud provider has created an instance for the machine. The machine has not yet become a node and the `status.nodeRef` section of the machine object is not yet populated.
14+
15+
`Running`:: The machine exists and has a provider ID or address. Ignition has run successfully and the cluster machine approver has approved a certificate signing request (CSR). The machine has become a node and the `status.nodeRef` section of the machine object contains node details.
16+
17+
`Deleting`:: There is a request to delete the machine. The machine object has a `DeletionTimestamp` field that indicates the time of the deletion request.
18+
19+
`Failed`:: There is an unrecoverable problem with the machine. This can happen, for example, if the cloud provider deletes the instance for the machine.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/machine-phases-lifecycle.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="machine-determine-phase-cli_{context}"]
7+
= Determining the phase of a machine by using the CLI
8+
9+
You can find the phase of a machine by using the {oc-first}.
10+
11+
.Prerequisites
12+
13+
* You have access to an {product-title} cluster using an account with `cluster-admin` permissions.
14+
* You have installed the `oc` CLI.
15+
16+
.Procedure
17+
18+
* List the machines on the cluster by running the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc get machine -n openshift-machine-api
23+
----
24+
+
25+
.Example output
26+
+
27+
[source,text]
28+
----
29+
NAME PHASE TYPE REGION ZONE AGE
30+
mycluster-5kbsp-master-0 Running m6i.xlarge us-west-1 us-west-1a 4h55m
31+
mycluster-5kbsp-master-1 Running m6i.xlarge us-west-1 us-west-1b 4h55m
32+
mycluster-5kbsp-master-2 Running m6i.xlarge us-west-1 us-west-1a 4h55m
33+
mycluster-5kbsp-worker-us-west-1a-fmx8t Running m6i.xlarge us-west-1 us-west-1a 4h51m
34+
mycluster-5kbsp-worker-us-west-1a-m889l Running m6i.xlarge us-west-1 us-west-1a 4h51m
35+
mycluster-5kbsp-worker-us-west-1b-c8qzm Running m6i.xlarge us-west-1 us-west-1b 4h51m
36+
----
37+
+
38+
The `PHASE` column of the output contains the phase of each machine.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/machine-phases-lifecycle.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="machine-determine-phase-gui_{context}"]
7+
= Determining the phase of a machine by using the web console
8+
9+
You can find the phase of a machine by using the {product-title} web console.
10+
11+
.Prerequisites
12+
13+
* You have access to an {product-title} cluster using an account with `cluster-admin` permissions.
14+
15+
.Procedure
16+
17+
. Log in to the web console as a user with the `cluster-admin` role.
18+
19+
. Navigate to *Compute* -> *Machines*.
20+
21+
. On the *Machines* page, select the name of the machine that you want to find the phase of.
22+
23+
. On the *Machine details* page, select the *YAML* tab.
24+
25+
. In the YAML block, find the value of the `status.phase` field.
26+
+
27+
.Example YAML snippet
28+
+
29+
[source,yaml]
30+
----
31+
apiVersion: machine.openshift.io/v1beta1
32+
kind: Machine
33+
metadata:
34+
name: mycluster-5kbsp-worker-us-west-1a-fmx8t
35+
# ...
36+
status:
37+
phase: Running # <1>
38+
----
39+
<1> In this example, the phase is `Running`.

0 commit comments

Comments
 (0)