feat(infrastructure): Add config option for Redis
What
Adds a new New(ctx, opts...) constructor that loads the Redis dependency configuration from a Fairway infrastructure requirements file (default location in /etc/fairway/dependencies.yaml) and reads the username, password, sentinel username and sentinel password from a secret mount (defaults to /secrets/infrastructure/) and the TLS configurations from the new standard path (defaults to /secrets/tls/infrastructure/).
This is very similar to the work previously done for PostgreSQL in !458 (merged).
Highlights
- The
New()constructor takes optional configurations to override some of its content - The
infrastructure.Configstruct'sSecretsandTLSSecretsare now typed to*secret.FileProviderto highlight that this is the only supported provider type - The TLS configuration default path is set at
/secrets/tls/infrastructureto allow for other non-Redis secrets to be read as well in a future iteration (PostgreSQL for example) Password,SentinelPasswordand TLS configurations are only available through secrets
ToDo
- Add support for reading the TLSConfig
- Pin to the released version of Fairway once gitlab-com/gl-infra/platform/runway/fairway!82 (merged) is merged/released
Why
This will allow service owners to leverage Fairway-generated Helm chart and be able to read the Redis configurations from the provided values.yaml file at deploy time.
Follow-up
Update the Redis secret fields to be configurable via projections, similar to how it's done for PostgreSQL.
Links to relevant issues
Issue: gitlab-com/gl-infra/platform/runway/team#874 (closed)