Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/sentry] Makes changing the secreyKey possible #19938

Merged
merged 4 commits into from
Jan 8, 2020
Merged

[stable/sentry] Makes changing the secreyKey possible #19938

merged 4 commits into from
Jan 8, 2020

Conversation

wilmardo
Copy link
Contributor

@wilmardo wilmardo commented Jan 8, 2020

What this PR does / why we need it:

  • Documents the existingSecret variables of email, postgres and redis. These variables where already in the (upstream) chart but undocumented in the README and values.yaml
  • Makes it possible to set what key to get from the secrets.

In our we cluster we use a postgres-operator which supplies a credentials secret with the password under the password key not the postgres-password key. This change allows us to keep using the operator for the database.

Special notes for your reviewer:

This should be backward compatible since it defaults to the previous hardcoded values.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [stable/mychartname])

Signed-off-by: wilmardo <info@wilmardenouden.nl>
Signed-off-by: wilmardo <info@wilmardenouden.nl>
Signed-off-by: wilmardo <info@wilmardenouden.nl>
Signed-off-by: wilmardo <info@wilmardenouden.nl>
@helm-bot helm-bot added Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 8, 2020
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 8, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @wilmardo. Thanks for your PR.

I'm waiting for a helm member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@okgolove
Copy link
Collaborator

okgolove commented Jan 8, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 8, 2020
@okgolove
Copy link
Collaborator

okgolove commented Jan 8, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2020
@okgolove
Copy link
Collaborator

okgolove commented Jan 8, 2020

/lgtm cancel

@k8s-ci-robot k8s-ci-robot removed lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 8, 2020
@okgolove
Copy link
Collaborator

okgolove commented Jan 8, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 8, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: okgolove, wilmardo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2020
@k8s-ci-robot k8s-ci-robot merged commit 61c2cc0 into helm:master Jan 8, 2020
@lalinsky
Copy link

FYI, this PR broke the option to set passwords directly.

@@ -22,9 +22,9 @@ data:
{{ else }}
user-password: {{ randAlphaNum 16 | b64enc | quote }}
{{ end }}
{{ if or (not .Values.postgresql.enabled) (.Values.postgresql.password) }}
{{ if and (.Values.postgresql.existingSecret) (or (not .Values.postgresql.enabled) (.Values.postgresql.password)) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why need it here? It looks wrong for me. Originally password will save to this secret only if postgresql.enabled is set to false and have password settings in postgresql.password, which allow using this kind of config:

postgresql:
  # internal PG is disabled, not need to deploy postgresql to kubernetes
  enabled: false
  persistence:
    enabled: false
  # use RDS settings here
  postgresqlHost: 99.111.222.333
  postgresqlDatabase: sentry
  postgresqlUsername: sentry
  postgresqlPassword: "my_db_password_here"
  postgresqlPort: 5432

Which allow Sentry to connect to external PostgreSQL instance.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I missed this.

@donbeave
Copy link
Contributor

@wilmardo @okgolove can you revert changes in stable/sentry/templates/secrets.yaml file?

@wilmardo
Copy link
Contributor Author

@donbeave Will do, PR coming in 15 minutes tops :)

Sorry for the regression!

@donbeave
Copy link
Contributor

@wilmardo no problem! Thank you for the fix.

dargolith pushed a commit to dargolith/charts that referenced this pull request Jan 10, 2020
* feat: make specifiying email secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* feat: make specifiying postgresql secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* feat: make specifiying redis secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* chore: bump chartVersion

Signed-off-by: wilmardo <info@wilmardenouden.nl>
arturrez pushed a commit to arturrez/stable-charts that referenced this pull request Jan 28, 2020
* feat: make specifiying email secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* feat: make specifiying postgresql secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* feat: make specifiying redis secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* chore: bump chartVersion

Signed-off-by: wilmardo <info@wilmardenouden.nl>
Signed-off-by: Artur <artur@upbound.io>
arturrez pushed a commit to arturrez/stable-charts that referenced this pull request Jan 28, 2020
* feat: make specifiying email secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* feat: make specifiying postgresql secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* feat: make specifiying redis secret key possible

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* chore: bump chartVersion

Signed-off-by: wilmardo <info@wilmardenouden.nl>
Signed-off-by: Artur <artur@upbound.io>
@guanzo
Copy link

guanzo commented Mar 13, 2020

@wilmardo setting email.existingSecretKey doesn't work, the final value is always smtp-password. setting email.existingSecret does work.

I'm looking through the template files of stable/sentry 4.0.1, and the only template that actually checks for email.existingSecretKey is cron-deployment.yaml. Other files that check for email.existingSecret do not check for email.existingSecretKey, these files are: web-deployment.yaml, workers-deployment.yaml, db-init.job.yaml, and user-create.job.yaml.

Is this an oversight? Or am i missing something.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lgtm Indicates that a PR is ready to be merged. ok-to-test size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants