ServiceRegistry and PostgreSQL

Hello, Chris.

As of version 3.6.0-dev.1 of LEAFctl and the LEAF ServiceRegistry, you can perform the following to deploy a PostgreSQL data store and a ServiceRegistry configured to use it. Note that the following instructions are not intended for a production environment.

  1. Begin by ensuring your version of LEAFctl is 3.6.0-dev.1. Run leafctl to see the version printed.
    > leafctl
    
    LEAFctl
    
    Version: 3.6.0-dev.1 <-- Make sure the version is this or later
    
  2. Deploy PostgreSQL as you normally would.
    leafctl deploy postgresql
    
  3. Create a new values.yaml file to contain our PostgreSQL configuration in.
    a. The contents of the values.yaml would look something like:
    leaf-service:
      selector:
        dataServiceType: sql
      sql:
        connectionDriverClass: org.postgresql.Driver
        connectionUrl: jdbc:postgresql://postgresql.postgresql.svc.cluster.local/postgres
        connectionUsername: postgres
        connectionPassword: cG9zdGdyZXM=
        dialect: com.leidos.leaf.dataobject.service.dao.sql.dialect.LeafPostgresDialect
      virtualService: |
        hosts:
        - "*"
        gateways:
        - istio-system/istio-ingressgateway
        http:
          - match:
            - uri:
                prefix: /service-registry/
            rewrite:
              uri: /
            route:
            - destination:
                host: service-registry
      # Plus any other configuration you'd like to apply to the ServiceRegistry
    
  4. Deploy the ServiceRegistry with LEAFctl using the values.yaml above.
    leafctl deploy service-registry -f <path-to-values-yaml>
    

That should deploy the LEAF ServiceRegistry with the configuration it needs to use PostgreSQL as its data store.

Additional Notes

  • The 3.6.0-dev.1 image of the LEAF ServiceRegistry should be backwards compatible with generated services back to 3.3.0. However, we tested and found that even generated services on 3.2.0 could be registered with this latest ServiceRegistry. Since that is the case, there are no plans at this moment to port this feature back to older versions of the ServiceRegistry. If you encounter any problems with backwards compatibility, reach out and we can try to address them.