sensu / sensu-docs

Sensu documentation
https://docs.sensu.io
MIT License
42 stars 54 forks source link

Describe configuration of Postgres datastore via environment variables. #4021

Closed asachs01 closed 2 years ago

asachs01 commented 2 years ago

Description

Category

This is an issue with:

Affected pages

https://docs.sensu.io/sensu-go/latest/operations/deploy-sensu/datastore/

Expected behavior

As part of a recent discussion with Engineering, it came to light that it's entirely possible to configure the Postgres DSN using environment variables using the existing library we utilize when making connections to postgres (see https://www.postgresql.org/docs/current/libpq-envars.html). The docs should provide some example of a config illustrating the configuration via environment variables.

Current behavior

We don't presently have any discussion or breadcrumbs of what's possible with environment variables.

Corrections needed

Screenshots

Additional context

It is entirely possible to use something like:

Sensu Postgres Config

type: PostgresConfig
api_version: store/v1
metadata:
  name: sachshaus_postgres
spec:
  dsn: "postgresql://postgres.example.com?sslmode=disable"
  pool_size: 20
  strict: true

Sensu environment variable configuration

PGUSER=SOMEUSER
PGPASSWORD=SOMEPASSWORD
PGPORT=5432
PGDATABASE=sensu_events

This is worth highlighting for several recent use cases we've encountered.

hillaryfraley commented 2 years ago

Slack discussions: