Tech/Languages used:
- Docker
- Kubernetes
- Java SpringBoot
- PostgreSQL
Goal
A local kubernetes environment with a REST service linked to a database that can be accessed via the browser.
What was implemented
- Script for creating the cluster that creates:
- Kubernetes Cluster
- PostgreSQL database
- Compiles and launches REST API
Stumbling blocks
- There were issues with having the REST API getting up and running, such as missing plugins in Maven.
- The largest stumbling block that I was stuck on was figuring out how to still have test cases run for compilation.
- While I did not implement it, my idea of how to fix it is to setup access to the database for the REST API while it’s compiling, by launching the database first and setting up access through Docker to then enable database connections while compiling.
- Alternatively I could mock a database for compilation however, I was advised against it by some people I know so I opted to try the above.
Lessons learned
- Make smaller projects first to get used to setting up the individual bits of tech before trying to connect a bunch of them in one go, it’s far too inefficient the way I did this project.
- It’s really useful to go through the steps you are automating in a script manually, to see if you missed anything and if they make sense.
- SQL has a COPY FROM statement that can be used to get data from CSVs, making the setup of a database simpler.