Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update hydra readme #519

Merged
merged 2 commits into from Oct 5, 2022
Merged

Conversation

natalian98
Copy link
Contributor

This PR updates the hydra helm chart install documentation.
It adds a misplaced part about k8s secrets, updates the autoMigrate config option to automigration and introduces some other minor changes.

Related Issue or Design Document

none

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact security@ory.sh) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

Following the tutorial with a postgre database deployed in the same cluster:

microk8s helm3 install hydra -n test \
    --set 'hydra.config.dsn=postgres://operator:<pwd>@<postgre-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

It looks that hydra doesn't recognize the db:

$ kubectl logs hydra-7c565d9475-79n7k -n test
time=2022-09-26T10:34:09Z level=info msg=No tracer configured - skipping tracing setup audience=application service_name=Ory Hydra service_version=v1.11.8
time=2022-09-26T10:34:09Z 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=16 sql_max_idle_connection_time=0s sql_max_idle_connections=8
time=2022-09-26T10:34:09Z 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".. audience=application error=map[debug: message:Unable to locate the table reason: stack_trace:
github.com/ory/x/sqlcon.handlePostgres
    /go/pkg/mod/github.com/ory/x@v0.0.368/sqlcon/error.go:56
github.com/ory/x/sqlcon.HandleError
    /go/pkg/mod/github.com/ory/x@v0.0.368/sqlcon/error.go:75
github.com/ory/hydra/persistence/sql.(*Persister).GetKeySet
    /project/persistence/sql/persister_jwk.go:139
github.com/ory/hydra/jwk.GetOrGenerateKeys
    /project/jwk/helper.go:47
github.com/ory/hydra/jwk.EnsureAsymmetricKeypairExists
    /project/jwk/helper.go:42
github.com/ory/hydra/driver.(*RegistryBase).newKeyStrategy
    /project/driver/registry_base.go:383
github.com/ory/hydra/driver.(*RegistryBase).OpenIDJWTStrategy
    /project/driver/registry_base.go:414
github.com/ory/hydra/driver.(*RegistryBase).OAuth2Provider
    /project/driver/registry_base.go:320
github.com/ory/hydra/driver.CallRegistry
    /project/driver/registry.go:101
github.com/ory/hydra/driver.New
    /project/driver/factory.go:81
github.com/ory/hydra/cmd/server.RunServeAll
    /project/cmd/server/handler.go:143
github.com/spf13/cobra.(*Command).execute
    /go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860
github.com/spf13/cobra.(*Command).ExecuteC
    /go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974
github.com/spf13/cobra.(*Command).Execute
    /go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
github.com/ory/hydra/cmd.Execute
    /project/cmd/root.go:87
main.main
    /project/main.go:33
runtime.main
    /usr/local/go/src/runtime/proc.go:255
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1581 status:Internal Server Error status_code:500] service_name=Ory Hydra service_version=v1.11.8

It suggests that the connection can't be established, in fact the hydra migrate sql doesn't run because autoMigrate was possibly renamed to automigration.
The following spins up a hydra-automigrate pod during deployment:

microk8s helm3 install hydra -n test \
    ...
    --set 'hydra.automigration.enabled=true' \
    ...
    ory/hydra

It should also be updated on the official docs page.

Copy link
Collaborator

@Demonsthere Demonsthere left a comment

Choose a reason for hiding this comment

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

Thanks for the input :) The docs are sadly as pointed out outdated and need to catch up to the charts, which change more often. I have added some comments regarding the automigration changes :)

docs/helm/hydra.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@Demonsthere Demonsthere left a comment

Choose a reason for hiding this comment

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

Thanks :)

@Demonsthere Demonsthere merged commit c4e5494 into ory:master Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants