tchughesiv / spring-boot-dbaas-postgresql-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Boot & Spring Cloud example applications for Kubernetes Service Binding

Tested with:

  • OpenShift
  • DBaaS

Building/deploying all modules

# build 
./mvnw clean package


# build the images 

 docker build -t spring-postgresql-demo .
 docker image tag spring-postgresql-demo quay.io/<org>/spring-postgresql-demo:v0.0.1
 
# push the images to your docker image registry
docker push  quay.io/<org>/spring-postgresql-demo:v0.0.1         

# deploy the application to a OpenShift cluster
oc apply -f k8s/deploy-postgresql-app.yaml 

Service Binding

Provide data to be consumed by Service Binding clients (the applications in this repo.).

Managed cloud database resources

Managing your cloud databases automating Secrets, ConfigMap creation, and volume mounting for applications, you can use DBaaS, aka Red Hat OpenShift Database Access Operator

Manual database resources preparation

  1. Provision the services, such as PostgreSql
  2. Create a Secret or ConfigMap containing the properties to access the service
  3. Mount the Secret and/or ConfigMap as a volume within the Pod for the application
  4. Set the SERVICE_BINDING_ROOT environment variable specifying where the service information has been mounted

Instead of manually preparing steps 2 through 4, they can be automated by installing and using the Service Binding Operator

Relevant resources

About

License:Apache License 2.0


Languages

Language:Java 53.3%Language:HTML 44.8%Language:Dockerfile 1.9%