ArgoCD Installation on Kubernetes : Step-by-Step Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome to today's video uh this picks up on the video that I released last week where we talked about Argo CD we went over the architecture some of the components uh some of the theory behind how continuous delivery through Argo CD works today we'll have a quick demo a quick Hands-On we'll install Argo CD we'll run some tests and then we'll cover some areas that we're going to dive into some more specific details in future videos but the intent of today's video is just to give you a quick look at the capabilities of Argo CD uh so with that uh being said I have created a gist for you to follow along I'll leave the gist in the video description below um and as always if there's any questions that you have please uh feel free to leave some uh questions in the comments and if you find this type of content valuable I encourage you to like the channel uh subscribe to the channel um it helps get the uh the word out so without further Ado let's get started so the prerequisites are that you have a kubernetes cluster up and running I do have a a single node cluster it's running ranches rke2 but any cluster should suffice so the first thing that we need to do is uh install Argo CD itself it's quite straightforward it involves two steps so the first step is we need to create the namespace and then we need to apply the manifests so if we copy this command here we can create the Argo CD namespace and then we can simply apply the manifests so this will go through it'll install all the required components so the deployment Network policy Services clusterable bindings bindings Etc and by default this will install into the Argo CD namespace so if we take a look at the com uh the pods that are running in the Argo CD namespace we should see what's been installed okay great so it looks like the pods have started coming up as we described in the previous video you see things like the repo server uh the actual Argo CD server itself the deck server and we'll dive into each of these components in a lot more detail in future videos uh so let's give this a couple more seconds uh we need the Argo CD server 2 to start up so if we take a look okay great so we can see that everything is now up and running so the next thing that we need to do is by default Argo CD deploys uh its server as a cluster IP service since this is just a quick demonstration we don't have an Ingress we're just going to go ahead and change the service type to note Port I've left a command here in the gist that will allow you to do that so if we copy this and apply this command and if we take a look at the services that are narrowing in the Argo CD namespace you'll see that this Argo CD server has now changed from cluster IP to type node Port so what this basically means is that we'll now be able to access the Argo CD server using the node Port that's been specified so in order to access the Argo CD server it'll be the IP address of the virtual machine with either one of these ports so if you would like to access it over HTTP we could hit 31 899 and for https it would be on Port 32041 so since this is just a quick demo we'll copy this port and then we'll enter that into the browser here so my virtual machines IP address is 244. and we can specify that port and this is quite normal since it is a uh an out of the box installation Argo CD deploys with a self-site certificate so we'll go ahead and accept this in future videos we'll deploy an Ingress we'll use something like let's encrypt with cert manager to get a certificate that we can map to a domain name that we specify so we can see that the Argo CD server is now available so the next thing that we need to do is we need to fetch the password by default Argo CD creates a secret by the name of Argo CD initial admin secret we need to fetch that and uh base64 decrypted I've left a command here again in the gist that makes it easy so if we copy this and we paste this this is the the password that is been assigned for the administrative user so let's copy this password and then we can sign in as user admin okay so now that we've signed in uh there's nothing that's been configured so the only thing that is set up out of the box is the local kubernetes cluster that Argo CD was deployed to is defined as the default cluster there are no applications uh there are no repositories been configured yet there's lots of different configurations that we can go through and set up in the future but for today's video there's only two things that we need to do so the first is we need to connect to a repository that hosts our deployment manifests I've created a a demo repo again I'll leave the link to this in the video description below it's a very simple deployment um it just starts up an engine X deployment and then we tie that together with a service so what we need to do is we need to copy the repo URL it's a public repo so we're not going to require any authentication and then we simply connect to a repo we're going to connect via https it's a git repo uh we're going to connect to the default project so Argo CD has the ability to group things into various projects uh for now we're just going to use the default project we're going to specify the repository URL and since it's public we don't need to specify any usernames or passwords so once we connect we can see that the connection is successfully established and the final thing we need to do is create an application so to create an application there's a variety of different methods for today's quick example we're just going to use the user interface interface to create that example so create an application we can give it a name so we can say demo and Gen X we're going to also deploy this into the default project name we're going to leave the sync policy to manual I want to show you uh how Argo CD can change the state to match what it is that you've defined in your manifests and in order to do that um you know we would need to enable the sync policy to be automatic but to test we're going to leave it with manual and then we'll go ahead and change that to automatic a little later on in the video then we need to specify the source repository URL this is the repo that we just added a few minutes ago we're just going to look at the head of the branch and the path is the location inside of the repository where the deployment manifests exists so if we go back to the repo we can see I've created a folder called quick start demo and inside quick start demo is where the deployment and the service yamls exist so we need to specify quick start demo as our path and then we need to tell it where to deploy this application so in this case we're just going to deploy it to the local kubernetes cluster and we're going to deploy it to the default namespace now if you have nested manifest you can enable things such as directory recurse but we're going to keep this very simple we have two deployment files they both exist within the top level directory of Quick Start demo so if we click create you'll see that the application gets created inside of Argo CD but it's out of sync so this means that we've now registered the application with Argo CD but it hasn't achieved the desired state if we go back and look at the cluster and we take a look at the pods in the default namespace we'll see that nothing has actually started yet in order for Argo CD to sync the desired State out of our GitHub repository we can manually sync so if we click on sync and we'll synchronize both Services here we'll see that it's going through its sync process it's pretty quick and now everything is healthy so if we click into that application we can take a look so we now see that there's a an nginx service the deployment um some replica sets uh and then finally the pod so if we go back and take a look at the actual kubernetes cluster now we can see that there's a single copy of the nginx Pod that has been started now I mentioned earlier that the whole purpose for Argo CD is to make sure that our deployed State always matches what we've defined through git Ops in this example we've deployed nginx using one replica set but we've got our policy right now set to manual so if we were to go if we were to go into the kubernetes cluster and scale up that nginx to something like three replicas let's see what happens so if we go back into the gist I've left a command here um that shows you how to scale up quickly so we're going to scale up to three replicas and then if we do a Cube CTL get pods we'll now see that there are three instances or rather three PODS of nginx that have been started and you can see that it's scaled up to additional pods just a few seconds ago so let's go back and see what's happening in the user interface so we can now see that the application has gone out of sync and the reason that it's gone out of sync is because it no longer matches what we defined in our GitHub repository so if we click on this we'll see that there's now three instances of nginx that are running and the reason that it's out of sync is if we click on this little yellow icon we can take a look at the desired sorry the the difference between the the Manifest so let's have a look at a compact diff so we can see that our desired state is to have one replica but the current state is three because we scaled it up manually and this is why it's out of sync so from here we can actually go ahead and just sync this one particular deployment or we can sync the entire application so let's go up top and just sync the entire application so if we hit sync we'll now see that two of those pods have disappeared that's because it's been scaled back down to one replica set and we can validate that by going back into the kubernetes cluster taking a look and we can indeed see that it has now scaled back down to one replica so that's a very high level of how Argo CD works again we didn't get too much into the details uh we covered the installation some quick examples of how Argo CB has the ability to maintain State between what has been specified declaratively in your GitHub repository and how you can enable sync and auto sync to keep those repositories um in that desired state so in future videos we'll dive into a lot more detailed examples for example out of the box Argo CD pulls every three minutes uh maybe we want to send a notification to our Argo CD instance as soon as a change has been made so we'll configure a web hook as I mentioned earlier we'll get into some Ingress configurations we'll use a certificate we'll set up some notifications so if there's any changes that happen uh to the state of our application maybe we want to set up a slack notification um and there's a lot of uh other features that Argo CD can enable so I'm going to wrap that video up uh rather this video up uh if you liked what you had to see Please Subscribe um like this video so you get notified when we dive into some of the more uh deeper sessions around our CD thank you very much
Info
Channel: Dinesh Mistry
Views: 10,460
Rating: undefined out of 5
Keywords: Kubernetes, ArgoCD, CD, GitOps
Id: fBd_tz6BALU
Channel Id: undefined
Length: 13min 28sec (808 seconds)
Published: Wed Nov 16 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.