Skip to main content

CI/CD Pipeline with Kubernetes 2020

Mitesh Patel

Mitesh Patel

7 Minutes

When it comes to DevOps, the word that clicks in mind is CI/CD pipeline. Let's have a look at Definition of CI/CD pipeline:

CI is straightforward and stands for continuous integration, a practice that focuses on making preparing a release easier. But CD can either mean continuous delivery or continuous deployment and while those two practices have a lot in common, they also have a significant difference that can have critical consequences for a business.

- Atlassian.com

CI stands for Continuous Integration, and CD stands for Continuous Delivery and Continuous Deployment. You can think of it as a process which is similar to a software development lifecycle.

- Edureka.co

Systems provide automation of the software build and validation process driven in a continuous way by running a configured sequence of operations every time a software change is checked into the source code management repository. These are closely associated with agile development practices and closely related to the emerging DevOps toolsets.

- Gartner.com

In the DevOps world, we have a plethora of toolsets that can help and leverage CICD capabilities.

  • Docker
  • Kubernetes
  • Proxies
  • Git
  • Jenkins/ Jenkins X
  • Ansible
  • Chef
  • Code Pipeline, etc

This blog gives direction to up and running your CICD pipeline running on the Kubernetes cluster by the GitLab CICD pipeline.

Prerequisites:

  • Hands-on knowledge of Docker containers
  • Hands-on knowledge of kubernetes architecture and understanding
  • The Idea of how to write YAML files
  • Up and Running kubernetes cluster

Step 1: Creating and Deploying on kubernetes cluster (in this example we took AWS EKS)

https://logz.io/blog/amazon-eks/

Step 2: Installing Gitlab 

https://docs.gitlab.com/charts/installation/cloud/eks.html

Step 3: Configure Gitlab for Kubernetes

Go to GitLab > operations > kubernetes > Add Kubernetes Cluster > Add existing cluster, and you will be getting the page as below :

Picture 1

You can get the necessary details by reviewing the AWS EKS cluster, Keep in mind that CA Certificate file only accepts the PEM like necryption.

To avoid confusion please refer to https://docs.gitlab.com/ee/user/project/clusters/add_remove_clusters.html#configuring-and-connecting-the-eks-cluster

Step 4: Creating needed files and configurations for CICD implementation

  • Create .gitlab-ci.yml

- If you do not have any idea about it then no worries we have stepwise solution of it

https://docs.gitlab.com/ee/user/project/pages/getting_started_part_four.html

Picture2
  • Create manifest folder and write deployments file

- Deployment.yml

Picture4
  • Ingress.yml
Picture5
  • Service.yml
Picture6

Once the files are configured go to pipeline section of GitLab and check the logs and status of pipeline

Picture7

Let's Catch Up & Schedule a 30 minutes call to discuss your DevOps requirement

Contact Us