DEV Community

K. Sam Ashray
K. Sam Ashray

Posted on

1 2 1 2 1

Learning DevOps 29/01

Goal: To have hands-on experience in creating from scratch enterprise level CI/CD pipelines, from code commit to building packages, to security scans to infra provisioning to mail notification of completion, while enabling monitoring.

Workflow:

  • Tried to run SonarQube and Nexus locally via docker, but did not have enough resources.
  • Used Terraform to provision 5 EC2 instances with required cpu, storage and inbound rules - 3 for Kubernetes, 1 for SonarQube and 1 for Nexus artifact repository.

Image description

  • Used kubeadm for K8s setup, 1 Master & 2 Slave Nodes
  • Ran Jenkins from local docker. ( this came back to bite me)
  • Installed relevant Jenkins Plugins, Configured the tools that will be used in pipeline, Stored the relevant secrets/credentials for Sonar / Nexus / Docker / Kubernetes in Jenkins Credentials.
  • Used my springboot REST project as the source code.
  • Was able to successfully build, test, run a Trivy filesystem test, run Sonar scan on the code, package the code and upload the code to nexus.

Image description
Image description

  • Faced issue while pushing the Dockerfile to DockerHub.
  • Faced issue with deploying into K8s cluster.

Current Issues:

  1. The Docker plugin for Jenkins didn’t seem to work, it couldn’t run docker commands.
  2. Could deploy the service.yml from Jenkins into the K8s Cluster.

Solutions:
For 1. Tried restarting the jenkins instance, still the option to configure Docker didnt show in Manage Jenkins > System. Solution might be to run in an EC2 instance, with the latest Jenkins docker image.
For 2. As the Jenkins instance was run locally, I didnt open the port 6443, usually used by K8s api-server. Running Jenkins on EC2 with the right ports open will fix this as well.

Future Plans:
Will try this again tomorrow, but just the Jenkins-Docker-K8s section of the pipeline.
Github

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay