Skip to content

Commit 7b1a2a7

Browse files
authored
Merge pull request #91739 from ShaunaDiaz/OSDOCS-12976
OSDOCS-12976: updates greenboot scripts MicroShift
2 parents 6bc0fa8 + f75156f commit 7b1a2a7

21 files changed

+417
-228
lines changed

_topic_maps/_topic_map_ms.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ Topics:
215215
File: microshift-embed-apps-offline-use
216216
- Name: Embedding applications tutorial
217217
File: microshift-embedding-apps-tutorial
218-
- Name: Creating application or workload health check scripts
219-
File: microshift-greenboot-workload-scripts
218+
- Name: Using greenboot for workload health checks
219+
File: microshift-greenboot-workload-health-checks
220220
- Name: Automating application management with GitOps
221221
File: microshift-gitops
222222
- Name: Pod security authentication and authorization

microshift_install_get_ready/microshift-greenboot.adoc

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@ include::_attributes/attributes-microshift.adoc[]
66

77
toc::[]
88

9-
Greenboot is the generic health check framework for the `systemd` service on `rpm-ostree` systems such as {op-system-ostree-first}. This framework is included in {microshift-short} installations with the `microshift-greenboot` and `greenboot-default-health-checks` RPM packages.
9+
Learn about how greenboot health checks are used with {microshift-short}.
1010

11-
Greenboot health checks run at various times to assess system health and automate a rollback on `rpm-ostree` systems to the last healthy state in cases of software trouble, for example:
12-
13-
* Default health check scripts run each time the system starts.
14-
* In addition the to the default health checks, you can write, install, and configure application health check scripts to also run every time the system starts.
15-
* Greenboot can reduce your risk of being locked out of edge devices during updates and prevent a significant interruption of service if an update fails.
16-
* When a failure is detected, the system boots into the last known working configuration using the `rpm-ostree` rollback capability. This feature is especially useful automation for edge devices where direct serviceability is either limited or non-existent.
17-
18-
A {microshift-short} application health check script is included in the `microshift-greenboot` RPM. The `greenboot-default-health-checks` RPM includes health check scripts verifying that DNS and `ostree` services are accessible. You can create your own health check scripts for the workloads you are running. You can write one that verifies that an application has started, for example.
11+
include::modules/microshift-greenboot-dir-use-for-scripts.adoc[leveloffset=+1]
1912

2013
include::modules/microshift-greenboot-dir-structure.adoc[leveloffset=+1]
2114

15+
include::modules/microshift-greenboot-included-health-checks.adoc[leveloffset=+1]
16+
2217
include::modules/microshift-greenboot-microshift-health-script.adoc[leveloffset=+1]
2318

2419
include::modules/microshift-greenboot-systemd-journal-data.adoc[leveloffset=+1]
@@ -40,4 +35,4 @@ include::modules/microshift-greenboot-check-update.adoc[leveloffset=+1]
4035
[id="additional-resources_microshift-greenboot_{context}"]
4136
[role="_additional-resources_microshift-greenboot"]
4237
== Additional resources
43-
* xref:../microshift_running_apps/microshift-greenboot-workload-scripts.adoc#microshift-greenboot-workload-scripts[Greenboot workload health check scripts]
38+
* xref:../microshift_running_apps/microshift-greenboot-workload-health-checks.adoc#microshift-greenboot-workload-health-checks[Greenboot workload health checks]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="microshift-greenboot-workload-health-checks"]
3+
= Using greenboot for application and workload health checks
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: microshift-greenboot-workload-health-checks
6+
7+
toc::[]
8+
9+
You can use greenboot health checks to assess the health of your workloads and applications.
10+
11+
include::modules/microshift-greenboot-how-workload-health-checks-work.adoc[leveloffset=+1]
12+
13+
include::modules/microshift-greenboot-health-check-command.adoc[leveloffset=+1]
14+
15+
include::modules/microshift-greenboot-app-health-check-script.adoc[leveloffset=+1]
16+
17+
include::modules/microshift-greenboot-workload-health-script-ex.adoc[leveloffset=+2]
18+
19+
include::modules/microshift-greenboot-testing-workload-script.adoc[leveloffset=+2]
20+
21+
[role="_additional-resources"]
22+
== Additional resources
23+
24+
* xref:../microshift_install_get_ready/microshift-greenboot.adoc#microshift-greenboot[The greenboot health check]
25+
26+
* xref:../microshift_running_apps/microshift-applications.adoc#microshift-applying-manifests-example_applications-microshift[Auto applying manifests]

microshift_running_apps/microshift-greenboot-workload-scripts.adoc

Lines changed: 0 additions & 25 deletions
This file was deleted.

microshift_updating/microshift-update-options.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To begin a {microshift-short} update by embedding in a {op-system-ostree} image,
5151
To understand more about greenboot, see the following documentation:
5252

5353
* xref:../microshift_install_get_ready/microshift-greenboot.adoc#microshift-greenboot[The greenboot health check]
54-
* xref:../microshift_running_apps/microshift-greenboot-workload-scripts.adoc#microshift-greenboot-workload-scripts[Greenboot workload health check scripts]
54+
* xref:../microshift_running_apps/microshift-greenboot-workload-health-checks.adoc#microshift-greenboot-workload-health-checks[Greenboot workload health checks]
5555

5656
[id="microshift-update-options-manual-rpm-updates_{context}"]
5757
=== Manual RPM updates
@@ -91,4 +91,4 @@ You can update {op-system-ostree} or {op-system-base} and update {microshift-sho
9191
* xref:../microshift_updating/microshift-update-rpms-ostree.adoc#microshift-update-rpms-ostree[Applying updates on an OSTree system]
9292
* xref:../microshift_updating/microshift-update-rpms-manually.adoc#microshift-update-rpms-manually[Applying updates manually with RPMs]
9393
* xref:../microshift_install_get_ready/microshift-greenboot.adoc#microshift-greenboot[The greenboot system health check]
94-
* xref:../microshift_running_apps/microshift-greenboot-workload-scripts.adoc#microshift-greenboot-workload-scripts[Greenboot workload scripts]
94+
* xref:../microshift_running_apps/microshift-greenboot-workload-health-checks.adoc#microshift-greenboot-workload-health-checks[Greenboot workload health checks]
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+
//* microshift_running_apps/microshift-greenboot-workload-health-checks.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="microshift-greenboot-app-health-check-script_{context}"]
7+
= How to create a health check script for your application
8+
9+
You can create workload or application health check scripts in the text editor of your choice. Save the scripts in the `/etc/greenboot/check/required.d` directory. When a script in the `/etc/greenboot/check/required.d` directory exits with an error, greenboot triggers a reboot in an attempt to heal the system.
10+
11+
[NOTE]
12+
====
13+
Any script in the `/etc/greenboot/check/required.d` directory triggers a reboot if it exits with an error.
14+
====
15+
16+
If your health check logic requires any post-check steps, you can also create additional scripts and save them in the relevant greenboot directories. For example:
17+
18+
* You can also place shell scripts you want to run after a boot has been declared successful in `/etc/greenboot/green.d`.
19+
* You can place shell scripts you want to run after a boot has been declared failed in `/etc/greenboot/red.d`. For example, if you have steps to heal the system before restarting, you can create scripts for your use case and place them in the `/etc/greenboot/red.d` directory.

modules/microshift-greenboot-check-update.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ Access the output of greenboot health check scripts in the system log after an u
1616
----
1717
$ sudo grub2-editenv - list | grep ^boot_success
1818
----
19-
19+
+
2020
.Example output for a successful update
2121
[source,terminal]
2222
----
23-
boot_success=1
23+
boot_success=1 <1>
2424
----
25-
26-
If your command returns `boot_success=0`, either the greenboot health check is still running, or the update is a failure.
25+
<1> If your command returns `boot_success=0`, either the greenboot health check is still running, or the update is a failure.

modules/microshift-greenboot-create-health-check-script.adoc

Lines changed: 0 additions & 113 deletions
This file was deleted.

modules/microshift-greenboot-dir-structure.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ If you customize the values of any environment variable in the `/etc/greenboot/g
4646
4747
* To retain customizations when building system images with {microshift-short}, add the `greenboot.conf` file to a blueprint.
4848
* To retain customizations when using an RPM installation, apply changes to the `greenboot.conf` file after you install {microshift-short} and greenboot RPMs.
49-
====
49+
====
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_install_get_ready/microshift-greenboot.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="microshift-greenboot-dir-use-for-scripts_{context}"]
7+
= How greenboot uses directories to run scripts
8+
9+
Greenboot is the generic health check framework for the `systemd` service on `rpm-ostree` systems such as {op-system-ostree-first}. This framework is included in {microshift-short} installations with the `microshift-greenboot` and `greenboot-default-health-checks` RPM packages.
10+
11+
Greenboot health checks run at various times to assess system health and automate a rollback on `rpm-ostree` systems to the last healthy state in cases of software trouble, for example:
12+
13+
* Default health check scripts run each time the system starts.
14+
* In addition the to the default health checks, you can write, install, and configure application health check scripts to also run every time the system starts.
15+
* Greenboot can reduce your risk of being locked out of edge devices during updates and prevent a significant interruption of service if an update fails.
16+
* When a failure is detected, the system boots into the last known working configuration using the `rpm-ostree` rollback capability. This feature is especially useful automation for edge devices where direct serviceability is either limited or non-existent.
17+
18+
A {microshift-short} application health check script is included in the `microshift-greenboot` RPM. The `greenboot-default-health-checks` RPM includes health check scripts verifying that DNS and `ostree` services are accessible. You can create your own health check scripts for the workloads you are running. You can write one that verifies that an application has started, for example.

0 commit comments

Comments
 (0)