Complete CICD setup with Live Demo | #devops #jenkins| Write CICD with less code| @TrainWithShubham

Abhishek.Veeramalla
19 Oct 202223:24

Summary

TLDRIn this informative video, Abhishek demonstrates how to create a simplified CI/CD pipeline using Jenkins for continuous integration and Argo CD for continuous delivery. He emphasizes the ease of setup with minimal coding, showcasing a live demo of updating a to-do application and automating its deployment to a Kubernetes cluster. The tutorial is designed to be accessible, even for those new to CI/CD, and highlights the future of Jenkins pipelines with Kubernetes architecture.

Takeaways

  • 😀 The video is a tutorial on setting up a CI/CD pipeline using Jenkins for continuous integration and Argo CD for continuous delivery.
  • 🔧 The presenter, Abhishek, simplifies the process by minimizing the use of Groovy scripting and focusing on a streamlined approach to writing the pipeline.
  • 📝 The tools used in the tutorial are Argo CD for deployment on Kubernetes and Jenkins for building and pushing Docker images to a repository.
  • 🚀 The video emphasizes the future-proof nature of using Kubernetes architecture and GitOps tools like Argo CD for modern CI/CD practices.
  • 🔄 Abhishek demonstrates updating a to-do application, showcasing the pipeline's ability to reflect changes quickly with minimal manual intervention.
  • 💻 The tutorial includes a live demo of modifying the application's code, triggering the Jenkins pipeline, and deploying the update via Argo CD.
  • 🔑 The video explains the importance of using a Jenkinsfile in a GitHub repository for version control and traceability of changes.
  • 📖 The presenter provides a step-by-step guide on writing the Jenkinsfile and configuring Argo CD, suitable for viewers with little to no prior experience.
  • 🔍 Abhishek mentions the advantages of Argo CD, including its user-friendly UI for non-technical users and its ability to automatically sync and heal configurations.
  • 📚 The tutorial also covers best practices like separating code and artifact repositories for better management and security.
  • 🌟 The video concludes with an invitation for viewers to provide feedback and suggests further exploration of Argo CD through previous videos on the channel.

Q & A

  • What is the main focus of Abhishek's video?

    -The main focus of Abhishek's video is to explain how to write and execute a complete CI/CD pipeline using Jenkins for continuous integration and Argo CD for continuous delivery.

  • Why did Abhishek choose Argo CD for the demonstration?

    -Abhishek chose Argo CD because it is a tool based on the principles of GitOps, designed specifically for deployment on Kubernetes, and it requires minimal coding for configuration, making it user-friendly.

  • What is the advantage of using a separate repository for Kubernetes manifests in a CI/CD pipeline?

    -Using a separate repository for Kubernetes manifests helps in implementing good principles of GitOps, keeping the artifacts unique and more secure, and allows for better management of infrastructure configurations.

  • What does Abhishek suggest for triggering the Jenkins pipeline automatically?

    -Abhishek suggests using a webhook from GitHub to trigger the Jenkins pipeline automatically, but due to his firewall settings, he demonstrates manually triggering the build using the 'Build Now' button.

  • How does Abhishek demonstrate the end-to-end CI/CD pipeline?

    -Abhishek demonstrates the end-to-end CI/CD pipeline by making a live code change in a to-do application, committing the change, and showing how the Jenkins pipeline builds a new Docker image and updates the Kubernetes manifest, which Argo CD then deploys to the Kubernetes cluster.

  • What is the significance of the Jenkinsfile in a Jenkins pipeline?

    -The Jenkinsfile is significant as it contains the definition of the pipeline's stages and steps, and it allows for version control and tracking of changes, making it easier to manage and audit the pipeline configuration.

  • What is the purpose of the 'checkout' stage in a Jenkins pipeline?

    -The 'checkout' stage in a Jenkins pipeline is used to pull the latest changes from the source code repository, ensuring that the pipeline works with the most recent version of the code.

  • How does Argo CD handle the deployment of new changes in a Kubernetes cluster?

    -Argo CD continuously watches the specified GitHub repository for any changes in the Kubernetes manifests. When it detects a change, it automatically syncs the new configuration to the Kubernetes cluster, ensuring the deployment is up-to-date.

  • What is the role of the 'build Docker' stage in the Jenkins pipeline demonstrated by Abhishek?

    -The 'build Docker' stage in the Jenkins pipeline is responsible for creating a new Docker image for the application changes, tagging it with the build number, and pushing the image to a centralized Docker repository.

  • How does Abhishek propose to simplify the process of writing a Jenkins pipeline?

    -Abhishek proposes using the declarative pipeline syntax in Jenkins, which is simpler and more standardized, and provides a pipeline syntax generator that can create the necessary script based on user input, reducing the need for extensive knowledge of Groovy scripting.

  • What are the benefits of using declarative pipelines in Jenkins according to Abhishek?

    -Declarative pipelines in Jenkins offer a standard structure that is easy to understand and maintain, allows for easy searching of examples and solutions online, and promotes a consistent pipeline structure across an organization.

  • What is the main difference between declarative and scripted pipelines in Jenkins?

    -The main difference is that declarative pipelines provide a standardized and simpler structure, while scripted pipelines offer more flexibility and customization at the cost of being more complex and harder to maintain.

  • What does Abhishek recommend for those who are new to Argo CD?

    -Abhishek recommends filling out the Argo CD form to set up the tool, which simplifies the process and requires minimal prior experience with Argo CD.

  • How can viewers access and use the to-do application demonstrated in the video?

    -Viewers can access and use the to-do application through the provided GitHub URL, where they can also follow Abhishek's GitHub account for updates and use the application for their own demo or practice purposes.

  • What is the purpose of the 'update kubernetes manifest' stage in the Jenkins pipeline?

    -The purpose of this stage is to update the Kubernetes deployment manifest in the separate artifact repository with the new Docker image tag after the image has been built and pushed to Docker Hub.

  • What does Abhishek plan to do to help viewers who might have missed some details in the video?

    -Abhishek plans to update the README.md file with the details of the CI/CD end-to-end process explained in the video, so viewers can refer to it for a step-by-step guide.

Outlines

00:00

🎥 Introduction to CI/CD with Jenkins and Argo CD

Abhishek introduces a tutorial on creating a CI/CD pipeline, responding to audience interest and a poll result. The video aims to simplify the process using Jenkins for continuous integration and Argo CD for continuous delivery. It emphasizes the use of declarative Groovy scripting in Jenkins and the user-friendly interface of Argo CD, which requires minimal coding. The tutorial will demonstrate the robustness of this pipeline, particularly in the context of Kubernetes architecture, and will compare Argo CD to other GitOps tools in future videos.

05:01

🛠️ Setting Up the CI/CD Pipeline with Argo CD and Jenkins

This section provides a step-by-step demonstration of modifying a to-do application, which is already deployed on a Kubernetes cluster using Minikube. The process involves making a change to the application's header, committing it, and triggering the Jenkins pipeline to build a new Docker image. The video explains the simplicity of Argo CD's setup and its ability to deploy updates to the Kubernetes cluster without manual intervention. It also discusses the importance of separating the code repository from the artifact repository for better security and management practices.

10:01

🔧 Technical Details of Jenkins Pipeline and Argo CD Configuration

The paragraph delves into the technical aspects of writing a Jenkins file for the CI/CD pipeline. It explains the stages of the Jenkins pipeline, starting with the checkout stage, followed by building the Docker image, and pushing it to a repository. The video also covers the process of updating the Kubernetes manifest repository and how Argo CD watches this repository for changes, automatically deploying updates to the Kubernetes cluster. The speaker provides a practical example of updating an image tag in the deployment manifest and how Argo CD reflects this change in the cluster.

15:03

🚀 Executing the CI/CD Pipeline and Observing the Results

The speaker demonstrates the execution of the CI/CD pipeline by making a live code change to the to-do application and observing the automated deployment process. The video shows the speed and efficiency of the pipeline, which takes less than a minute to execute. It also reassures viewers that even without prior knowledge of CI/CD pipelines, Jenkins, or Argo CD, they can set up their own pipeline following the steps explained in the video.

20:05

📝 Conclusion and Further Assistance on CI/CD Pipelines

In conclusion, the video provides a summary of the steps taken to set up the CI/CD pipeline using Jenkins and Argo CD. It invites viewers to subscribe to the channel, like the video, and comment with their experiences or suggestions for improvement. The speaker offers to create additional content or live sessions to address any questions or difficulties viewers might have in setting up their CI/CD pipelines. The video ends with an invitation for further interaction and support in learning CI/CD.

Mindmap

Keywords

💡CI/CD Pipeline

A CI/CD (Continuous Integration/Continuous Deployment) pipeline is a software development practice where code changes are automatically built, tested, and prepared for a release. In the video, the presenter discusses how to write and execute an end-to-end CI/CD pipeline using Jenkins for continuous integration and Argo CD for continuous delivery, emphasizing the simplification of the process with minimal code.

💡Jenkins

Jenkins is an open-source automation server that facilitates the parts of software development related to building, testing, and deploying applications. In the script, Jenkins is used for the continuous integration part of the CI/CD pipeline, where it builds a new Docker image and updates the Kubernetes manifest repository with the new image tag after code changes are committed.

💡Argo CD

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. It automatically deploys applications to a Kubernetes cluster whenever there is a change in the application's code repository. The video highlights Argo CD's ability to manage deployment without writing any code, just by watching a Git repository for changes and syncing them to the Kubernetes cluster.

💡Kubernetes

Kubernetes is an open-source container orchestration system for automating application deployment, scaling, and management. The video discusses deploying applications onto a Kubernetes cluster using Argo CD, which takes care of the continuous delivery aspect of the CI/CD pipeline by syncing Kubernetes manifests from a Git repository.

💡GitOps

GitOps is a set of practices and tools that use Git to manage and operate cloud-native applications. The video mentions Argo CD as a tool based on the principles of GitOps, which uses Git repositories to determine the desired state of the system and automatically deploys changes to the Kubernetes cluster.

💡Docker

Docker is a platform that uses containerization to simplify the deployment of applications. In the context of the video, Docker is used to create images of the application after changes are made, which are then pushed to a Docker registry and deployed via the CI/CD pipeline.

💡Declarative Groovy Scripting

Declarative Groovy scripting is a way of writing Jenkins pipelines that focuses on what the pipeline should accomplish, rather than how to accomplish it. The video script mentions using a declarative pipeline with minimal lines of code to define the steps for building and deploying the application.

💡GitHub

GitHub is a web-based hosting service for version control using Git. It is where the video's presenter stores the application's code and Kubernetes manifests. GitHub is also the source that Argo CD uses to watch for changes and trigger deployments to the Kubernetes cluster.

💡Manifest Repository

A manifest repository in the context of the video refers to a separate repository that holds the Kubernetes deployment manifests, such as 'deploy.yaml' and 'service.yaml'. This is a best practice to keep the application code and deployment configurations separate, allowing Argo CD to watch and update the Kubernetes cluster configuration as needed.

💡Git Repository

A Git repository is the storage location for a project's files using the Git version control system. The video script discusses using a public GitHub repository for the to-do application code and another for the Kubernetes manifests, which are both integral parts of the CI/CD pipeline process.

💡End-to-End

End-to-end, in the context of the video, refers to the complete process from making a code change to deploying it to a live environment. The presenter demonstrates an end-to-end CI/CD pipeline, showing every step from code commit to application update on the Kubernetes cluster.

Highlights

Introduction to creating a complete CI/CD pipeline with simplified code using Jenkins and Argo CD.

Explanation of using declarative Groovy scripting for Jenkins pipeline with minimal lines of code.

Introduction to Argo CD for continuous delivery in Kubernetes architecture.

Comparison of Argo CD with other GitOps tools like Flux, with a promise of future detailed comparison.

Demonstration of non-technical configuration through Argo CD's user interface.

Quick installation of Argo CD with just two lines of script.

End-to-end demonstration of modifying a to-do application and deploying it using CI/CD pipeline.

Use of minikube as a Kubernetes cluster for the demonstration.

Explanation of the Jenkins pipeline stages including checkout, build, and push artifacts.

Use of separate repositories for code and Kubernetes manifests for better practice.

Live update of the to-do application showcasing the CI/CD pipeline's efficiency.

Description of the Jenkins file and its role in automating the CI process.

Guidance on writing a Jenkins file for a declarative pipeline.

Discussion on the advantages of using declarative pipelines over scripted pipelines.

How Argo CD watches a Kubernetes manifest repository and updates deployments automatically.

Step-by-step guide on setting up Jenkins and Argo CD for CI/CD pipeline.

Invitation for viewers to suggest topics for future videos and offer help for any setup or configuration issues.

Encouragement for viewers to subscribe, like, and comment on the video for further interaction and support.

Transcripts

play00:01

hello everyone my name is Abhishek and

play00:04

welcome back to my channel

play00:05

so a lot of you have been asking me

play00:07

about a complete CI CD pipeline how to

play00:09

write it how to execute it and even I

play00:12

posted a poll last week I guess asking

play00:15

what should be my next video on the

play00:17

channel and uh you know cicd1 hands down

play00:20

even on that poll so I am here today to

play00:23

explain you how to write an end to ncicd

play00:25

Pipeline and unlike the other videos

play00:27

there are a lot of videos on the YouTube

play00:29

but you know this will be very very

play00:31

simplified uh you will be able to write

play00:34

with very little lines of code uh will

play00:37

not use a lot of groovy scripting uh I

play00:39

mean to write Jenkins pipeline we are

play00:41

using a declarative groovy scripting but

play00:43

I'll show you how to write this one with

play00:45

a very little lines of code and the

play00:48

tools that we are using today is Argo CD

play00:50

so this is Argo CD we are using it for

play00:52

continuous delivery and this is Jenkins

play00:55

that I am using for continuous

play00:56

integration that's it so we'll just use

play00:58

two tools and we will see how robust

play01:01

this cacd pipeline is and trust me this

play01:04

will be the future of your Jenkins

play01:06

pipelines because

play01:08

you know end of the day everybody is

play01:10

moving to the kubernetes architecture

play01:12

and the tools like Argo CD they are

play01:14

github's based tool which are

play01:15

specifically designed for deployment on

play01:18

kubernetes so there are alternatives

play01:20

like either you can go for Argo CD you

play01:22

can go for flux but I'm not going into

play01:23

the comparison today we'll look into

play01:25

Argo CD which is better according to me

play01:27

which may be in the future videos I'll

play01:29

explain you why arcosity is better than

play01:30

the other gitops tools but yeah going

play01:33

back today we'll use Jenkins for

play01:35

continuous integration and Argo CD for

play01:38

continuous delivery and one advantage

play01:40

with Argo CD is you don't have to write

play01:42

even a single line of code so let's say

play01:44

you're using ansible let's say you're

play01:46

using any other configuration management

play01:47

tools so in such cases you at least have

play01:50

to write your ansible place or your

play01:51

ansible yaml files but Argo CD if you

play01:54

are a non-technical guy you can

play01:55

configure everything through the UI and

play01:58

installation is just two lines of code I

play02:00

mean not code just two lines of script

play02:02

which you can copy from the internet and

play02:04

you can install Argo CD which I mean you

play02:07

can get it up and running in like less

play02:10

than a minute so today I'm showing you

play02:12

the end to end part of it we'll make a

play02:15

change to the uh I mean we'll use the

play02:17

same to do application which we were

play02:18

using in the previous videos we also did

play02:20

the same to-do application on train with

play02:21

shubham channel so I'll continue the

play02:23

same thing uh firstly I'll show that the

play02:26

2-do application is up and running right

play02:28

so I hope you're able to see my terminal

play02:31

so we are using minicube as a kubernetes

play02:33

cluster the same one that we were doing

play02:34

in the last video as well so let me just

play02:38

uh show you that if I do mini Cube

play02:40

service

play02:41

okay instead let me start from the

play02:43

beginning uh I have deployed this

play02:45

application now the application is

play02:47

already deployed and our end goal today

play02:49

is to make change to the application and

play02:52

the application is deployed so firstly

play02:53

I'll show you the application okay so

play02:56

Cube CTL get SVC so my application is

play03:01

deployed as a kubernetes deployment and

play03:02

this is the service that I have now to

play03:05

get this service running either I can

play03:07

use Ingress or you know I can also

play03:08

create a tunnel so what I'll do is

play03:10

minicube service

play03:12

to do service is the name of the service

play03:15

right which we are trying to do there

play03:17

are other services which you can ignore

play03:20

okay when I do this mini Cube will

play03:22

generate an uh URL to me so mini Cube it

play03:27

will generate a URL for me which I can

play03:29

use to access this service from my

play03:32

browser or any other place right you can

play03:35

use any other uh

play03:38

okay so this is the URL that I have

play03:41

perfect this is a to-do service URL now

play03:43

let me go back to the same browser that

play03:46

we are using

play03:49

and let's see how this application looks

play03:52

initially okay so I can simply say

play03:55

this and this is my to-do application

play03:58

that we are already using from the

play04:00

previous videos now what I'll do is I

play04:02

will slightly modify the header it will

play04:04

make a very simple change okay so

play04:06

instead of to-do list modify once again

play04:08

what we'll say is to do list Abhishek

play04:10

okay so this is my to-do list so

play04:14

okay so firstly let me show how I placed

play04:18

my applications okay so this is my

play04:20

end-to-end application this is a public

play04:22

GitHub repository even you can use this

play04:24

application and so this is my GitHub

play04:27

account uh I am virumala so you can

play04:29

simply use this uh URL you can access

play04:32

this application you can you know follow

play04:34

me on GitHub so that you can frequently

play04:37

see what are the reports that I am

play04:39

posting I'm you know everything that I

play04:41

do on my YouTube uh typically I use

play04:43

GitHub for storing the artifacts so you

play04:45

can

play04:46

follow me on GitHub

play04:48

okay so without any delay this is my

play04:50

to-do application uh and uh so I'll make

play04:54

a simple change to the studio

play04:55

application and we'll see how this is

play04:57

deployed and then we'll go to the

play04:59

technical details right how did I write

play05:01

a Jenkins file how did I use this uh

play05:03

Argo CD I'll show you but firstly let's

play05:05

start with the demo okay so that you

play05:07

guys have an end-to-end understanding of

play05:09

what is happening after we have the demo

play05:11

we'll go and debug how did I write the

play05:13

Jenkins file how did I install Argo CD

play05:16

how did I configure it which will not

play05:18

take much time even if you have zero

play05:21

knowledge on the end-to-end cicd

play05:23

pipelines don't worry with this video

play05:25

you can understand uh everything you can

play05:27

use the same GitHub repository for your

play05:28

demo purposes for your practice and you

play05:31

can deploy your applications with CI CD

play05:35

so firstly uh what I'll do is I'll try

play05:38

to modify this one to-do list modified

play05:40

once again I'll change this to

play05:45

okay so let me change this to turo

play05:48

application Abhishek so for that I need

play05:50

to open the index.html file so this is

play05:53

since we are already using this python

play05:55

application I know which file has which

play05:57

changes uh if you are not aware of it

play05:59

you can simply browse through the code

play06:00

or you can use your hello world

play06:01

application but some of my viewers

play06:04

already know about the studio

play06:05

application and so this is the piece of

play06:08

line that we are trying to change if you

play06:09

see here to do list modified once again

play06:11

I'll change this to to-do list

play06:14

Abhishek

play06:16

okay now I'll commit this changes okay

play06:18

so as soon as I commit these changes my

play06:21

Jenkins pipeline will get triggered and

play06:23

it will uh build a new image and then

play06:27

using Argo CD Argo CD will deploy the

play06:30

new image onto the kubernetes cluster

play06:31

there is zero manual intervention but

play06:33

unfortunately I cannot uh trigger a web

play06:36

Hook from my GitHub to Jenkins because

play06:38

of the firewall settings that I have and

play06:40

the workstation rules that I have okay

play06:42

so uh it's very easy I'll show you that

play06:45

process as well once you make a change

play06:47

you can automatically trigger your

play06:49

Jenkins pipeline but for now we will

play06:50

simply click on the build now the

play06:52

configuration is not difficult but I

play06:54

have some firewall settings which I

play06:56

cannot modify so because of which

play06:58

I'll use the build Now button so as soon

play07:02

as I use the build Now button now what

play07:04

happens is that a new Jenkins pipeline

play07:06

will be triggered as you see here and

play07:08

this new Jenkins pipeline what it will

play07:11

do is it will pull the Jenkins file from

play07:13

the same Jenkins from the same GitHub

play07:15

repository so what I have done is within

play07:18

this repository I have placed the

play07:19

Jenkins file so this Jenkins file is

play07:22

written in grooving let me increase the

play07:23

font okay and this is a very simple

play07:26

Jenkins file okay so this is the syntax

play07:28

of your Jenkins pipeline if you are

play07:29

writing a declarative pipeline you start

play07:31

with a pipeline then if you want to

play07:33

Define any agent for your pipeline you

play07:35

can Define agent is nothing but in which

play07:37

on which Jenkins node you want to

play07:39

execute this pipeline if you want to use

play07:40

kubernetes or if you want to run it as a

play07:42

container you can also Define your

play07:44

kubernetes configuration or your pod

play07:45

configuration here but I am simply using

play07:47

a Jenkins agent okay so agent I mean I'm

play07:50

simply using a Linux node and this is

play07:53

Agent NE it can run on any agent so the

play07:56

different stages in my Jenkins pipeline

play07:58

so the first stage is checkout which

play08:00

will check out the art artifacts so

play08:02

while I am explaining you this the

play08:04

pipeline is running in the background so

play08:06

let it run meanwhile we will see the

play08:07

configuration of the Jenkins file so

play08:09

initial stage is checkout what will

play08:11

checkout do checkout will take the

play08:13

latest changes now I made a change to my

play08:15

GitHub repository right so Jenkins will

play08:17

pull the latest change using this bit

play08:19

this specific stage so this

play08:22

configuration let's say you are not

play08:23

aware how to write it it's very simple

play08:25

uh what you can do is that if you are

play08:28

very new to groovy scripting or Jenkins

play08:30

don't worry Jenkins has something called

play08:32

as pipeline syntax so come here and

play08:35

let's say you want to write this same

play08:36

thing that I have written here okay so

play08:38

what you can do is that if you are not

play08:40

aware on how to write this

play08:43

come here

play08:45

click on git okay there are different uh

play08:48

so pipeline syntax generator what it

play08:51

will do is it will generate a Syntax for

play08:52

you and depending upon what command that

play08:54

that you want to execute let's say I

play08:56

want to use uh https

play08:59

um github.com this is my let's say let's

play09:02

assume this is my GitHub repository okay

play09:05

I don't have this repository but I'm

play09:07

just giving it as a example and let's

play09:09

say my Brand's name is Main

play09:13

okay if you have any credentials that

play09:16

you want to access you can pass in your

play09:17

credentials so let's say I have

play09:19

credentials uh that are already stored

play09:21

in my Jenkins now simply click on this

play09:23

pipeline uh syntax script and this is

play09:25

the same thing that you can copy in here

play09:28

okay so it's very simple uh if you don't

play09:31

know and when you're using declarative

play09:33

pipelines in Jenkins uh there are two

play09:35

different pipelines that you can use

play09:36

either declarative or scripting so

play09:38

mostly go for declarative pipelines

play09:40

because declarative pipelines are a

play09:42

standard pipelines and even if you have

play09:43

any issues you can Google and you can

play09:46

find examples anything and you can also

play09:49

set up a common uh you know structure

play09:51

across your organization but if you're

play09:53

going for a scripted pipelines it

play09:56

depends upon the developer to developer

play09:57

so I can write it differently and you

play10:00

can write it differently to keep the

play10:01

structure unique uh and to create to

play10:04

keep the structure very formatted you

play10:05

can use a declarative pipelines uh so

play10:08

scripture pipelines also have some

play10:09

advantages where you know if you you

play10:11

have a flexibility of writing uh more

play10:13

and more code or you have flexibility of

play10:15

uh solving things that are not possible

play10:17

with your declarative pipeline plugins

play10:19

but okay in our example uh we are doing

play10:22

a very basic one so I use the uh

play10:25

declarative pipeline declarative

play10:27

Pipeline and the next stage is build

play10:29

Docker uh that is very simple I'm simply

play10:32

building using the build number of my

play10:34

Jenkins pipeline uh and then I'm using

play10:36

the push artifacts with which I am

play10:38

pushing the artifacts to a centralized

play10:40

repository which is docker

play10:43

and if you see here the commands are

play10:44

very very simple after this what I am

play10:47

doing is I stored my kubernetes manifest

play10:49

in a different repository okay so this

play10:51

is my code repository and this is so

play10:54

cicd end to end right so this is my code

play10:57

repository and this is my artifact

play11:00

repository where I have my deploy.yaml

play11:02

and service.ml why I have to do it I can

play11:04

keep it in the same folder as well but

play11:06

uh there is a reason uh you know it is

play11:09

always a good practice to have your

play11:10

artifacts that is your kubernetes

play11:12

artifacts in a different repository so

play11:14

that you can implement the principles of

play11:16

githubs I'm not saying you cannot do it

play11:18

with the same repository but to keep it

play11:21

unique to keep it more safe to uh to

play11:24

adopt good principles of githubs you

play11:26

should always keep them in a different

play11:27

repository so that you know whether you

play11:29

are managing configuration of your

play11:31

infrastructure like kubernetes or

play11:33

whether you are managing configuration

play11:34

of your hundreds of applications so you

play11:36

can simply use a different repository

play11:38

and you can ask your Argo CD to watch

play11:41

for this repository for anything in this

play11:43

okay

play11:45

perfect so now uh let's go back to the

play11:48

pipeline where is this

play11:51

Jenkins file yeah so what I'm doing is I

play11:54

am checking out my uh kubernetes

play11:57

manifest repository and I am simply

play11:59

updating the kubernetes Manifest

play12:01

repository okay so what I'm doing is I

play12:04

am updating the so let's say this is my

play12:06

deploy.dml okay so my deploy.yaml uh

play12:10

okay let's go back I'll show you the

play12:13

change that is submitted by Jenkins so

play12:15

that you will understand what is the

play12:16

change so if you see here there is a

play12:18

change that is that has happened four

play12:19

minutes ago okay this four minutes ago

play12:21

is the same change that we did so what I

play12:24

have done is I have updated my uh

play12:27

the kubernetes Manifest Report with the

play12:30

new tag okay so if you look at the

play12:32

change that I have submitted

play12:34

okay so what is the change my Jenkins

play12:36

pipeline has submitted it has simply

play12:38

updated the image ID from 32 to 33. so

play12:42

where okay so what is this image ID 33

play12:44

so if you look at my Jenkins uh build

play12:47

that that has happened okay

play12:49

so this is the new image that Jenkins

play12:51

has built right so Docker push Abhishek

play12:53

fi CI CD end to end 33 so this image is

play12:58

pushed to my Docker Hub as well as

play13:00

Jenkins has updated the GitHub

play13:02

repository with the new image stack now

play13:04

once this is updated Argo CD which is

play13:07

watching continuously this repository

play13:09

what it has done is if you see here it

play13:12

has synced the configuration a couple of

play13:14

minutes ago

play13:16

okay and if you watch the uh where is

play13:20

this sorry if you watch the application

play13:22

okay so it is updated with the new image

play13:25

so now if I go back okay let's go back

play13:28

and if you see Cube CTL

play13:31

get deployed

play13:34

and let's try to look at the

play13:37

Cube CTL edit deploy okay

play13:41

and let's use the to-do application

play13:44

to understand what is the image is the

play13:46

image updated by Argo CD or not

play13:50

the responsibility of Argo CD is

play13:52

continuous delivery and it has to update

play13:54

the image tag right so it has updated

play13:56

the image stack to 33. okay so let me

play13:59

repeat one more time what did we do is

play14:03

okay so we use the Jenkins file

play14:08

to initially look at the source code

play14:11

repository which has my to do

play14:13

application code and then

play14:15

the change that we have submitted right

play14:17

we have made a simple HTML change

play14:18

calling it to do application Abhishek

play14:21

okay so my Jenkins file will build a new

play14:24

Docker image for this change that we

play14:25

have made it will deploy the I mean it

play14:28

will push the docker image to Docker Hub

play14:31

and it will also check out and update my

play14:34

repository which has the kubernetes

play14:36

deployment manifest right so this

play14:38

kubernetes deployment manifest has

play14:40

nothing but my uh yaml files or my

play14:43

deployment files to deploy the to-do

play14:45

application onto the kubernetes cluster

play14:47

so once the new Docker image is created

play14:50

the new Docker image is updated back to

play14:52

my kubernetes

play14:54

sorry my GitHub repository which has the

play14:56

deployment manifest okay now let's call

play15:00

this back and see what has happened so

play15:02

it's a to-do list Abhishek okay isn't it

play15:05

very simple

play15:06

how much time did it take for the entire

play15:09

pipeline it hardly takes 30 seconds or

play15:12

less than a minute for the entire

play15:13

pipeline to be executed and even if you

play15:16

want to write the same pipeline it will

play15:17

not take more than 10 minutes right you

play15:19

don't have development skills you don't

play15:21

have uh configuration I mean knowledge

play15:23

of writing groovy pipelines or you don't

play15:26

have prior experience with Argo CD don't

play15:28

worry I'll show you everything it will

play15:30

not take more than 10 minutes okay

play15:33

so now we are good with the demo right

play15:34

so to do list is updated to to-do list

play15:37

Abhishek okay now let's see what I have

play15:40

done step by step and in case you don't

play15:43

understand anything comment uh make a

play15:45

comment uh and I'll try to look into the

play15:48

comments and if I feel that there is

play15:49

something that I have not covered in the

play15:51

video I'll definitely uh make a new

play15:53

video or we can go live and I can show

play15:55

you step by step again one more time

play15:56

okay so and uh let's take a pause here

play15:59

and if any one of you have not

play16:01

subscribed to my video uh my Channel

play16:03

please please please please take a

play16:05

minute to subscribe to my channel and

play16:07

like this video and also comment on the

play16:09

video to

play16:11

tell me like you know if you want to

play16:13

share your uh experience watching this

play16:15

video or if you like this or if you

play16:17

don't like this you feel that I can

play16:19

improve in explaining your specific

play16:21

thing uh don't hesitate please uh

play16:24

comment on this video so that I can

play16:25

improve in the next videos

play16:29

okay so firstly what we need to do okay

play16:31

to write this entire cicd pipeline first

play16:34

step is that

play16:35

go to your GitHub repository let's say

play16:37

that your development team has this

play16:39

GitHub repository called cicd end-to-end

play16:41

it can be any application it can be

play16:43

Amazon it can be Flipkart anything so in

play16:45

the root of your uh repository what you

play16:48

need to do is you need to write a file

play16:50

called as Jenkins file okay so what is

play16:53

the significance of this Jenkins file

play16:55

it's nothing but

play16:56

when you create a Jenkins pipeline or

play16:59

when you create a job in Jenkins what

play17:01

does Jenkins job will do is that so I'll

play17:03

show you how to even create that okay it

play17:05

does not take much time so come to your

play17:07

Jenkins okay firstly you need to write a

play17:09

Jenkins file and then come to Jenkins

play17:11

and inside Jenkins you can select this

play17:14

pipeline uh type of your Jenkins job or

play17:17

depending upon your requirements the

play17:18

other things which I'm not going into

play17:19

the details and let's call me test okay

play17:23

once you create this pipeline okay if

play17:26

you come here there are two options one

play17:28

is you can write your pipeline script

play17:30

here or the other way is you can use the

play17:32

pipeline script from the sem SCM is

play17:34

source code repository so when you use

play17:36

this it will ask you for your SCM path

play17:38

when I say Git it will ask me for the

play17:40

git URL and when I provide this URL it

play17:42

will simply use the

play17:44

foreign

play17:46

file from your

play17:48

GitHub repository and you don't have to

play17:50

write anything in your Jenkins file

play17:52

sorry you don't have to write anything

play17:54

in your

play17:55

Jenkins job what is the advantage that

play17:58

you get with it so the thing is if you

play18:00

are writing somethings here okay let's

play18:02

say your colleague wants to modify

play18:03

something in your Jenkins file and you

play18:04

wrote everything in uh your you have not

play18:06

used pipeline script from ACM and you

play18:08

have simply used the pipeline script so

play18:10

he you wrote something like this and he

play18:11

updated now you don't have a track of

play18:13

the things right you don't have auditing

play18:15

or you don't have version controlling

play18:16

whereas if you are using the Jenkins

play18:18

file in your GitHub repository or in

play18:21

your bitbucket or gitlab you have a

play18:23

track of things so let's say I have

play18:24

modified something you can go back and

play18:26

see why is my Jenkins Jenkins file

play18:28

working yesterday I'm not working today

play18:29

so that's why it's always preferable to

play18:31

put your Jenkins file in a GitHub

play18:32

repository

play18:34

now once you do this that's all you can

play18:37

simply come here and you can execute

play18:38

your Jenkins file so you can take a

play18:40

reference of this Jenkins file I'll put

play18:42

this uh like I told you this GitHub

play18:44

repository is public you can use this

play18:46

GitHub repository to create multiple

play18:48

copies you want to try out some pocs you

play18:50

want to do anything you can feel free to

play18:52

uh Fork this repository clone this

play18:54

repository do any changes that you want

play18:56

okay I mean you can keep create a copy

play18:58

of it and you can make any changes that

play19:00

you want no fine once I write this

play19:02

Jenkins file the thing is this Jenkins

play19:04

file will update my deployment your

play19:07

diploma.yaml so now you will ask me okay

play19:10

this is all updated but how will this

play19:12

actually get deployed onto my kubernetes

play19:14

cluster so the magic happens with Argo

play19:16

CD so if you are new to Argo CD Argo CD

play19:19

is a tool that is based on the

play19:21

principles of githubs what it will do is

play19:23

that whatever you put in your GitHub

play19:25

repository okay so you can put your Helm

play19:27

charts you can put customize or you can

play19:29

put a plain kubernetes manifest files

play19:31

like I did okay so whatever you put in

play19:33

your GitHub repository will take those

play19:36

manifests and deploy onto your

play19:37

kubernetes cluster that's it okay there

play19:40

are other advantages of Argo CD that it

play19:42

can Auto heal your configuration so

play19:43

let's say Somebody went to your

play19:44

kubernetes cluster they modified the

play19:47

deployment.yaml so Arbor City will say

play19:49

no no git in git there is some

play19:51

configuration and you are trying to

play19:53

override this configuration so I will

play19:54

not allow things

play19:56

but uh for this video it is out of

play19:58

context for this video you can simply

play20:00

remember that Argo CD is a tool that

play20:02

will take manifest our artifacts from

play20:04

your git repository whether it's Helm

play20:06

charts whether it's customized whether

play20:07

it's claim kubernetes manifest and

play20:10

deploys these things onto your

play20:11

kubernetes cluster so remember just that

play20:13

thing

play20:14

now uh you can ask me that I don't have

play20:16

experience with Argo CD how do I do this

play20:18

it's very simple just fill this form and

play20:21

everything is done so application name

play20:23

you can give anything randomly your wish

play20:25

you can call it test project name stick

play20:27

to default okay and then here is the

play20:30

configuration so do you want to do this

play20:32

automatically or do you want to come to

play20:34

your Argo CD console and click on a

play20:37

button so I want to have I want

play20:39

everything to happen automatically so I

play20:40

say automatic and do you want to Auto

play20:42

heal Auto heal is something that I just

play20:43

explained if you want Select Auto heal

play20:45

if you don't want if you just want Argo

play20:47

CD to use as a deployment tool right you

play20:49

know just you just want Argo CD to pull

play20:51

the changes from GitHub and Deploy on to

play20:53

kubernetes you can stick with this

play20:54

configuration and here you can provide

play20:56

your GitHub repository and here you can

play20:58

provide the path and you can provide

play21:01

your kubernetes cluster URL and the

play21:03

namespace where you want to deploy

play21:04

that's it

play21:05

Argo CD will pick all the changes and it

play21:08

will deploy so in future if you make any

play21:10

new changes you don't have to bother

play21:12

about updating this GitHub repository at

play21:14

all so this GitHub repository which

play21:16

holds the kubernetes Manifest is managed

play21:19

by Jenkins and Argo CD will watch for

play21:22

these files and deploy onto kubernetes

play21:24

cluster so as a devops engineer what you

play21:26

need to do is you just need to write

play21:28

this Jenkins file that's it once you

play21:30

write this Jenkins file and you use uh I

play21:33

mean you also should come here and

play21:34

create a Jenkins job once you do it your

play21:37

end to end cicd pipeline is completed

play21:41

right so I'll also try to put uh the

play21:43

entire details that I've explained here

play21:45

in the readme. MD file so currently it

play21:49

is only updated with your uh application

play21:51

details what does this to-do application

play21:53

do and all but I'll also try to put the

play21:55

CI CD end-to-end details that I have

play21:57

done so that you know uh in case

play21:59

somebody did not follow this video well

play22:00

they can look at the readme file and

play22:02

they can you know manually do all the

play22:04

steps that we have discussed but to

play22:06

explain one more time in a nutshell we

play22:09

have executed The Continuous integration

play22:11

and continuous delivery using Jenkins

play22:13

and argosity so Jenkins is doing your

play22:16

continuous integration part and Argo CD

play22:18

is using your continuous delivery part I

play22:20

have done a lot of videos on Argo CD on

play22:22

my channel so you can go back to my

play22:24

previous videos and look into the Argo

play22:26

CD videos if you don't know uh things

play22:28

about Argo CD but for this video uh you

play22:31

can simply like you know execute the

play22:34

steps that I've explained and understand

play22:35

that rocd is a deployment tool which

play22:37

pulls artifacts from GitHub and deploys

play22:39

on to kubernetes without any manual

play22:41

intervention so that is the video for

play22:43

today and I hope you like the demo as

play22:45

well where we made the Live code change

play22:47

in case you have any further questions

play22:49

or you know in case uh you want me to

play22:52

comment live and explain this uh using

play22:54

the setup and installation as well like

play22:55

if you feel that you're not comfortable

play22:58

in installing or configuring Jenkins or

play23:00

installing on configuring Oracle CD we

play23:02

can go on a live video and we can do it

play23:04

together

play23:05

but for that please uh let me know in

play23:07

the comment section and don't forget to

play23:09

like this video and share share this

play23:11

video with your friends who uh you know

play23:13

want to learn cicd

play23:15

thank you so much I'll meet you in the

play23:17

next video take care bye

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
CI/CDJenkinsArgo CDKubernetesDevOpsPipelineContinuous IntegrationContinuous DeliveryDeploymentGitHub
Benötigen Sie eine Zusammenfassung auf Englisch?