Hello! I'm trying to deploy hydra using helm and I...
# talk-hydra
d
Hello! I'm trying to deploy hydra using helm and I'm struggling with some postgre configuration. Can I ask for your help please? I'm using the following:
Copy code
microk8s helm3 install hydra -n test \
    --set 'hydra.config.dsn=<postgres://operator>:<pwd>@<postgres-ip>:5432/postgres' \
    --set 'hydra.config.urls.self.issuer=<http://localhost:4444>' \
    --set 'hydra.config.urls.login=<http://localhost:3000/login>' \
    --set 'hydra.config.urls.consent=<http://localhost:3000/consent>' \
    --set 'hydra.dangerousForceHttp=true' \
    --set 'hydra.autoMigrate=true' \
    --set 'hydra.config.log.level=trace' \
    ory/hydra
The pod gets crashed with logs:
Copy code
time=2022-09-21T08:57:35Z level=debug msg=No SQL connection options have been defined, falling back to default connection options. audience=application service_name=Ory Hydra service_version=v1.11.8 sql_max_connection_lifetime=0s sql_max_connections=6 sql_max_idle_connection_time=0s sql_max_idle_connections=3
time=2022-09-21T08:57:35Z level=fatal msg=Could not ensure that signing keys for "hydra.openid.id-token" exists. If you are running against a persistent SQL database this is most likely because your "secrets.system" ("SECRETS_SYSTEM" environment variable) is not set or changed. When running with an SQL database backend you need to make sure that the secret is set and stays the same, unless when doing key rotation. This may also happen when you forget to run "hydra migrate sql"
I'm using the autoMigrate option which should run
hydra migrate sql
. The environment variables are also set in that pod and they are present in the hydra secret.
Copy code
Environment:
      URLS_SELF_ISSUER:  <http://localhost:4444>
      DSN:               <set to the key 'dsn' in secret 'hydra'>            Optional: false
      SECRETS_SYSTEM:    <set to the key 'secretsSystem' in secret 'hydra'>  Optional: false
      SECRETS_COOKIE:    <set to the key 'secretsCookie' in secret 'hydra'>  Optional: false
The same postgre connection string works for kratos. In this issue I read that 'The Hydra helm chart has an issue: it's not built for running your PostgresQL server in the same Kubernetes cluster as the helm chart'. Is that the case? My setup is a single node cluster in microk8s, similar to minikube.