From 1e0e1c69116f407960a852e9407ac426e2510c82 Mon Sep 17 00:00:00 2001 From: Noah Krause Date: Thu, 11 Jun 2020 10:20:42 -0400 Subject: [PATCH] Create section for redis env vars in values Users would like to set the REDIS_PASSWORD to be read from a secret. The current way to configure env vars does not support this so we created another section for configuring the redis env Signed-off-by: Noah Krause --- CHANGELOG.md | 4 ++++ README.md | 1 + templates/deployment.yaml | 5 +++++ values.yaml | 10 ++++++++++ 4 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2085745b7..331b771e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file documents all notable changes to Ambassador Helm Chart. The release numbering uses [semantic versioning](http://semver.org). +## Next Release + +- redisEnv for setting environment variables to control how Ambassador interacts with redis. See [redis environment](https://www.getambassador.io/docs/latest/topics/running/environment/#redis) + ## v6.4.3 - Upgrade Ambassador to version 1.5.2: [CHANGELOG](https://github.com/datawire/ambassador/blob/master/CHANGELOG.md) diff --git a/README.md b/README.md index 743cf0575..9681fc4b1 100755 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ The following tables lists the configurable parameters of the Ambassador chart a | `licenseKey.createSecret` | Set to `false` if installing mutltiple Ambassdor Edge Stacks in a namespace. | `true` | | `licenseKey.secretName` | Name of the secret to store Ambassador license key in. | `` | | `redisURL` | URL of redis instance not created by the release | `""` | +| `redisEnv` | Set env vars that control how Ambassador interacts with redis. See [redis environment](https://www.getambassador.io/docs/latest/topics/running/environment/#redis) | `""` | | `redis.create` | Create a basic redis instance with default configurations | `true` | | `redis.annotations` | Annotations for the redis service and deployment | `""` | | `redis.resources` | Resource requests for the redis instance | `""` | diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 510c86b2b..0129801b6 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -187,12 +187,17 @@ spec: fieldRef: fieldPath: metadata.namespace {{- end -}} + {{- if .Values.redisEnv }} + {{ toYaml .Values.redisEnv | nindent 12 }} + {{- end }} {{- if .Values.env }} {{- range $key,$value := .Values.env }} + {{- if not (contains "REDIS" $key) }} - name: {{ $key | upper | quote}} value: {{ $value | quote}} {{- end }} {{- end }} + {{- end }} {{- with .Values.security.containerSecurityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/values.yaml b/values.yaml index 2e101e2d9..a2f297866 100644 --- a/values.yaml +++ b/values.yaml @@ -307,6 +307,16 @@ createDevPortalMappings: true # # URL of your redis instance. Defaults to redis instance created below. redisURL: +# Ambassador has a couple of environment variables that configure how it uses redis. +# See: https://www.getambassador.io/docs/latest/topics/running/environment/#redis +# This is interpreted as a YAML dictionary so format is the same as setting directly in Kubernetes YAML +redisEnv: +# - name: REDIS_PASSWORD +# value: password +# valueFrom: +# secretKeyRef: +# name: redis-password +# key: password # Ambassador ships with a basic redis instance. Configure the deployment with the options below. redis: create: true