Jenkins and Groovy on Kubernetes

Jenkins and Groovy on Kubernetes

What is Groovy?

It is language in which we can write the code and steps to run JOBs of Jenkins. This language is very easy and can be written by anyone. This is also a great advantage, that developers who don't about the administration much can easily make the cod and run the jobs in Jenkins.

Problem Statement:

Perform third task with the help of Jenkins coding file ( called as jenkinsfile approach ) and perform the with following phases:

1. Create container image that’s has Jenkins installed using dockerfile Or You can use the Jenkins Server on RHEL 8/7

2. When we launch this image, it should automatically starts Jenkins service in the container.

3. Create a job chain of job1, job2, job3 and job4 using build pipeline plugin in Jenkins 

4. Job2 ( Seed Job ) : Pull the Github repo automatically when some developers push repo to Github.

5. Further on jobs should be pipeline using written code using Groovy language by the developer

6. Job1 :  

  1. By looking at the code or program file, Jenkins should automatically start the respective language interpreter installed image container to deploy code on top of Kubernetes ( eg. If code is of PHP, then Jenkins should start the container that has PHP already installed )

  2. Expose your pod so that testing team could perform the testing on the pod

  3. Make the data to remain persistent using PVC ( If server collects some data like logs, other user information )

7. Job3 : Test your app if it is working or not.

8. Job4 : if app is not working , then send email to developer with error messages and redeploy the application after code is being edited by the develop

Solution:

We have to create an image in which jenkins , kubernetes and other things will be configured.

Creating a docker image:

No alt text provided for this image

Building Docker Image:

No alt text provided for this image

Now creating persistent volume claim:

No alt text provided for this image

Now creating service :

No alt text provided for this image

Creating deployment:

No alt text provided for this image

Now the groovy code for making the JOB is written in my Github repo.

Now we have to make a seed job for downloading this code.

I have named it "Groovy_dsl"

No alt text provided for this image

I have added my Github repository here.

Now, as soon as this job will run the new job will run.

No alt text provided for this image
No alt text provided for this image

Thanks for reading :)


Arsh Mishra

Data Scientist & Machine Learning Engineer | Building Scalable Models for Real-World Impact

4 年

Well done??Aastha Saxena ??

回复

要查看或添加评论,请登录

Aastha Saxena的更多文章

  • Dynamic Cluster -Jenkins, Docker and Kubernetes

    Dynamic Cluster -Jenkins, Docker and Kubernetes

    In this article, we are going to explain how to make a dynamic Jenkins cluster with Kubernetes. Cluster: The group of…

    4 条评论
  • How to write a great resume?

    How to write a great resume?

    In this article I will share you my experience in how to write a resume. First of all , what we should write in resume?…

    6 条评论
  • Automation webserver using Kubernetes

    Automation webserver using Kubernetes

    1. Create container image that’s has Jenkins installed using dockerfile Or You can use the Jenkins Server on RHEL 8/7 2.

    4 条评论
  • Ip-blocking using MLSecOps

    Ip-blocking using MLSecOps

    In this article I'm going to explain how we can block a particular IP, using Rhel8, Python script, Jenkins. Our Problem…

    16 条评论
  • AWS Deep Composer

    AWS Deep Composer

    In this article, I will go through, how we can compose our music using AWS DEEP COMPOSER. Firstly, let us learn what is…

  • MLOps Journey

    MLOps Journey

    Congratulations to my fellow MLOps students in the completion of MLOps Training given by Vimal Daga Sir. Let me…

    4 条评论
  • Face Recognition using Vgg-16

    Face Recognition using Vgg-16

    In this article, I'm going to explain how we can make our own Face recognition and detection system using VGG-16 and…

    8 条评论
  • Machine Learning Integration with DevOps

    Machine Learning Integration with DevOps

    Task Overview:1. Create container image that’s has Python3 and Keras or numpy installed using dockerfile 2.

    2 条评论
  • Automation of webserver using Docker ,Jenkins, Git and Github

    Automation of webserver using Docker ,Jenkins, Git and Github

    Task Aim: 1. Create container image that’s has Jenkins installed using dockerfile 2.

    4 条评论
  • DEVOPS AUTOMATION

    DEVOPS AUTOMATION

    Introduction of applications used: Github : Github is a centralised system where we can upload or download the code .It…

    4 条评论

社区洞察

其他会员也浏览了