WebServer on Kubernetes Cluster via Jenkins using Groovy Script

WebServer on Kubernetes Cluster via Jenkins using Groovy Script

Jenkins Job list:

1.Seed Job: This job is configured with a github-webhook. It will download the groovy script pushed by developers and create jobs according to the script and views it as required by the operations team.

2. The 3 jobs will be automatically created as we have configured it in the groovy script and they are as follows :

  • Job1: Download and interpret the code from Github, build the image using given Dockerfile and push it to Dockerhub.
  • Job2: Deploy and expose your webserver on Kubernetes so testing can be performed accordingly.
  • Job3: Send status to the team as per the result of the build and deployment status.

The Seed Job: this will download the groovy script file from the GitHub and it will run the file.

No alt text provided for this image

go to Manage Jenkins >> Configure Global Security then do the following settings

No alt text provided for this image

3 jobs and a build view automatically created by the seed-job

No alt text provided for this image

Now, when the job1 is build it will go to the github where the Developer have uploaded the HTML file and Dockerfile copy both the files the linux system. And build a docker image using the Dockerfile and push(upload) the docker inage in the developer's docker repository in www.hub.docker.com .

now in job2 kubernetes will fetch this image from the dockerhub and use it to create pods and launch the website created by the developer in it and expose it so the it is accessible from anywhere.

Now if you check the pods created by the kubernetes.

No alt text provided for this image

the pods are launched successfully in the kubernetes and the service is exposed with a random port

 the sample website launched through the kubernetes.

No alt text provided for this image


Muskan Agarwal

Business Technology Solutions Associate Consultant @ ZS Pune

4 年

Awesome ??

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

Sandeep Singh Rajawat的更多文章

  • Integrating Prometheus and Grafana with Kubernetes(K8s)

    Integrating Prometheus and Grafana with Kubernetes(K8s)

    To create different resources in Kubernetes like Pods, Deployment, Service, PVC we use YAML configuration files. Here…

    2 条评论
  • Dynamic Jenkins Cluster

    Dynamic Jenkins Cluster

    Firstly edit this file “/lib/systemd/system/docker.service” on the host.

    1 条评论
  • Automating Kubernetes(K8s) with Jenkins

    Automating Kubernetes(K8s) with Jenkins

    Created a container image that’s has Jenkins and other requirements installed using dockerfile. When we will launch…

    2 条评论
  • Task 4 : Face Recognition using Transfer Learning

    Task 4 : Face Recognition using Transfer Learning

    In the Deep Learning world , while training of CNN model with the large datasets like Big-data consist of millions of…

    2 条评论
  • Task 3: Automation Of ML with Devops - MLOps

    Task 3: Automation Of ML with Devops - MLOps

    Data science is iterative . At each of the major stages of the process (data preparation, model development, model…

    5 条评论
  • Building A Pipeline System using Jenkins + Docker

    Building A Pipeline System using Jenkins + Docker

    If you just want to get going quickly: we use Jenkins to automate Continuous Integration tasks, and run it in a Docker…

    2 条评论
  • Setting up testing environment using Docker + Jenkins + Github

    Setting up testing environment using Docker + Jenkins + Github

    In an Organization When multiple developers are working on code or project its very essential that it has to be tested…

    2 条评论

社区洞察