Deploy multiple instances

This guide provides an example how to deploy multiple instances of this component.


  • commodore

  • pwgen

  • vault

  1. Prepare catalog

    # Add the instances and give them a name.
    - keycloak as keycloak-test
    - keycloak as keycloak-prod
      # Configure the test instance with defaults and built-in database
        namespace: tenant-keycloak-test
      # Configure the production instance using an external database
        namespace: tenant-keycloak-prod
          provider: external
            host: my-postgres-db-server.tld

    By default, the component configures the namespace with syn-<instance-name>. Using the syn- prefix might not be what you want when using multiple instances or when deploying Keycloak for another tenant. Use the namespace parameter to customize the namespace, but be sure that each instance gets their own namespace.

  2. Set secrets (don’t forget to also store certificates for each Keycloak instance)

    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>
  3. Compile and push the cluster catalog

  4. Wait until changes are applied

  5. Verify that the instances are up and configured correctly