{{announcement.body}}
{{announcement.title}}

How to Setup a CI/CD Pipeline with Kubernetes

DZone 's Guide to

How to Setup a CI/CD Pipeline with Kubernetes

This tutorial walks through a four-step process of setting up a CI/CD pipeline with Kubernetes and checking the status of your pipeline.

· DevOps Zone ·
Free Resource

Pipes

Learn to construct a CI/CD pipeline


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

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 CI/CD capabilities.

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

You may also enjoy Linode's Beginner's Guide to Kubernetes.

Prerequisites:

  • Hands-on knowledge of Docker containers
  • Hands-on knowledge of Kubernetes architecture and understanding                       
  • Knowledge 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 get this page:

                               Configure Gitlab
Configure Gitlab

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

To avoid confusion please refer here

Step 4: Creating needed files and configurations for CICD implementation

 

 

Gitlab YAML
Gitlab YAML


  • Create a manifest folder and write deployments file

 Deployment.yml

Deployment YAML
Deployment YAML


Ingress.yml

 

 
 
 
 
 
Ingress YAML
Ingress YAML


  • Service.yml
Service YAML
Service YAML

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

Pipeline status
Pipeline status

Further Reading

Kubernetes in 10 Minutes: A Complete Guide

The CI/CD Infrastructure: My Recommended Tools



Topics:
devops, kubernates

Published at DZone with permission of Cray Styris . See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}