Use an External Service#

You may want to refer to an external service rather than the small-scale services running in the cluster from a reference deployment.

Examples include:

  • PostgreSQL

  • MongoDB

  • Elasticsearch

Note

In the examples below, to determine the secrets and config maps used by ESS, refer to the deployment.yaml files for a particular service or services. Specifically, you will see secretKeyRef and configMapRef in the files.

Example Customization for Events#

In the example below, the ESS uses kafka-credentials as its store for secrets, and the customization provides a replacement set of secrets.

  1. Create an overlay structure as described in Customize ESS.

  2. Add the customization overlay:

    #kustomization.yaml
    
    ...
    
    secretGenerator:
       -  name: kafka-credentials
          behavior: replace
          envs:
             - kafka-credentials.env
    
    #kafka-credentials.env
    
    BOOTSTRAP_SERVERS=remotehost-1:9092,remotehost-2:9092
    

Example Customization for Pod Storage#

In the example below, the ESS deployment uses postgres-credentials as its store for secrets, and the customization provides a set of secrets which replaces the defaults. In addition, the customization also changes the POSTGRES_DB.

  1. Create an overlay structure as described in Customize ESS.

  2. Add the customization:

    #kustomization.yaml
    
    ...
    
    secretGenerator:
       -  name: postgres-credentials
          behavior: replace
          envs:
             - postgres-credentials.env
    
    #postgres-credentials.env
    
    POSTGRES_USER=user-224239c3-a492-4589-a58e-4329a0e51cad
    POSTGRES_PASSWORD=password=b248e58c-392d-463b-b6a2-79725ee34614
    
    POSTGRES_HOST="remote-postgres"
    POSTGRES_PORT="5432"
    
    POSTGRES_DB=pods
    
    JDBC_URL=jdbc:postgresql://remote-postgres:5432/pods
    
    #Special format for postgres-metrics to consume
    METRICS_STYLE_URL=remote-postgres:5432/pods?sslmode=enable