This repository contains a sample Spring Boot application named greet-test-app along with Kubernetes configurations in the k8s-config folder. The primary purpose of this repository is to try Argo Rollouts for deploying and managing applications.
The k8s-config folder contains Kubernetes configurations for various components used in the deployment process.
-
Clone this repository to your local machine.
-
Navigate to
k8s-config
directory and follow theREADME.md
NOTE: All the k8s configuration was tested on Minikube version:
v1.31.1
kubectl get service -n localdevelopment
Sample output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-greet-app-service LoadBalancer 10.101.243.159 10.101.243.159 7001:30053/TCP 64m
Copy the EXTERNAL-IP and hit curl 10.101.243.159:7001/greet/1
-
Edit the k8s manifest
k8s-config/greet-app/1-deployment-manifests.yaml
and change the container image todockerbishalthapa/greet-app:pt
ordockerbishalthapa/greet-app:en
-
Apply the changes
kubectl apply -f k8s-config/greet-app/1-deployment-manifests.yaml
-
Watch the rollouts
kubectl argo rollouts get rollout my-greet-app --watch -n localdevelopment
-
Keep hitting the command
curl 10.101.243.159:7001/greet/1
the request should be forwarded to new pod that is being created.
In the background, the ArgoRollout AnalysisTemplate plays a crucial role. It carefully examines the situation and decides whether to proceed with the rollout process upon successful evaluation, or to revert back if there are any issues.
The greet-test-app is a Spring Boot application that showcases various features of Spring Boot, including Spring Actuator, Spring Web, and Micrometer with Prometheus registry. This application has been containerized using Docker and the image has been pushed to Docker Hub.
To run the greet-test-app, follow these steps:
- Navigate to the greet-test-app directory:
cd greet-test-app
- Build the Docker image:
docker build -t greet-test-app .
- Push the Docker image to Docker Hub (you might need to log in to your Docker Hub account):
docker login
docker push your-dockerhub-username/greet-test-app