This Helm chart deploys a Spring Boot application that connects to a PostgreSQL database. The chart manages the application and database resources efficiently using Kubernetes objects like Deployments, Services, Secrets, and PersistentVolumes.
8080.Deployment with 2 replicas.naveenalla/spring-app-helm.postgres-pvc).postgrespostgresspringdb1Gi.ClusterIP service on port 5432.NodePort service on port 8080.postgres-pv.yaml: Configures persistent storage for PostgreSQL.postgres-pvc.yaml: Claims storage for PostgreSQL.postgres-deployment.yaml: Deploys PostgreSQL as a Kubernetes deployment.postgres-service.yaml: Exposes PostgreSQL as a Kubernetes service.secrets.yaml: Stores PostgreSQL credentials securely.spring-app-deployment.yaml: Deploys the Spring Boot application.spring-app-service.yaml: Exposes the Spring Boot application as a service.postgres:
username: postgres
password: postgres
database: springdb
persistence:
enabled: true
storageSize: 1Gi
springApp:
image: naveenalla/spring-app-helm
replicas: 2
service:
type: NodePort
port: 8080
kubectl configured.helm repo add naveenalla-springboot https://naveenalla3000.github.io/springboot-helm/
helm repo update
spring-app.
helm install my-spring-helm naveenalla-springboot/spring-helm
kubectl get all
kubectl get svc
kubectl port-forward service/my-spring-helm-spring-app-service 8080:8080
http://localhost:8080.Below is the deployment architecture for the Helm chart:
+------------------+ +-----------------------+ +-------------------+
| | | | | |
| postgresql | | cluster-ip | | springboot |
| pod |----->| db-service |----->| application |
| | | | | |
+--------+---------+ +-----------+-----------+ +---------+---------+
| |
| |
+--------v---------+ +---------v---------+
| | | |
| persistent | | NodePort |
| volume claim | | app-service |
| | | |
+------------------+ +-------------------+
| |
| |
+---------v---------+ +---------v---------+
| | | |
| persistent | | web browser |
| storage | | |
| | +-------------------+
+-------------------+
To delete the Helm release:
helm uninstall my-spring-helm
This will remove all resources associated with the release.