Bring Your Own Storage for Keycloak
Bring Your Own Storage (BYOS) for Keycloak allows you to use your own Postgres database instance instead of the default one. This section guides you through the process of setting up BYOS for Keycloak.
Before you begin
- Do the Postgres database instance set up.
- Get the credentials, host, database name, and username details.
Instructions
To set up BYOS for Keycloak, follow these steps:
- Export install directory.
export INSTALL_DIR=<install_directory>/ibm-concert - Run the
/$INSTALL_DIR/concert-hub/bin/set-byo-kc-db.shscript with the required parameters:--db-host=<host> --db-database=<database> --db-username=<username> # Optional parameters --is-vm=<true/false> --namespace=<namespace> --db-schema=<schema> --db-url-port=<port> --db-ssl-mode=<mode> --db-ssl-root-cert=<path>Table 1. BYOS for Keycloak parameters Parameter Description --db-host=<host> The --db-hostparameter specifies the database host, which is the hostname that you want to use with Keycloak.--db-database=<database> The --db-databaseparameter specifies the name of the Postgres database that you want to use with Keycloak.--db-username The --db-usernameparameter specifies the username to use for authentication with the Postgres database.--is-vm=<true/false> Optional: The --is-vmparameter is an optional flag that indicates whether Keycloak is being installed on a Virtual Machine (VM) or not. The default value of this parameter isfalse, which means that if you don't specify this parameter, the script will assume that you are not installing on a VM. If you are installing Keycloak on a VM, you should set this parameter totrueto ensure that the script configures the environment correctly for a VM-based installation.--namespace=<namespace> Optional: The --namespaceparameter specifies the Kubernetes namespace where Keycloak will be deployed. This parameter is mandatory for Kubernetes (k8s) deployments, meaning that you must provide a valid namespace when running the script in a k8s environment.--db-schema=<schema> Optional: The --db-schemaparameter specifies the database schema that Keycloak will use to store its data. The default value of this parameter ispublic, which means that if you do not specify a schema, Keycloak will use thepublicschema by default.--db-url-port=<port> Optional: The --db-url-portparameter specifies the port number that Keycloak will use to connect to the Postgres database.--db-ssl-mode=<mode> Optional: The --db-ssl-modeparameter specifies the SSL mode that Keycloak will use to connect to the Postgres database.--db-ssl-root-cert=<path> Optional: The --db-ssl-root-certparameter specifies the path to the SSL root certificate file that Keycloak will use to verify the identity of the Postgres database server.The script will generate the necessary secrets in case of Kubernetes deployments or config files for VM deployments.
Next steps
Continue with the deployment process.
Note: You do not need to pass HUB_STORAGE_CLASS, as you are bringing your own Postgres.