k8s icon indicating copy to clipboard operation
k8s copied to clipboard

Hydra's deployment with Helm fails

Open gheibia opened this issue 3 years ago • 3 comments

Preflight checklist

Describe the bug

Deploying Hydra using Helm fails with

Error: INSTALLATION FAILED: template: hydra/templates/deployment.yaml:95:15: executing "hydra/templates/deployment.yaml" at <include "hydra.utils.joinListWithComma" .Values.hydra.dangerousAllowInsecureRedirectUrls>: error calling include: template: hydra/templates/_helpers.tpl:147:20: executing "hydra.utils.joinListWithComma" at <.>: range can't iterate over true

Reproducing the bug

Clone the Helm repo

Execute helm install ory-hydra helm/charts/hydra --values .circleci/values/hydra.yaml

Relevant log output

No response

Relevant configuration

No response

Version

Latest

On which operating system are you observing this issue?

macOS

In which environment are you deploying?

Kubernetes with Helm

Additional Context

I can work around this by removing the following sections from helm/charts/hydra/templates/deployment.yaml

{{ include "hydra.utils.joinListWithComma" .Values.hydra.dangerousAllowInsecureRedirectUrls | quote }},

gheibia avatar Jul 14 '22 21:07 gheibia

Hi there, sadly I could not reproduce your problem with the installation:

$ make kind-start
$ make postgresql
$ helm install ory-hydra helm/charts/hydra --values .circleci/values/hydra.yaml
NAME: ory-hydra
LAST DEPLOYED: Wed Jul 20 14:39:21 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1

$ helm ls
NAME      	NAMESPACE	REVISION	UPDATED                              	STATUS  	CHART             	APP VERSION
ory-hydra 	default  	1       	2022-07-20 14:39:21.914077 +0200 CEST	deployed	hydra-0.24.1      	v1.10.5
postgresql	default  	1       	2022-07-20 14:39:04.023192 +0200 CEST	deployed	postgresql-11.6.17	14.4.0

Can you post the version of helm used?

Demonsthere avatar Jul 20 '22 12:07 Demonsthere

I'm using 3.8.1.

I think the reason I can reproduce it is because I've set dangerousAllowInsecureRedirectUrls value like so:

hydra:
  autoMigrate: true
  dangerousForceHttp: true
  dangerousAllowInsecureRedirectUrls: true

The template expects this to be a list: https://github.com/ory/k8s/blob/master/helm/charts/hydra/templates/deployment.yaml#L97

On the other hand, the value file accompanying the charts sets this to false: https://github.com/ory/k8s/blob/master/helm/charts/hydra/values.yaml

This is also the case in the README file.

gheibia avatar Jul 29 '22 00:07 gheibia

Hi there, i think i found the source of the confusion here :) In the cli docs the parameter is expecting a string list of urls, and that is what we expect in the chart ("foo,bar,baz"). The default value of false is there to allow the conditional to be a simple one parameter if, as otherwise the value would need to be parsed like this

hydra:
  dangerousAllowInsecureRedirectUrls:
    enabled: true
    urls: "foo, bar, baz"

Please keep in mind that this will soon be deprecated by the new simplified --dev flag in the new hydra :)

Demonsthere avatar Jul 29 '22 07:07 Demonsthere