Deploy multiple instances
This guide provides an example how to deploy multiple instances of this component.
Requirements
-
commodore
-
pwgen
-
vault
-
Prepare catalog
# Add the instances and give them a name. applications: - keycloak as keycloak-test - keycloak as keycloak-prod parameters: # Configure the test instance with defaults and built-in database keycloak_test: namespace: tenant-keycloak-test # Configure the production instance using an external database keycloak_prod: namespace: tenant-keycloak-prod database: provider: external external: host: my-postgres-db-server.tld
By default, the component configures the namespace with
syn-<instance-name>
. Using thesyn-
prefix might not be what you want when using multiple instances or when deploying Keycloak for another tenant. Use thenamespace
parameter to customize the namespace, but be sure that each instance gets their own namespace. -
Set secrets (don’t forget to also store certificates for each Keycloak instance)
parent="clusters/kv/${TENANT_ID}/${CLUSTER_ID}" vault kv put "${parent}/keycloak-test" admin-password=$(pwgen -s 32 1) db-password=$(pwgen -s 32 1) vault kv put "${parent}/keycloak-prod" admin-password=$(pwgen -s 32 1) db-password=<your-external-db-password>
-
Compile and push the cluster catalog
-
Wait until changes are applied
-
Verify that the instances are up and configured correctly