Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023 08 22 argo cd configuration drift #3363

Merged
merged 107 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
1da6fed
Create 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Aug 22, 2023
c054003
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Aug 23, 2023
8379ba9
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Aug 28, 2023
420c836
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Aug 30, 2023
a11ef9e
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Aug 31, 2023
83a5d3c
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Aug 31, 2023
4a04171
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Aug 31, 2023
6814a7c
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Aug 31, 2023
4bb3c6c
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 1, 2023
19e735e
Add files via upload
danielguinan1 Sep 1, 2023
0efded8
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 1, 2023
b4f7a6b
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 1, 2023
9186cfc
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Sep 3, 2023
3a4608d
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 8, 2023
7983ba7
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 12, 2023
0403f91
Add files via upload
danielguinan1 Sep 14, 2023
938a7d4
Add files via upload
danielguinan1 Sep 14, 2023
92cc66e
Delete img/blog/configuration-drift-chart.png
danielguinan1 Sep 14, 2023
f829e73
Add files via upload
danielguinan1 Sep 14, 2023
1849815
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 14, 2023
92b3292
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 14, 2023
229c888
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 14, 2023
0247c5e
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 14, 2023
1c7c45a
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Sep 18, 2023
952a648
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Sep 18, 2023
cde774f
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 18, 2023
3f9f042
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Sep 18, 2023
15ae040
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Sep 18, 2023
2b37e96
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Sep 18, 2023
5cff3a7
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Sep 19, 2023
9557514
Add files via upload
danielguinan1 Sep 20, 2023
6b92207
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Sep 20, 2023
24f5b04
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Oct 3, 2023
2976308
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Oct 18, 2023
4fb5ddc
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Oct 19, 2023
9b9388c
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Feb 6, 2024
3bbc967
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Feb 6, 2024
e40062d
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Feb 6, 2024
bf8f857
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Feb 6, 2024
e35586f
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
mtamboli Feb 9, 2024
7184f47
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Feb 14, 2024
a45e417
Update 2023-08-22-ArgoCD-Configuration-Drift.adoc
danielguinan1 Feb 19, 2024
2c523b7
suggested edits from Grace review
Mar 28, 2024
e6b7ea8
changing date of blog
Mar 28, 2024
2b866cd
Apply suggestions from code review
GraceJansen Apr 5, 2024
6d3e552
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
87fa748
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
4c2e46e
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
94c715b
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
e96e75a
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
85cbabb
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
069fa7b
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
2df2f6f
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
c75a3e0
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
bb94fd1
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
f590d08
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
e3a1b61
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
22a70cf
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
aedfc8e
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
1d194bd
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
b44e72f
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
7886d19
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
28b6702
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
e5f2f77
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
7f8c3a7
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
ac18ff7
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
67583b5
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
a68ef78
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
36d961b
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
5a22ab3
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
5661934
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
4676481
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
5ec2c51
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
77aa328
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
b66788d
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
b74d2e4
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 17, 2024
5b1d6ea
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 18, 2024
44b92a1
Update 2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 18, 2024
7bbd11b
Update 2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 18, 2024
69abfe1
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 18, 2024
36bea09
Update 2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 18, 2024
91810d0
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 18, 2024
fb589a2
Update 2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 18, 2024
f706285
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
cb98ec4
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
564e351
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
08d60e8
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
97a67ee
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
48528f8
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
e2e4c0b
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
186a393
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
912218d
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
c8f242a
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
dd0e6b0
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
8638b78
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
23c80d2
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
8e9a310
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
49d2db7
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
c3c3361
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
9c8b6cb
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
f7139ae
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
27ae61e
Update posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 22, 2024
dbb1ecc
edits
dmuelle Apr 23, 2024
8de8204
Update 2024-03-29-ArgoCD-Configuration-Drift.adoc
dmuelle Apr 23, 2024
8c6c3d6
acrolinx edits
dmuelle Apr 23, 2024
0f6349d
Update 2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 24, 2024
b3361cf
Update 2024-03-29-ArgoCD-Configuration-Drift.adoc
danielguinan1 Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added img/blog/configuration-drift-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-outofsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/configuration-drift-synced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
163 changes: 163 additions & 0 deletions posts/2024-03-29-ArgoCD-Configuration-Drift.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
layout: post
title: "A Solution to Configuration Drift - Deploying Open Liberty with GitOps"
# Do NOT change the categories section
categories: blog
author_picture: https://avatars3.githubusercontent.com/danielguinan1
author_github: https://github.com/danielguinan1
seo-title: A Solution to Configuration Drift - Deploying Open Liberty with GitOps - OpenLiberty.io
seo-description: Learn how to deploy an Open Liberty Application with GitOps
blog_description: "Learn how to deploy an Open Liberty Application with GitOps"
open-graph-image: https://openliberty.io/img/twitter_card.jpg
open-graph-image-alt: Open Liberty Logo
additional_authors:
- name: Monica Tamboli
github: https://github.com/mtamboli
image: https://avatars0.githubusercontent.com/mtamboli
---
= A Solution to Configuration Drift - Deploying Open Liberty with GitOps
Daniel Guinan <https://github.com/danielguinan1>
:imagesdir: /
:url-prefix:
:url-about: /

Many organizations are struggling with configuration drift, and GitOps provides a robust solution. If you're unfamiliar with what configuration drift is, how it can be caused, why it's bad or how GitOps can help to mitigate this, then check out part 1 of this two part blog series: [Configuration drift: Why its bad and how to solve it with GitOps and ArgoCD]

In this blog, part 2 of this series, we will demonstrate how the solutions introduced in part 1 can be practically applied. We will walk you through the deployment of an Open Liberty application to a Kubernetes cluster using a continuous deployment approach with GitOps and ArgoCD (a leading GitOps tool designed to automate application deployment and ensure configuration consistency, effectively addressing the drift issue).

* <<setup_argocd, See how to setup ArgoCD>>
* <<setup_gitops_repo, Explore how to setup a GitOps repo for your app>>
* <<deploy_app_with_gitops, Learn how to deploy a Java application with GitOps and ArgoCD>>
* <<manually_sync, Discover how to manually sync your app>>
* <<gitops_solve_config_drift, See how GitOps can solve Configuration Drift>>

== Getting your Cluster Ready

In this blog, we assume you have some form of kubernetes cluster, which you have access to using the `kubectl`CLI or `oc` CLI if on OpenShift.

=== Using the Open Liberty Operator

The Open Liberty Operator streamlines the deployment and management of Open Liberty Applications on Kubernetes. Instead of manually crafting Kubernetes resources for the application (like services, deployments, routes, etc.), the Operator enables us to define a few application details, and it automatically generates the required Kubernetes resources. Furthermore, it simplifies day 2 operations such as traces and heap dumps when needed. For more on the Open Liberty Operator check out the docs on it https://openliberty.io/docs/latest/open-liberty-operator.html[here].

To take advantage of all of these benefits, we can make use of the Open Liberty Operator to deploy an application using the following commands, which install the operator with its default configuration (watching all namespaces):
```
git clone https://github.com/OpenLiberty/open-liberty-operator.git
kubectl create namespace open-liberty
kubectl apply --server-side -k open-liberty-operator/deploy/releases/1.2.2/kustomize/overlays/watch-all-namespaces
```

For a more detailed tutorial on the Open Liberty Operator and how to make use of it, see our interactive guide: https://openliberty.io/guides/openliberty-operator-intro.html[Deploying a microservice to Kubernetes using Open Liberty Operator].

[#setup_argocd]
=== Setup ArgoCD for effective GitOps and Continuous Deployment

ArgoCD follows a GitOps pattern of using Git repositories as the source of truth for defining the desired application state, which we will use to deploy and monitor our Open Liberty configuration repository. ArgoCD will help us identify any drift that occurs between the current cluster state and the desired state in the configuration repository.

To install ArgoCD simply run these commands from the https://argo-cd.readthedocs.io/en/stable/getting_started/[Quickstart section] of the docs:


First, we'll use the following commands to create a new namespace named `argocd` and install ArgoCD by applying manifests to that namespace.
```
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
```

Next we'll get the default Admin credentials to access the ArgoCD user interface. Using the UI is a great way to get started, allowing us to create our application and identify configuration drift in a visual way.
To get the default Admin password run the following command:
```
kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 -d
```
To access the ArgoCD UI, go to the route of the `argocd-server` and log with the `admin` user and password.
[.img_border_light]
image::/img/blog/configuration-drift-1.png[Argo Login,width=70%,align="center"]

Once logged in, you should see the ArgoCD landing page similar to the screenshot below:
[.img_border_light]
image::/img/blog/configuration-drift-2.png[Argo Home,width=70%,align="center"]

[#setup_gitops_repo]
== Setting up a GitOps Repository for your Application
Now that you've successfully installed ArgoCD and gained access to its console, the next step is to set up a GitHub repository for ArgoCD to synchronize with. In our example we have created a deployment directory in the application code repo which we will point ArgoCD to for deployment. In our experience we found it better to separate the deployment configuration into a separate repository from the application code, however for this small example we have it with the application code.

It's a recommended best practice to maintain separation between configuration repositories and code repositories. Keeping these separate ensures that infrastructure changes are decoupled from application changes, allowing for more granular control, better audit trails, and reduced risk of unintended side-effects. The reasons why can be found in https://argo-cd.readthedocs.io/en/stable/user-guide/best_practices/[ArgoCD's documentation on best practices].

For the purposes of this blog, we'll use the Daytrader7 sample application. This application is built around the concept of an online stock trading system, and the Daytrader7 https://github.com/WASdev/sample.daytrader7#readme[README] provides a comprehensive overview of this application.

In this example, we have a `deploy` directory within our existing repository to house the deployment configuration. This directory contains the manifests for full application deployment as well as annotations telling ArgoCD which order they should be deployed in.

To begin, navigate to GitHub and fork this repository: https://github.com/WASdev/sample.daytrader7. Use your forked repository when configuring ArgoCD in the following steps.

In this example, we have a pre-built container image for DayTrader sample application pushed to Docker Hub that is used in the deployment files deploy/daytrader7-deploy.yaml. For more information on how to containerize your Open Liberty application check out our interactive guide: https://openliberty.io/guides/docker.html[Using Docker containers to develop microservices].

[#deploy_app_with_gitops]
== Deploying a Java application with GitOps and ArgoCD

Now that you have the Git repository forked and ready for deployment, it’s time to configure ArgoCD to deploy the application.

First, go to the ArgoCD console dashboard that we viewed before.

Next, click the New App button near the top left of the console. This opens a window where you will give ArgoCD the details on the application you want to deploy, which you can see an example of in the image below.

For our demo applicayion, we've called the Application name daytrader7. We've checked the Auto-Create Namespace box which creates the namespace if it doesn't already exist. We've left the ArgoCD project as "default" as this is a way to group Applications together for large scale deployment of applications, which is not needed in our case. And, we've set the Sync Policy to Manual. This configuration option determines whether we want ArgoCD to automatically correct configuration drift or wait for us to manually tell it to.
[.img_border_light]
image::/img/blog/configuration-drift-3.png[Creating the App,width=70%,align="center"]

Select the configiration options that best suit your application. For the purposes of just trying out and getting started with ArgoCD, feel free to copy the configuration we've set in our example app.

Next, you will need to scroll down to the configuration section labelled "Source", shown in the image below. Here, you will need to set several configuration options.

First, change the Repository URL to your newly forked repo. This tells ArgoCD what git repository has the configuration for the application you are looking to deploy.

You'll also need to change the path, which is the path in the git repo where ArgoCD is looking for deployment files to deploy.

Additionally, you'll need to set the Cluster URL. In this example, we have set it to https://kubernetes.default.svc, which is the local cluster URL.

Then, lastly, you will need to set the namespace. In our case, this is daytrader7 (which will be created because we selected the "Auto-Create Namespace" option).


After verifying these options, click Create in the top left. This creates an "Application" resource that ArgoCD uses to watch the repository we gave it.

[.img_border_light]
image::/img/blog/configuration-drift-4.png[Setting the Repo,width=70%,align="center"]

[#manually_sync]
=== Manually Syncing your Application with the Repository

Since we chose manual sync policy in the options for demonstrative purposes, we have to sync the application manually for ArgoCD to deploy the application. If you have also selected this option, on the main page of the ArgoCD console, you should see a new tile that looks like this:

[.img_border_light]
image::/img/blog/configuration-drift-5.png[Argo Dashboard,width=70%,align="center"]

Click the Sync button, then on the window that appears click Sync again.
To monitor the progress of this application sync, you can click on the daytrader7 tile.
Over the course of a few minutes, you should see resources being created and the app dashboard should look like this:
[.img_border_light]
image::/img/blog/configuration-drift-6.png[App deploying,width=70%,align="center"]

This diagram shows the many kubernetes resources created for the application, such as the deployment, pod, and service. We can also monitor the health of each of these resources and verify they were created properly.


Now that the application is deployed and all the resources are created we need to make sure it is exposed externally. This sample sets `.spec.expose` to `true`, which automatically creates an external route on OpenShift. If you are on Kubernetes, you need to either configure a load balancer or an Ingress controller for the application. Find the URL via `oc get routes –n daytrader7` if on OpenShift, or `kubectl get ingress -n daytrader7` if on Kubernetes with Ingress configured. Then paste the URL in a browser to access the Daytrader login page.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sample sets .spec.expose to true

Where?

I'd break the kube/RHOS commands out onto separate lines to make them clearer


And there we go! We have fully deployed our application with GitOps!
[.img_border_light]
image::/img/blog/configuration-drift-7.png[Daytrader Home,width=70%,align="center"]

[#gitops_solve_config_drift]
== See how GitOps can solve Configuration Drift

Now that we have the app deployed let's show a scenario where configuration drift occurs and how we can easily correct it.
Let's say a developer changes the memory settings in the configuration file for a quick test. To represent this, change the memory request for the `deploy/daytrader7-deploy.yaml` file from 1024Mi to 2048Mi using either the Kubernetes CLI or the console itself. In a few moments the argo console should show it is out of sync:
[.img_border_light]
image::/img/blog/configuration-drift-outofsync.png[Daytrader Home,width=70%,align="center"]

"Out of Sync" means that some form of configuration drift occured in the application. We can refer back to the diagram to tell exactly where it occured.
Since we set Auto-Sync to disable earlier in this blog, we have to manually tell ArgoCD to correct the configuration drift. To do this, click on the `Sync` button to return the configuration to match what git says it should be.

[.img_border_light]
image::/img/blog/configuration-drift-synced.png[Daytrader Home,width=70%,align="center"]

== Next Steps
In this blog post, we've explored the seamless deployment of an Open Liberty application through the GitOps methodology, highlighting its effectiveness in mitigating configuration drift. Whether you're seeking to refine your deployment strategy or embark on a fresh project for an Open Liberty application, we encourage experimenting with GitOps. This approach can be easily extended to automate the deployment of other dependencies like databases for your applications.

And for those looking to create or update Open Liberty applications, the https://openliberty.io/guides/[open liberty guides] offer helpful insights and steps.