Justas Glodenis
Justas Glodenis

Reputation: 115

Helmfile Secrets Not Created in Namespace During Deployment

I'm using Helmfile to deploy my own Helm chart along with PostgreSQL, but I'm running into an issue where secrets are not being created in the namespace at all. This causes PostgreSQL and Redis to fail because they expect existing secrets for credentials.

Setup My deployment consists of the following:

helm/
  project/
    helmfile.yaml
    environments/
      base/
        secrets.yaml
        another-secret.yaml
        values.yaml
      prd/
        secrets.yaml
        another-secret.yaml
        values.yaml
      acc/
        secrets.yaml
        another-secret.yaml
        values.yaml
      dev/
        secrets.yaml
        another-secret.yaml
        values.yaml
    charts/
    templates/
    .sops.yaml
    Chart.lock
    Chart.yaml

Issue

Example Values, Secrets and helmfile

#base values
MyPostgres:
  auth:
    existingSecret: "database-credentials-mypostgres"
    secretKeys:
      adminPasswordKey: "admin-password"
      userPasswordKey: "user-password"
    username: "myusername"
    database: "my_db"
#environment values
MyPostgres:
  primary:
    resources:
      requests:
        ...
      limits:
        ...
#decrypted secret file
apiVersion: v1
kind: Secret
metadata:
    name: database-credentials-mypostgres
type: Opaque
stringData:
    admin-password: admin-pass
    user-password: user-pass

#helm file
environments:
  dev: {}
  acc: {}
  prd: {}

releases:
...
    values:
      - environments/base/values.yaml
      - environments/{{ .Environment.Name }}/values.yaml
    secrets:
      - environments/base/secrets.yaml
      - environments/{{ .Environment.Name }}/secrets.yaml
...

Question

Why are my secrets not being created at all? How can I make sure Helmfile properly initializes them before dependent charts like PostgreSQL and Redis attempt to use them?

Any insights or debugging tips would be greatly appreciated!

Upvotes: 0

Views: 54

Answers (0)

Related Questions