mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
49 lines
2.3 KiB
Plaintext
49 lines
2.3 KiB
Plaintext
// Module is included in the following assemblies:
|
|
//
|
|
// * deploying-a-spring-boot-application-with-argo-cd
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="verifying-argo-cd-self-healing-behavior_{context}"]
|
|
= Verifying Argo CD self-healing behavior
|
|
|
|
Argo CD constantly monitors the state of deployed applications, detects differences between the specified manifests in Git and live changes in the cluster, and then automatically corrects them. This behavior is referred to as self-healing.
|
|
|
|
You can test and observe the self-healing behavior in Argo CD.
|
|
|
|
.Prerequisites
|
|
|
|
* The sample `app-spring-petclinic` application is deployed and configured.
|
|
|
|
.Procedure
|
|
|
|
. In the Argo CD dashboard, verify that your application has the `Synced` status.
|
|
|
|
. Click the `app-spring-petclinic` tile in the Argo CD dashboard to view the application resources that are deployed to the cluster.
|
|
|
|
. In the {product-title} web console, navigate to the *Developer* perspective.
|
|
|
|
. Modify the Spring PetClinic deployment and commit the changes to the `app/` directory of the Git repository. Argo CD will automatically deploy the changes to the cluster.
|
|
|
|
.. Fork the link:https://github.com/redhat-developer/openshift-gitops-getting-started[OpenShift GitOps getting started repository].
|
|
|
|
.. In the `deployment.yaml` file, change the `failureThreshold` value to `5`.
|
|
|
|
.. In the deployment cluster, run the following command to verify the changed value of the `failureThreshold` field:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc edit deployment spring-petclinic -n spring-petclinic
|
|
----
|
|
|
|
. Test the self-healing behavior by modifying the deployment on the cluster and scaling it up to two pods while watching the application in the {product-title} web console.
|
|
+
|
|
.. Run the following command to modify the deployment:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc scale deployment spring-petclinic --replicas 2 -n spring-petclinic
|
|
----
|
|
.. In the {product-title} web console, notice that the deployment scales up to two pods and immediately scales down again to one pod. Argo CD detected a difference from the Git repository and auto-healed the application on the {product-title} cluster.
|
|
|
|
. In the Argo CD dashboard, click the *app-spring-petclinic* tile → *APP DETAILS* → *EVENTS*. The *EVENTS* tab displays the following events: Argo CD detecting out of sync deployment resources on the cluster and then resyncing the Git repository to correct it.
|