Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#----------------------------------

# Import docker image with maven installed
FROM maven:3.8.3-openjdk-17 as builder
FROM maven:3.9-eclipse-temurin-22-alpine as builder

# Add maintainer, so that new user will understand who had written this Dockerfile
MAINTAINER Madhup Pandey<madhuppandey2908@gmail.com>
Expand All @@ -25,7 +25,7 @@ RUN mvn clean install -DskipTests=true
#--------------------------------------

# Import small size java image
FROM openjdk:17-alpine as deployer
FROM eclipse-temurin:22-jre-alpine as deployer

# Copy build from stage 1 (builder)
COPY --from=builder /src/target/*.jar /src/target/bankapp.jar
Expand Down
121 changes: 121 additions & 0 deletions JAVA22_MIGRATION_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Java 17 to Java 22 Migration Notes

## Overview
This document outlines the migration from Java 17 to Java 22 for the Springboot-BankApp application.

## Compatibility Assessment

### Spring Boot 3.3.3
- Spring Boot 3.3.x officially supports Java 17-22
- No Spring Boot version upgrade required
- All Spring Boot starters (Data JPA, Security, Thymeleaf, Web) are compatible with Java 22

### MySQL Connector 8.0.33
- MySQL Connector/J 8.0.33 supports Java 8+ and is fully compatible with Java 22
- No connector version upgrade required

### Docker Images
- **Build Stage**: Updated from `maven:3.8.3-openjdk-17` to `maven:3.9-eclipse-temurin-22-alpine`
- Note: The original `maven:3.8.3-openjdk-22` image does not exist; using Eclipse Temurin distribution instead
- **Runtime Stage**: Updated from `openjdk:17-alpine` to `eclipse-temurin:22-jre-alpine`
- Note: The original `openjdk:22-alpine` image does not exist; using Eclipse Temurin distribution instead

## Changes Made

### Phase 2: Development Environment Migration

#### pom.xml
- Updated `java.version` property from `17` to `22`
- Updated `maven-compiler-plugin` source and target from `1.8` to `22`

#### Dockerfile
- Build stage: `maven:3.9-eclipse-temurin-22-alpine`
- Runtime stage: `eclipse-temurin:22-jre-alpine`

### Phase 3: CI/CD Pipeline Migration

#### README.md
- Updated Jenkins installation instructions to use `openjdk-22-jre`

#### Jenkinsfile
- Reviewed and confirmed compatible with Java 22
- Uses shared library functions that are Java version agnostic
- Docker build will use the updated Dockerfile with Java 22 images

#### GitOps/Jenkinsfile
- Reviewed and confirmed compatible with Java 22
- Handles image tags dynamically, no hardcoded Java version references

## Phase 4: Staging Deployment Considerations

### Pre-Deployment Checklist
1. Ensure staging EKS namespace is available
2. Verify ArgoCD is configured to sync from the java22-migration branch
3. Update ArgoCD application configuration to use new Java 22 image tags

### Deployment Steps
1. Deploy updated Docker images to staging EKS namespace
2. Monitor pod startup and health checks
3. Verify application functionality through staging endpoints

### Integration Testing
1. Perform end-to-end testing of all banking application functionality
2. Test user authentication and authorization flows
3. Verify database connectivity and JPA operations
4. Test Thymeleaf template rendering

### Performance Monitoring
1. Compare startup time between Java 17 and Java 22 versions
2. Monitor memory usage and garbage collection metrics
3. Track response times for API endpoints

## Phase 5: Production Deployment Considerations

### Pre-Production Checklist
1. Complete all staging environment testing
2. Review security scan results (Trivy, OWASP, SonarQube)
3. Ensure rollback procedures are documented and tested

### Deployment Strategy: Blue-Green
1. Deploy Java 22 version alongside existing Java 17 version
2. Configure load balancer for gradual traffic shifting
3. Monitor application metrics during traffic migration
4. Complete cutover once stability is confirmed

### Rollback Preparation
1. Keep Java 17 Docker images available in registry
2. Maintain previous Kubernetes manifests for quick rollback
3. Configure monitoring alerts for Java 22 specific issues:
- JVM memory errors
- Class loading issues
- Reflection-related exceptions

### Post-Deployment Monitoring
1. Monitor application logs for any Java 22 specific warnings
2. Track JVM metrics (heap usage, GC pauses, thread counts)
3. Monitor database connection pool health
4. Set up alerts for increased error rates

## Security Scanning Compatibility

### Trivy
- Filesystem and container image scanning compatible with Java 22 artifacts
- No configuration changes required

### OWASP Dependency Check
- Compatible with Java 22 projects
- Will scan Maven dependencies regardless of Java version

### SonarQube
- Code analysis compatible with Java 22 syntax
- Quality gates will function normally

## Maintenance Window Recommendations

### Suggested Timing
- Schedule deployment during low-traffic period (e.g., early morning or weekend)
- Allow 2-4 hours for complete migration and verification

### Communication
- Notify stakeholders of planned maintenance window
- Prepare status update templates for deployment progress
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ sudo su
> [!Note]
> Make sure the ssh-public-key "eks-nodegroup-key is available in your aws account"
- <b>Install Jenkins</b>
> [!Note]
> openjdk-22-jre is not available in standard Ubuntu repositories. Use openjdk-21-jre (which supports running Java 22 compiled code) or install Java 22 from Eclipse Temurin/Adoptium.
```bash
sudo apt update -y
sudo apt install fontconfig openjdk-17-jre -y
sudo apt install fontconfig openjdk-21-jre -y

sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<url/>
</scm>
<properties>
<java.version>17</java.version>
<java.version>22</java.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -80,8 +80,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>22</source>
<target>22</target>
</configuration>
</plugin>
</plugins>
Expand Down