This module defines the kubernetes resources required to run a Postgres database.
The config.js file gathers the configuration for this module.
This module exports 3 kubernetes resources through the createResources function from the iac.js file.
Define variables for the StatefulSet: username, database name and password.
Define the postgres stateful set:
- image name, version and port
- readinessProbe and livenessProbe using the psql command to find out if the database is up and running
- persistent volume claim to set the size of the disk.
A headless service forwards traffic to the postgres database. The idea behind using a headless service is to get a unique dns entry that can be referenced by the backend and other (micro)services.
This module is being used in the following projects: