apexdesigner / apex-cluster-manager

0 stars 0 forks source link

Conditional Values Templates #61

Closed dave-apex closed 2 years ago

dave-apex commented 2 years ago

We should provide a way to handle conditional portions of the values template. Here is a proposed example:

{
  valuesTemplate: {
    appName: '${name}',
    service: {
      nodePort: '${port}'
    },
    environmentVariables: {
      adminEmails: '${adminEmails}',
      $includeIf: [
        {
          expression: 'camunda',
          values: {
            'ZEEBE_ADDRESS': 'http://${camunda}-zeebe-gateway:26500',
            elasticsearchConfiguration: '{ "node": "http://elasticsearch-master-headless:9200" }'
          }
        },
        {
          expression: 'postgres',
          values: {
            PGHOST: '${postgres}-postgresql',
            PGPORT: 5432,
            PGDATABASE: 'apex-process-admin',
            PGUSER: 'postgres',
            databaseSSL: false
          }
        },
      ],
      zeebeBpmnProcessIdFilter: '*'
    },
    $includeIf: [
      {
        expression: 'postgres',
        values: {
          environmentVariablesFromSecrets: {
            PGPASSWORD: {
              name: '${postgres}-postgresql',
              key: 'postgres-password'
            }
          }
        }
      }
    ]
  }
}
dave-apex commented 2 years ago

This is included in version 0.0.21