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.Config struct's Secrets and TLSSecrets are now typed to *secret.FileProvider to highlight that this is the only supported provider type
  • The TLS configuration default path is set at /secrets/tls/infrastructure to allow for other non-Redis secrets to be read as well in a future iteration (PostgreSQL for example)
  • Password, SentinelPassword and TLS configurations are only available through secrets

ToDo

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.

Issue: gitlab-com/gl-infra/platform/runway/team#874 (closed)

Edited by Roger Makram

Merge request reports

Loading
Loading