janus-idp / helm-backstage

Helm Chart for Deploying Backstage. This repo is deprecated. Please move to https://github.com/redhat-developer/rhdh-chart
https://redhat-developer.github.io/rhdh-chart/
Apache License 2.0
62 stars 53 forks source link

Unable to install RHDH helm chart on non-OpenShift cluster #155

Closed josephca closed 11 months ago

josephca commented 11 months ago

Describe the bug

Installing RHDH failed on non-OpenShift clusters even after enabling ingress.

Expected Behavior

RHDH is installed successfully and supports ingress with minimum configuration changes in values yarml.

What are the steps to reproduce this bug?

  1. login to non-OpenShift cluster
  2. create a namespace: kubectl create namespace rhdh
  3. create a quay pull secretkubectl apply -f rhdh-quay-pull-secret.yaml --namespace=rhdh
  4. run helm install by setting [ingress.enabled=true, route.enabled=false, global.host=[host-name]]
    helm upgrade -i developer-hub -n rhdh https://github.com/rhdh-bot/openshift-helm-charts/raw/developer-hub-1.0-190-CI/charts/redhat/redhat/developer-hub/1.0-190-CI/developer-hub-1.0-190-CI.tgz -f values_rhdh.yaml --set ingress.enabled=true --set route.enabled=false --set global.host=backstage.127.0.0.1.nip.io

    File used in the command line above:

  1. verify the install: kubectl get pods -n rhdh
    output: 
    NAME                             READY   STATUS                  RESTARTS      AGE
    developer-hub-849c59bfd6-7mmvl   0/1     Init:CrashLoopBackOff   5 (24s ago)   3m50s

    In addition, in the default 'values.yaml' file, 'upstream.ingress. ' should be located in 'ingress. ' like

ingress:
 enabled: true
 host: '{{ .Values.global.host }}'

Otherwise, helm install by using avalues.yaml file with the enabled ingress results in an error:

Error: YAML parse error on developer-hub/charts/upstream/templates/ingress.yaml: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{".Values.global.host":interface {}(nil)}

Versions of software used and environment

quay.io/rhdh/rhdh-hub-rhel9:1.0-190

tumido commented 11 months ago

In addition, in the default 'values.yaml' file, 'upstream.ingress. ' should be located in 'ingress. ' like

There is no top level ingress key. This comes from our dependency called upstream in the chart dependencies. This is not true. All this change does is that you don't get the ingress values propagated at all.

Otherwise, helm install by using avalues.yaml file with the enabled ingress result in an error:

This seems like a templating error, rather than value placement error. I'll look into it.

We regularly install this chart to a kind cluster, aka non-OCP cluster. It works fine. I suspect the error is elsewhere. We do not regularly propagate the host value though.

tumido commented 11 months ago

@josephca upstream.ingress.host is not being templated correctly. This PR in upstream chart should fix it:

https://github.com/backstage/charts/pull/153

FTR:

In addition, in the default 'values.yaml' file, 'upstream.ingress. ' should be located in 'ingress. ' like

You can always test if the values are propagating properly by running helm template. If you move ingress from upstream.ingress to YAML root and run helm template, you can actually see the values are not being used at all.

tumido commented 11 months ago

Quick workaround for you:

global:
  host: <host>
upstream:
  ingress:
    enabled: true
    host: <host_again>
route: 
  enabled: false
tumido commented 11 months ago

Should be resolved via https://github.com/janus-idp/helm-backstage/issues/155

josephca commented 11 months ago

Quick workaround for you:

global:
  host: <host>
upstream:
  ingress:
    enabled: true
    host: <host_again>
route: 
  enabled: false

Hi @tumido, I tried the workaround but still no luck. Can you try the workaround from your side and provide a values yaml file and command line that you run with it? I ran helm template command and verified that the ingress values are propagated with your fix. Thanks,