-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helm: Allow using existing secrets for redis and mysql (#2156)
# What this PR does This PR adds the ability to use an existing secret for external Redis and external MySQL and it follows the same changes that PR #761 did for RabbitMQ (including the fix that was done for it later in #775) ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --------- Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
- Loading branch information
Showing
8 changed files
with
201 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,4 +109,3 @@ tests: | |
secretKeyRef: | ||
name: oncall-postgresql | ||
key: password | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
suite: test Redis password envs for deployments | ||
release: | ||
name: oncall | ||
templates: | ||
- engine/deployment.yaml | ||
- engine/job-migrate.yaml | ||
- celery/deployment-celery.yaml | ||
- secrets.yaml | ||
tests: | ||
- it: secrets -> should fail if externalRedis.password not set | ||
set: | ||
redis.enabled: false | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: externalRedis.password is required if not redis.enabled and not externalRedis.existingSecret | ||
template: secrets.yaml | ||
|
||
- it: externalRedis.password -> should create a Secret -redis-external | ||
templates: | ||
- engine/deployment.yaml | ||
- engine/job-migrate.yaml | ||
- celery/deployment-celery.yaml | ||
set: | ||
redis.enabled: false | ||
externalRedis: | ||
password: abcd123 | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: REDIS_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: oncall-redis-external | ||
key: redis-password | ||
- containsDocument: | ||
kind: Secret | ||
apiVersion: v1 | ||
name: oncall-redis-external | ||
template: secrets.yaml | ||
- equal: | ||
path: data.redis-password | ||
value: abcd123 | ||
decodeBase64: true | ||
documentIndex: 1 | ||
template: secrets.yaml | ||
|
||
- it: externalRedis.existingSecret -> should use existing secret | ||
templates: | ||
- engine/deployment.yaml | ||
- engine/job-migrate.yaml | ||
- celery/deployment-celery.yaml | ||
set: | ||
redis.enabled: false | ||
externalRedis: | ||
existingSecret: some-redis-secret | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: REDIS_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: some-redis-secret | ||
key: redis-password | ||
|
||
- it: externalRedis.passwordKey -> should be used for existing secret | ||
templates: | ||
- engine/deployment.yaml | ||
- engine/job-migrate.yaml | ||
- celery/deployment-celery.yaml | ||
set: | ||
redis.enabled: false | ||
externalRedis: | ||
existingSecret: some-redis-secret | ||
passwordKey: redis.key | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: REDIS_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: some-redis-secret | ||
key: redis.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters