jfrog / charts

JFrog official Helm Charts
https://jfrog.com/integration/helm-repository/
Apache License 2.0
262 stars 447 forks source link

xray template does not process key external database values #1619

Closed kishubhatta closed 2 years ago

kishubhatta commented 2 years ago

Is this a request for help?: NO


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Version of Helm and Kubernetes: Helm3, k8s 1.20

Which chart: XRay

What happened: Deploying XRay with external database fails on DB connectiivty

What you expected to happen: helm deployment is successful

How to reproduce it (as minimally and precisely as possible): deploy Xray helm chart with external database

Anything else we need to know: the helm values database.url, database.user and database.password do not make it to system.yaml. This is basic functionality.

chukka commented 2 years ago

@kishubhatta can you share database.url value

kishubhatta commented 2 years ago

@chukka it was postgres://127.0.0.1:5432/xray?sslmode=disable. The same value works when overriding via the value xray.systemYaml

chukka commented 2 years ago

@kishubhatta is Xray and postgresql on same host ? can you share complete values.yaml file and also helm share helm commands to install to debug further

kishubhatta commented 2 years ago

@chukka as mentioned in the issue title, my db is external. I'm not using values.yaml, just setting helm cmd-line values like below.

  database.url=postgres://{IP}:5432/xray?sslmode=disable
  database.username=foo
  database.password=bar

This is easily reproducible for me (values don't go into xray system.yaml), is it not the case at your end?

chukka commented 2 years ago

I would recommend passing database.url value postgres://{IP}:5432/xray?sslmode=disable in quotes

kishubhatta commented 2 years ago

@chukka passing the helm command line value in double-quotes did not help. Have you checked the block you have in https://github.com/jfrog/charts/blob/master/stable/xray/values.yaml#L153 that appears to be including only values for type and driver i.e skipping over the other values supplied - url, database and password?

chukka commented 2 years ago

@kishubhatta url, database and password are set using env variables not using systemYaml

Sorry, unless you provide helm commands I can't debug further.

chukka commented 2 years ago

if you have an Enterprise plus or Pro license, you are entitled to support. Please open a ticket and link this issue there. Our support team will be able help you further

kishubhatta commented 2 years ago

@chukka the helm command would be something like below

helm --kubeconfig=kube.config upgrade --install xray --namespace {namespace} jfrog/xray \
   --set xray.masterKeySecretName=my-masterkey-secret \
   --set xray.joinKeySecretName=my-joinkey-secret \
   --set xray.jfrogUrl=https://{FQDN}
   --set database.url=postgres://{IP}:5432/xray?sslmode=disable
   --set database.username=foo
   --set database.password=bar

I was told for helm chart issues issues, this is the appropriate channel. Have you revisted https://github.com/jfrog/charts/blob/master/stable/xray/templates/xray-system-yaml.yaml? This is using the xray.systemYaml value, and then the secret is mounted with name systemyaml in the initContainer copy-system-yaml. If these are unused, how is it that value for xray.systemYaml actually makes the deployment successful?

Also do you mean using the secrets for these values can help instead? ref: https://github.com/jfrog/charts/blob/master/stable/xray/values.yaml#L349.

chukka commented 2 years ago

you need to set postgresql.enabled=false to use external database settings , please try this

kishubhatta commented 2 years ago

@chukka postgresql.enabled=false is already set.

chukka commented 2 years ago

@kishubhatta you just need to set them in values.yaml file, no need to use secrets .if you have E+ /Pro license . please reach to jfrog support they can look at your instance and help you further .

kishubhatta commented 2 years ago

@chukka I have E+ pro license, but I'm disappointed that my comments are not even being reviewed in its entirety. I tried to make the bridge by spending my time digging into your code and provide links - they were simply ignored.

kishubhatta commented 2 years ago

Turns out had to use database.user instead of database.username. @chukka fyi, your colleague David Shin spotted this.

chukka commented 2 years ago

@kishubhatta Glad your issue is resolved, I routed your request to support to help you :)