Fully automated database management
Use this approach when database management is delegated to the NevisDatabase custom resource, reconciled by nevisOperator, to create and manage the database users, grants, and schema. It is the default Kubernetes behavior for component database patterns.
Responsibilities
The database administrator must:
- Provide a database service that is reachable from the Kubernetes cluster.
- Provide a database user with the privileges required by the dbschema job.
- Store the database credentials in a Kubernetes Secret.
- Ensure that the database service permits connections from the cluster.
The nevisAdmin 4 Helm chart and the NevisDatabase custom resource, reconciled by nevisOperator, then perform the database preparation and schema migrations.
Install nevisAdmin 4
Follow Kubernetes-based installation. Configure the chart with the database type, port, host, and root credential Secret. For PostgreSQL, set the database type and port as follows, and configure the host and root credential Secret separately as described in the installation guide:
--set database.type=postgresql \
--set database.port=5432
The root credential is supplied with the chart's database.root settings. The nevisAdmin 4 database credential Secret contains the schema and application users that the chart creates for nevisAdmin 4.
In this approach, the database user supplied to database.root must be allowed to perform all operations required by the chart dbschema job. On PostgreSQL, this includes creating the database, creating roles, and creating the citext extension. On Azure Database for PostgreSQL, extension availability may also require an Azure server allow-list.
Deploy Nevis components
For each component database pattern:
- Configure the database host, port, database name, and connection settings.
- Set Database Management to
complete. - Provide the root credential and, if needed, optional schema-owner or application-user overrides using the pattern's credential fields or Kubernetes Secret references.
- Deploy the project.
The NevisDatabase custom resource, reconciled by nevisOperator, creates the database prerequisites, creates or updates the required users and grants, and runs the schema migration job. During later deployments, it runs the required migrations automatically.
Trade-offs
This is the simplest operational model and requires the least manual preparation. It is not suitable when the application deployment is not allowed to hold a privileged database credential or to change database roles.