CI/CD Pipeline

A Kubernetes pod - incidentally, some say it is named after a whale pod because the docker logo is a whale – is the foundational unit of execution in a K8s ecosystem. While docker is the most common container runtime, pods are container agnostic and support other containers as well.
Simply put, a K8s pod is a layer of abstraction wrapped around containers to group them together to allocate resources and to manage them efficiently.
Continuous integration and delivery or CI/CD is a critical part of DevOps ecosystems, especially for cloud-native applications. DevOps teams frequently use Jenkins CI/CD pipelines to increase the speed and quality of collaborated software development ecosystems by adding automation. Thanks to Helm, deploying Jenkins server to K8s is quick and easy. The difficult bit is building the pipeline.
Here is a post that describes how to deploy a pod containing three applications using a Jenkins CI/CD pipeline and update them selectively.
Use a Jenkins pipeline to build a spring-boot application to generate jar file, dockerize the application to create a docker image, push the image to a docker repository and pull the image into the pod to create containers. The pod should contain 3 containers for the three applications, respectively. Upon git commit, only the container for which there is a change must be updated (rolling update).
pipeline {
agent any
stages {
stage('Build1'){
steps{
dir('app1'){
script{
git 'https://github.com/cloud/simple-spring.git'
sh 'mvn clean install'
app = docker.build("cloud007/simple-spring")
docker.withRegistry( "https://registry.hub.docker.com", "dockerhub" ) {
// dockerImage.push()
app.push("latest")
}
}
}
}
}
stage('Build2'){
steps{
dir('app2'){
script{
git 'https://github.com/cloud/simple-spring-2.git'
sh 'mvn clean install'
app = docker.build("cloud007/simple-spring-2")
docker.withRegistry( "https://registry.hub.docker.com", "dockerhub" ) {
// dockerImage.push()
app.push("latest")
}
}
}
}
}
stage('Build3'){
steps{
dir('app3'){
script{
git 'https://github.com/cloud/simple-spring-3.git'
sh 'mvn clean install'
app = docker.build("cloud007/simple-spring-3")
docker.withRegistry( "https://registry.hub.docker.com", "dockerhub" ) {
// dockerImage.push()
app.push("latest")
}
}
}
}
}
stage('Orchestrate')
{
steps{
script{
sh 'kubectl apply -f demo.yaml'
}
}
}
}
}
4. Make sure to properly configure docker and expose the dockerd in port 4243 and then change permission to allow Jenkins to use docker commands by changing permission for the /var/run/docker.sock shown.
5. Coming to integrating Kubernetes with Jenkins, it can be done using two plugins:

Refer: https://github.com/jenkinsci/kubernetes-plugin

Refer: https://github.com/jenkinsci/kubernetes-cli-plugin/blob/master/README.md
Hence, we installed kubectl on the Jenkins host, configured the cluster manually, and ran shell commands from the Jenkins pipeline, where Jenkins was recognized as an anonymous user and was only granted get access but couldn’t create pods/deployments.
Here are some common problems faced during this process and the troubleshooting procedure.
Here are some suggested best practices
Share this:

Part 4 of our series on intent-driven development. Start with Part 1, or read Parts 2 and 3 first if you want the technical workflow before the outcomes. The first three posts in this series covered the mechanics: why the spec is now the source of truth, how to build the CLAUDE.md context layer, and how OpenSpec moves […]

Part 3 of our series on intent-driven development. Read Part 1 (spec-driven development with Kiro) and Part 2 (mastering the CLAUDE.md file) first. Part 1 of this series established the principle: in AI-assisted development, the spec is the source of truth, not the code. Part 2 covered the CLAUDE.md file — the context layer that ensures every AI session starts from […]

How to Master the CLAUDE.md File: The Context Layer That Makes Spec-Driven Development Work Part 2 of our series on intent-driven development. If you haven't read Part 1 — Code is No Longer the Source of Truth. Your Spec Is. — start there. In Part 1, we explored how spec-driven development with tools like Kiro shifts the source of truth from […]
Partner with CloudIQ to achieve immediate gains while building a strong foundation for long-term, transformative success.