sentry-kubernetes / charts

Easily deploy Sentry on your Kubernetes Cluster
MIT License
1.09k stars 516 forks source link

Error: couldn't find key postgresql-password in Secret #1433

Closed patsevanton closed 2 months ago

patsevanton commented 2 months ago

Issue submitter TODO list

Describe the bug (actual behavior)

k get pod  -n test | grep CreateContainerConfigError
sentry-cron-5986567d77-t2kpm       0/1     CreateContainerConfigError   0          64s
sentry-web-75dd588596-q7sp8        0/1     CreateContainerConfigError   0          64s
sentry-worker-5bdb4445f8-wnbxq     0/1     CreateContainerConfigError   0          64s

Events

k get event -n test | grep Error
3s          Warning   Failed                             pod/sentry-cron-5986567d77-t2kpm                                            Error: couldn't find key postgresql-password in Secret test/my-postgresql
20m         Warning   Unhealthy                          pod/sentry-rabbitmq-0                                                       Readiness probe failed: Error:...
19m         Warning   Failed                             pod/sentry-snuba-outcomes-consumer-6c4bf67d4b-gjmqn                         Error: secret "sentry-snuba-env" not found
20m         Warning   Failed                             pod/sentry-snuba-subscription-consumer-transactions-77f6d8b7c4zzvhk         Error: secret "sentry-snuba-env" not found
0s          Warning   Failed                             pod/sentry-web-75dd588596-q7sp8                                             Error: couldn't find key postgresql-password in Secret test/my-postgresql
6s          Warning   Failed                             pod/sentry-worker-5bdb4445f8-wnbxq                                          Error: couldn't find key postgresql-password in Secret test/my-postgresql

Expected behavior

install sentry helm chart without error

Your installation details

postgresql:
  enabled: false

externalPostgresql:
  host: my-postgresql.test.svc.cluster.local
  port: 5432
  username: postgres
  existingSecret: my-postgresql
  database: postgres

Steps to reproduce

helm install -n test my-postgresql bitnami/postgresql
write values.yaml
helm install -n test --wait sentry . --values values.yaml --timeout=1000s

Screenshots

No response

Logs

k get secret -n test my-postgresql -o yaml
apiVersion: v1
data:
  postgres-password: d29xRUJnNkN5Uw==
kind: Secret
metadata:
  annotations:
    meta.helm.sh/release-name: my-postgresql
    meta.helm.sh/release-namespace: test
  creationTimestamp: "2024-09-07T11:55:17Z"
  labels:
    app.kubernetes.io/instance: my-postgresql
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: postgresql
    app.kubernetes.io/version: 16.4.0
    helm.sh/chart: postgresql-15.5.28
  name: my-postgresql
  namespace: test
  resourceVersion: "893340"
  uid: 94a997b2-4a53-4cf0-b72e-4236dd956d9b
type: Opaque

Additional context

No response

patsevanton commented 2 months ago

show secret with key postgresql-password

k get secret -n test my-postgresql -o yaml
apiVersion: v1
data:
  postgresql-password: bUt3R1c5eGlsMA==
kind: Secret
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","data":{"postgresql-password":"bUt3R1c5eGlsMA=="},"kind":"Secret","metadata":{"annotations":{"meta.helm.sh/release-name":"my-postgresql","meta.helm.sh/release-namespace":"test"},"creationTimestamp":"2024-09-07T14:34:51Z","labels":{"app.kubernetes.io/instance":"my-postgresql","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"postgresql","app.kubernetes.io/version":"16.4.0","helm.sh/chart":"postgresql-15.5.28"},"name":"my-postgresql","namespace":"test","resourceVersion":"948000","uid":"e500c377-d044-4b45-a7bb-bf7cbd662da9"},"type":"Opaque"}
    meta.helm.sh/release-name: my-postgresql
    meta.helm.sh/release-namespace: test
  creationTimestamp: "2024-09-07T14:37:11Z"
  labels:
    app.kubernetes.io/instance: my-postgresql
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: postgresql
    app.kubernetes.io/version: 16.4.0
    helm.sh/chart: postgresql-15.5.28
  name: my-postgresql
  namespace: test
  resourceVersion: "948694"
  uid: 82e0e45b-81e2-4892-a4ac-e0561e3bc5bb
type: Opaque

Try install with values.yaml

postgresql:
  enabled: false
externalPostgresql:
  host: my-postgresql.test.svc.cluster.local
  port: 5432
  username: postgres
  existingSecret: my-postgresql
  database: postgres

error:

helm install -n test --wait sentry . --values values.yaml --timeout=1000s
coalesce.go:237: warning: skipped value for kafka.config: Not a table.
Error: INSTALLATION FAILED: template: sentry/templates/sentry/subscription-consumer/transactions/deployment-sentry-subscription-consumer-transactions.yaml:94:3: executing "sentry/templates/sentry/subscription-consumer/transactions/deployment-sentry-subscription-consumer-transactions.yaml" at <include "sentry.env" .>: error calling include: template: sentry/templates/_helper.tpl:518:24: executing "sentry.env" at <.Values.externalPostgresql.existingSecretKeys.password>: nil pointer evaluating interface {}.password