Introduction to Argo CD : Kubernetes DevOps CI/CD

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what is up people and welcome to another video now I've been meaning to make a couple of videos about kubernetes see I CD for DevOps tuning now I've been thinking to make a couple of videos and kind of split continuous integration and continuous deployment in two separate videos so in this video we're going to be taking a look at continuous deployment with Argos so it's a pretty exciting one pretty awesome project so let's dive right in [Music] so before we dive in you can follow along if you check the link in the description everything I'm about to show you is on github for our go so you can deploy it yourself there's also links in the description to the kubernetes development series that i've made which allows you to show you kind of how to deploy and get started with kubernetes on windows so for this video you're going to need a running kubernetes cluster and access to the cluster right so to start we have a kubernetes cluster keep city I'll get nodes you can see I'm all good ready to go I do get an S to show you my namespaces so this is an empty brand-new kubernetes cluster so if we go over to the our go getting started page they show you quite a neat guide on how to get started so the first thing we're going to want to do is install the continuous deployment controller of our go so we're gonna want to create a namespace so let's go ahead and do the adder around here we say keep CTL create namespace and all the agro resources will pretty much go in there now this is something I don't like doing I don't like applying random yam all from the internet to my environment I like to know what is being deployed so to do that I went ahead and I took this URL and I said go to and I took this llamo and I kept it in get so I have an Argo folder and Argo CD and I create this installed Akiyama so I copied this out and this allows me to kind of especially when you're working on multiple clusters for organizations and things like that for your work you don't want to be affected by things that change on the internet and you want to kind of have control over you know a new version of agro comes along and they've made a lot of changes you can just do it different Delta between this file and the new one and you can easily do upgrades and maintenance so this is going to apply a bunch of stuff to your cluster now the most important ones that I'm interested in are these two new custom resource definition one is a project and one is an application so basically the way argo works is you tell or go back out your application so it's a get up style F and so if I look at my app dot yeah mo I created this app example app and it basically defines how we want our application to be deployed so we give it a wrapper URL so I'm pointing to the same repository which you can have a look at and then also I tell it where all my kubernetes yeah more files parse it's under our go example app if we expand our go and we expand example app you can see I have config Maps deployment secret services and whatever yeah ma you want you can have a full structure and I also pass in this directory recurse to that towels are going to actually go through the entire example app folder recursively and apply all the Yambol so you can have a nice and set up structure there or you can just have one big yeah more file it's entirely up to you you then also have the ability to deploy to multiple clusters so in this case I am just telling Argo that I want to deploy to the same cluster where Argo is running in and I want to deploy to the example application namespace this allows you to create multiple namespaces per team and they can define where they want their applications to be deployed I also do a sync policy automated where I just tell an Argo can automatically roll out the stuff as we make changes so Argo will continuously look at this gift repo and look for changes in these Yama files and as soon as it's out of sync it will automatically sync it up so that being said let's go ahead and deploy it so we say keep CTL make sure you put it in the Argos CD namespace that you created and apply all that stuff so if I say cube ctrl - in Argos CD and I say git pods you can see it's creating all a bunch of stuff now the controller looks after all the app Gamble's that we pass it so this application Gamal is what it looks for and will automatically synchronize that with the Argos server the Argos servers pre self-explanatory it's a server it's an API server you can call it with API call so just HTTP calls or you can call it with the Argo CD CLI so a lot of automation you can do a round Argo because it provides you with the CLI and an API interface for this video I'm not going to do any of that I'm just going to show you very simple applying this camel directly using kubernetes so cube CTL meaning that I don't have to have knowledge about our go API and I don't have to protect the Argo API server I can run that server privately and I simply talk to kubernetes alright so now with our go up and running we can see all the pods are running now we need to find a way to access the archive server now if we take a look at the documentation we can expose it as a type of load balancer or we can also expose it as an ingress now I don't like any of those I like to keep my CI CD server as private as possible as secure as possible to prevent attackers from breaching that because that's kind of the heart of your system so what I like to do is just go with the port forwarding options so what we do is we're going to copy this here and we're gonna go jump into another terminal and paste that and that'll create a port forward proxy into the Argos server and then what we can do is go to localhost 8080 and you'll get access to the Argo dashboard so this is the RA UI so let's take a look at this you can either create an application from the UI but I prefer to do like get ops and infrastructures of code so I'll show you that in a second you can also do a bunch of other things that's really useful you can manage your git repositories so you can configure how to access private git repos you can also have certificates in order to access to git repositories and you can also add multiple clusters so this is really cool this allows you to deploy to multiple clusters if you have multiple development environments staging and production you can add it all in here so this is what I kind of like you can also structure all your applications as projects so every team has their own project that allows them to kind of manage to manage their things and silo so that is the UI though how you structure this is entirely up to you you can have Argo running inside your cluster that you want to deploy or you can have our go running with your CI so if you have a Jenkins server you can have our go running in that same environment and then it can deploy out to external clusters so that depends on how you want to structure your CI and CD and this demo we are going to be running an in cluster so I'm just going to interact with our go through the kubernetes api and i'm gonna instruct argo that I want my application deployed our go is gonna sit and watch for any apps that come in so it's gonna look for that a PMO so we go to our NGO and we look at the Argos CD I've got this example app so it's gonna be watching for the sky and then when this comes in it'll automatically evaluate this sync it with the Argos server and the server will do all the magic and roll out the application developer doesn't need to know any of the ins and outs about Argo all they have to do is have their application definition so they have to have the ml files as the infrastructure is code and then all that they need to do is say cube CTL apply and then they're gonna apply in the Argo namespace or go CD no space and they want to apply the Argo their application so they'll have this app gamal inside the github repo and when they apply that if we take a look over here notice that our goal automatically created the app it's starting to process and sync with that git repo if we expand that we get a nice overview of our kubernetes cluster and noticed here that our go has our application we can see our config map our secret our service has all been created in kubernetes automatically by our go it also rolled out a deployment as well as the replica sets with two pods now the cool thing is this provides you with an interface of I'm actually debugging your application as well so if this application is in a crash soup you can click it you can see all the events so you can see if the application is not being started up so if it is a crash loop or an image pullback off or any kind of thing that's per venting the container from starting up you'll see it here you'll also see the application log so it'll tell you kind of why there's a crash this is really cool and you can also see the manifest and you can see the manifests for all these things so if your configuration is msconfig you can go there and you can actually see the configuration values the cool thing is it kind of abstracts secrets so if you have a secret you can see it's taken that away so we can't view the value which is quite neat but yeah this gives you a very nice overview of the of the cluster and the deployment itself so you know how healthy your application is when it comes to your continuous deployments so what if I want to make a change in my app so if we go to our deployment gamal notice this is the application that the developer deployed in this instance let's say they made a change and the CI server has defined a new image we can join up that version number they'd say they have gone and they already they built it it's been pushed to the registry because remember this is CD not CI so CI is happening and let's push that change all the same version bump I'll go ahead and commit that and let's push that to the repo now what our NGO is doing is Argos constantly watching the repository that is defined inside the app so go back to the app Gamal it's looking at this repo and it's monitoring this path and it'll notice anything that goes out of sync so I'm just going to hit refresh here that will see that it'll detect there we go out of sync synchronization at sync back it started rolling out our app you can see it's processing our deployment it's killing off the old pods and bringing up the new pods so it's keeping an eye on kubernetes and getting all this detail back from the API server so we can see the deployment and the live view which is really really neat so if I click on this we can see this is our our new one has been rolled out and this one is the old one which is in a terminating state there's like a very nice overview of the kubernetes cluster as well as you know your continuous deployment side alright so that is our go CD in a nutshell now in future videos I'll also look at Argos CI so how do you plug in your building and your testing basically to this workflow and we'll take a look at other CI tools as well like Jenkins Jenkins X we'll take a look at spinnaker and what other CI CD tools there are for kubernetes but hope this was useful like and subscribe and let me know down in the comments what you guys would like to see in the future videos and until next time peace [Music]
Info
Channel: That DevOps Guy
Views: 45,808
Rating: 4.9453459 out of 5
Keywords: argo, argocd, kubernetes, devops, continuous, development, git, github, gitops, k8s, kube, deployment, release, cycle
Id: 2WSJF7d8dUg
Channel Id: undefined
Length: 12min 21sec (741 seconds)
Published: Sat Nov 02 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.