 Hi, my name is Grisha Hernandez from the Cloud Platforms Business Unit over at Red Hat. In this video, I'm going to show you how to get started with Argo CD on OpenShift 4. Argo CD is a get-ops tool that can be used to sync your application deployments to one or many clusters. Argo CD can be used standalone or as part of your CI-CD pipeline. Let's get started. In order to get started, I need to log in to my OpenShift cluster. Here I'm logging in as QBatman as I need to be an administrator in order to install an operator. Note that I logged in to a cluster called go.ocp.redhatworkshops.io. In order to install the operator, we need a namespace in order to house all the components. Here I'm going to create a project called Argo CD. Once the project is created, I can go over the operator hub and search for Argo CD and click on Install. Note that I'm installing it in the previously created Argo CD namespace. The operator will go from pending to installing to succeeded. Once the operator is installed, we can use the operator to deploy an instance of Argo CD. My configuration has some customizations like deploying in the same namespace as the operator, creating a route, hooking it up to the OpenShift OAuth, and mapping my local admin to the Argo CD admin. Once I click Create, it will go into a pending state and it will start the install. Going over to my Git repo, I have a few manifests that I want Argo CD to sync into my cluster. First I have a deployment that will deploy an application that will draw a blue box for me. I also have a namespace configuration which will create a namespace for me. Next, a route specification that has the URL for this specific cluster, and then it's backing service. The service connects to my back-end application on port 8080. Also note that I am running on a branch called Video. Going over to Workloads and Pods, you can see now that all my pods are up and running, and once I verify that all my pods are running, I can go to Networking, Routes. And display my route. Once I click my route, I'll accept the self-sign certificate. Note that I have a login with OpenShift since I specified in that in my configuration. Once logged into Argo, I am ready to use the CLI in order to add a cluster. To use the CLI, I will have to log in. I log in by using Argo CD log in with the dash dash SSO option. In the dash dash SSO, I need to accept the self-sign certificate and copy the URL. Once I copy the URL, I can open up a browser and paste the URL in. Once I paste it in and see the green banner, I am authenticated. Switching back over to the CLI, I can now run Argo CD cluster add to see my clusters. I don't see any clusters because I need to log in with OpenShift from the CLI. So let's do that. Now when I run Argo CD cluster add, I can see my go cluster. Now I can run Argo CD cluster add in the name of the cluster. Once added, I can see it in Argo CD cluster list. So switch back over to the UI, I can now deploy an application. My application creates a namespace called BGD, which you note is not created yet in my cluster. So let's deploy it. When I click new app, I will give it a name of BGD and put it in the default project. This is in relation to Argo CD, not OpenShift. I will set a manual sync policy. For the repository URL, I need to give it the get URL and then specify the video branch. I'm running all my manifests inside a directory called BGD and I want to deploy it in the cluster we just added. The namespace BGD does not exist, but Argo CD will create it for me. Once I click create, my application is created and Argo CD will start to look for differences. Note that it says I'm out of sync and in fact, everything is missing. In order to get to my application to my cluster, I'll use Argo CD sync. Argo CD will then sync my upstream manifests to my cluster, in this case creating everything from scratch. It created the namespace, my deployment, which is running a pod, and the route. And indeed, my application is running with the blue box. This introduced a change and see how Argo CD handles it. I would tell my application that I want a green box now. Note that I'm making an infrastructure change, not a change to the application itself. Once this is patched, Argo CD right away recognizes that something is out of sync. My application is healthy but is out of sync. Moving over, indeed, I am running a green box and the change has been made. To remedy this, I will click sync and sync all. Once this is synced, I will wait for my rollout of my application deployment and once my application deployment is rolled out, I can see that everything is back to normal and I do have a blue box. So how does Argo CD add other configurations that it doesn't know about? Notice here that I have a prune option here for my sync. So let's see this in action. If I do an OC gets config map in my namespace, you'll see that I have no config map set. I have a configuration here that sets a sample config map and I will go ahead and create it in my namespace. It is not created in my BGD namespace. Argo CD sees that I'm out of sync. Now when I click sync and choose the prune option, Argo CD will not only sync to my upstream get repository but it will also delete any superfluous configurations found in the namespace. Argo CD can also be used to recover from catastrophic failure. For instance, if I accidentally delete my namespace of a production workload, I'm now in a terminating state on my namespace and if I go to Argo CD, you'll see that it's out of sync. In fact, my manifests are missing from my namespace. Once I click sync and using prune for good measure, you'll see that I can quickly recover from a catastrophic failure. My namespace is back along with my workload and my route is there as well. The only way to delete an application with Argo CD is deleting it within Argo. It goes into a deleting space and it makes sure everything is removed from my cluster. Now if I have multiple clusters, how do I deploy it from a single repo? For this, we'll use customize. In this directory, we have a base directory with all my base configurations. For instance, I have a deployment that will go to both clusters. I have a namespace that will go to both clusters. The service as well will go to both clusters and even the route but the route will change depending on which cluster I'm in so I'll leave the host field empty. Looking back to my overlays, you'll see that in my first cluster, I want to override whatever my deployment says and set it to blue and whatever my route says and set it to the proper route. In this case, it'll go from empty to the route. In my second cluster, I want to run green overriding that deployment and then in my route, having a route specific for that cluster. Note that all this is within the video branch. Going over to my second cluster, note that it's running cluster2.ocp.redhatworkshops.io. Switching now over to my CLI, I need to add this cluster and again, just like before, I don't see it in my list because I'm not logged in. Let's log in with the CLI. Once I logged in with the CLI, my cluster2, I can now see it in the list. So I do argocd clusteradd and indeed I am now seeing it in my configuration. So now running argocd clusteradd and specifying the cluster2 configuration, it'll add it to argocd. Once I do argocd cluster list, you'll see that now I'm controlling two clusters. Cluster2 and go. So creating a new application, I'll call this vgdk1 in the project namespace default, again within argocd, using the same geturl and the branch. This time I will do the path vgdk overlays cluster1 and I'll deploy it to the cluster go in the namespace vgd. Now creating another application, I'll specify vgdk2 and I will use the exact same repo and the exact same branch. But this time I'll choose the directory cluster2 and then the cluster cluster2 in the namespace vgd. Now I can sync the applications, syncing vgdk1 and then syncing vgdk2. In my first cluster, you'll see that vgdk1 is deployed with the route and the blue box. Once my second cluster is synced, I can go and see that it created the project, created the deployment, and created the custom route. I have a green box. I hope you enjoyed this video and invite you to try argocd in your GitOps workflow on OpenShift4. Thank you.