Argo CD Self-Healing Capabilities ⏱️ Estimated Time: 5 Minutes 👩💻 Role: Cluster Administrator and/or Developers Argo CD is capable healing resources when it detects configuration drift. For example, when a resource that should be present is missing it will be recreated by Argo CD. Another example is when a field such as spec.replicas on a Deployment has a value mismatch between what’s stored in the Git repository and the actual value set on the resource in the cluster. If your Argo CD Application has the selfHeal property set to true then it will automatically detect and correct configuration drift for the resources it is managing. That means if someone accidentally runs a kubectl command against the wrong resource Argo CD will have your back and will restore the resource to the correct configuration! Observing Argo CD Self-Healing You currently have a Console Notification being managed by Argo CD. The selfHeal: true configuration is defined on the Application CR responsible for managing it. Go ahead an see what happens when you edit/delete the Console Notification resource using the oc or kubectl CLI: Login to the OpenShift Web Console as the opentlc-mgr user. Open the OpenShift Web Terminal using the >_ icon. Run the following command to list existing Console Notification resources: oc get consolenotification Run the following command to delete the welcome-banner Console Notification: oc delete consolenotification welcome-banner Depending on your timing the Console Notification will briefly disappear, and then immediately reappear. The reason that the Console Notification reappears is because the console-customisations Application in Argo CD has the selfHeal property set to true. List existing Console Notification resources again, and pay attention to the AGE column: oc get consolenotification Did you notice that the age of the Console Notification has changed? When you deleted the Console Notification it was automatically recreated by Argo CD. This is reflected through the new value displayed in the AGE column. Toggling the Self-Healing Behaviour It’s possible to toggle the self-healing behaviour at any time, so long as you have the necessary permissions and access to the Argo CD dashboard/resources: Open the Argo CD dashboard and log in as the admin user. If you’ve lost the password, you can return to the Accessing the Cluster GitOps Dashboard section to obtain it. Select the console-customisations Application. Click the App Details button in the header. An overlay will appear. Scroll down and click the Disable button next to Self Heal. Click the OK button when asked to confirm the change. Click the X icon in the top-right to close the modal window. Return to the OpenShift Web Console, and open the OpenShift Web Terminal. Return to the Web Terminal and run the following command to delete the ConsoleNotification: oc delete consolenotification welcome-banner The ConsoleNotification will disappear, and won’t reappear this time. The Argo CD dashboard should be reporting that the console-customisations Application is "OutOfSync". Use the Sync button to manually synchronise the Application and restore the banner. Consider re-enabling the self-healing configuration for peace of mind! First Steps with GitOps using Argo CD Using Kustomize for Templating YAML