For Kaspersky Container Security, you can use PostgreSQL databases included in the solution or your own PostgreSQL databases. To install an external PostgreSQL database that does not work with the Kaspersky Container Security schema, you must create a separate user. You can do this by installing the Helm Chart package with the schema parameters specified for the external PostgreSQL database.
To create a user with a custom schema for an external PostgreSQL database:
kubectl create ns kcspg
where kcspg
is the namespace for the external PostgreSQL database.
Parameters for deploying the external PostgreSQL database
The parameters specify the password of the database. You must then specify this password in the infraconfig
section of the values.yaml configuration file, which is part of the Helm Chart package included in the distribution kit of the solution.
kubectl apply -f pg.yaml -n kcspg
The name of this external database is formed as follows:
<
pod_name
>.<
namespace name
>.<
service
>.cluster.local
For example, postgres.kcspg.svc.cluster.local
kubectl apply -f svc.yaml -n kcspg
psql -h localhost -U postgres -d api
CREATE ROLE kks LOGIN PASSWORD 'kks' NOINHERIT CREATEDB;
CREATE SCHEMA kks AUTHORIZATION kks;
GRANT USAGE ON SCHEMA kks TO PUBLIC;
Parameters in the values.yaml file
The values of the parameters specified in values.yaml must match the values of corresponding parameters in the pg.yaml and svc.yaml configuration files.
Example of commands to create a user with an external PostgreSQL database