GitOps101 — CI/CD Pipelines and Infrastructure (Part 1)

Alper Peker
Codable
Published in
3 min readJan 12, 2023

This is the second article, in a series of (6+1 bonus =) 7 articles.

This series was written by Alper Peker and Yağız Küçükkambak, from OBSS DevOps Team.

Welcome back to the GitOps101 series. Today in Part 1, we will talk about the essential tasks of a CI/CD pipeline, one by one, talk about the creation of infrastructure and introduce our demo along with the tools that will be used in it.

Nowadays there are many handy tools that address most of the fundamental requirements of a CI/CD pipeline. However, using only one tool to fulfill all your needs may not be a wise expectation. Especially in enterprise solutions, not only do the needs take part in the decision of the tools that will be used but also regulations these organizations must satisfy. While tools can range, the processes can be generalized in several stages in the lifecycle of an application such as:

· Source Control

· Build

· Containerization

· Artifact & Image Storage

· Deployment

Source Control is where you will store the code in the simplest terms. You will need reliable storage for your code and all branches. Every time there is a commit to this repo the pipeline structure will trigger. There are a lot of version control tools that you can select from but for the sake of this scenario, we will use GitLab since it can provide us with the version control utilities along with the pipeline utilities.

Photo by Shahadat Rahman on Unsplash

Build is the stage where the code is checked out from the source repository along with the gathering of the dependency packages in order to create the artifacts. This stage is where most of the project-based customization happens since any framework or dependency manager used in the project will require different building processes and commands. In general, after building, you have your artifacts produced and ready to be advanced to the next part of your pipeline. From a wide range of selections, a React project will be used in the demo.

Containerization can be seen as a pre-requisite for the deployment stages. When you containerize your application, you create an image that will be later used to create an instance of your app in the environment that you deploy to. Docker is the most popular choice of tool so we will use Docker as well.

Photo by Venti Views on Unsplash

Earlier in the pipeline, artifacts were produced in the build stage, and images were created in the containerization stage. Artifact & Image Storage is where these products are pushed to a repository. It is also possible to use this repository manager to store your dependencies in order to collect them during the build stage. Luckily GitLab also provides registry services for this purpose so once again GitLab is our choice of tool.

After the Images and Artifacts are produced and stored, it is time to Deploy our application to the desired cluster. This is where the application will be accessible to target customers or testers depending on the selection of the target cluster for the deployment. ArgoCD is the tool that will help us during this process.

Photo by Caleb Ruiter on Unsplash

Overall, here is the structure of the demo scenario that we will cover together in the later parts of the GitOps101 Series.

Now that we addressed the steps and goals of the pipeline we will dig further into the pipeline process in the following parts of the GitOps101 series.

--

--