KUBERNETES

Kubernetes has become the preferred platform of choice for container orchestration and deliver maximum operational efficiency. To understand how K8s works, one must understand its most basic execution unit – a pod.
Kubernetes doesn’t run containers directly, rather through a higher-level structure called a pod. A pod has an application’s container (or, in some cases, multiple containers), storage resources, a unique network IP, and options that govern how the container(s) should run.
Pods can hold multiple containers or just one. Every container in a pod will share the same resources and network. A pod is used as a replication unit in Kubernetes; hence, it is advisable to not add too many containers in one pod. Future scaling up would lead to unnecessary and expensive duplication.
To maximize the ease and speed of Kubernetes, DevOps teams like to add automation using Jenkins CI/CD pipelines. Not only does this make the entire process of building, testing, and deploying software go faster, but it also minimizes human error. Here is how Jenkins CI/CD pipeline is used to deploy a spring boot application in K8s.
Create a Jenkins pipeline to dockerize a spring application, build docker image, push it to the dockerhub repo and then pull the image into an AKS cluster to run it in a pod.
All the files required for this task are available in this repository:
https://github.com/saiachyuth5/simple-spring
A spring-boot application, dockerfile to containerize the application.
STEPS:
1. Install Jenkins :
2. Connect host docker daemon to Jenkins:

3. Adding global credentials:

4. Create the Jenkinsfile :
Jenkinsfile:
NOTE: While this example uses actual id to login to Azure, its recommended to use credentials to avoid using exact parameters.
pipeline {
environment {
registryCredential = "docker"
}
agent any
stages {
stage(‘Build’) {
steps{
script {
sh 'mvn clean install'
}
}
}
stage(‘Load’) {
steps{
script {
app = docker.build("cloud007/simple-spring")
}
}
}
stage(‘Deploy’) {
steps{
script {
docker.withRegistry( "https://registry.hub.docker.com", registryCredential ) {
// dockerImage.push()
app.push("latest")
}
}
}
}
stage('Deploy to ACS'){
steps{
withCredentials([azureServicePrincipal('dbb6d63b-41ab-4e71-b9ed-32b3be06eeb8')]) {
sh 'echo "logging in" '
sh 'az login --service-principal -u **************************** -p ********************************* -t **********************************’
sh 'az account set -s ****************************'
sh 'az aks get-credentials --resource-group ilink --name mycluster'
sh 'kubectl apply -f sample.yaml'
}
}
}
}
}
5. Create the Jenkins project:

6. Create and connect to Azure Kubernetes cluster:
YAML used:
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-helloworld
spec:
replicas: 1
selector:
matchLabels:
app: spring-helloworld
template:
metadata:
labels:
app: spring-helloworld
spec:
containers:
- name: spring-helloworld
image: cloud007/simple-spring:latest
imagePullPolicy: Always
ports:
- containerPort: 80
Here are some common problems faced during this process and the troubleshooting procedure.
In an upcoming article we will show you how to deploy a pod containing three applications using Jenkins ci/cd pipeline and update them selectively.
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.