Custom JDBC drivers

Optionally, you can use a custom JDBC driver to connect to PostgreSQL. To do so, you must include the JDBC driver in a container image to be recognized by Decision Intelligence Client Managed Software.

Procedure

  1. Create a Dockerfile.
    Example Dockerfile to build an image that contains a JDBC driver:
    FROM registry.access.redhat.com/ubi9-minimal:9.5
    ARG POSTGRESQL_DRIVER_VERSION
    RUN mkdir -p /jdbc/postgresql \
        && curl -sSL -o /jdbc/postgresql/postgresql-${POSTGRESQL_DRIVER_VERSION}.jar https://jdbc.postgresql.org/download/postgresql-${POSTGRESQL_DRIVER_VERSION}.jar
  2. Build an image by using the Dockerfile.
    Run the following docker build command:
    docker build . \
        --build-arg POSTGRESQL_DRIVER_VERSION="42.7.7" \
        -t myregistry/custom_jdbc_driver:0.0.1
  3. Push the image to a container registry that is accessible from the Kubernetes cluster.
  4. Optional: If the image is in a private container registry, create a secret that contains its credentials and set it up in the custom resources (CR) file.
    1. You can create the secret by using the following command:
      kubectl create secret docker-registry myregistry-crendentials \
                            --namespace <ads-namespace> \
                            --docker-server=<server> \
                            --docker-username=<user> \
                            --docker-password=<password>
    2. Set this secret to the spec.image_pull_secrets parameter in the CR at a later stage in the installation. Also, add a pull secret for the Decision Intelligence image to the CR: for example, ibm-entitlement-key.
      Example in the CR:
      ...
      spec:
        image_pull_secrets:
          - "ibm-entitlement-key"
          - "myregistry-crendentials"
      ...

      For more information about the entitlement key, see Getting an IBM entitlement API key.