Configuring multiple passwords for different schemas

Configure the custom server.xml to use different passwords for different schemas.

Procedure

  1. Create a secret with the passwords that are required for your custom server.xml file.
    kubectl create secret generic <your secret name> \
            --from-literal=metaDbPassword=<password> \
            --from-literal=confDbPassword=<password> \
            --from-literal=statDbPassword=<password> \
            --from-literal=tranDbPassword=<password> \
            --from-literal=mstrDbPassword=<password> \
  2. Create the serverProperties environment and reference the secret that is created in step 1.
    serverProperties:
      envVars:
        - groupName: MultiSchemaPasswords
          propertyRef:
            - name: META_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: <your secret name>
                  key: metaDbPassword
            - name: STAT_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: <your secret name>
                  key: statDbPassword
            - name: CONF_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: <your secret name>
                  key: confDbPassword
            - name: TRAN_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: <your secret name>
                  key: tranDbPassword
            - name: MSTR_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: <your secret name>
                  key: mstrDbPassword
  3. Define the MultiSchemaPasswords environment variable in the app server.
    property:
      envVars: MultiSchemaPasswords
  4. Define the passwords in your server.xml.
    <!-- In your custom server.xml -->
    
    <properties.postgresql ... password="${env.META_DB_PASSWORD}" ... />
    ...
    <properties.postgresql ... password="${env.STAT_DB_PASSWORD}" ... />
    ...
    <properties.postgresql ... password="${env.CONF_DB_PASSWORD}" ... />
    ...
    <properties.postgresql ... password="${env.TRAN_DB_PASSWORD}" ... />
    ...
    <properties.postgresql ... password="${env.MSTR_DB_PASSWORD}" ... />
    ...