Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-1464

[Helm] Unable to deploy the Orchestrator flavor when a custom npmrc Secret is present

XMLWordPrintable

    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • Release Note Not Required
    • RHDH Install 3277

      Description of problem:

      As depicted in our docs, if a user wants to load dynamic plugins from a custom NPM registry, they need to create an npmrc Secret named <release_name>-dynamic-plugins-npmrc (which should be automatically mounted into the RHDH init container).
      But doing so will conflict with the same secret that the Helm Chart will attempt to create when the Orchestrator flavor is enabled: https://github.com/redhat-developer/rhdh-chart/blob/197a1a4f4af94c0197eb13caf13f2800b728280b/charts/backstage/templates/dynamic-plugins-configmap.yaml#L26-L36

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      1. Clone the rhdh-chart repo
        git clone https://github.com/redhat-developer/rhdh-chart.git && cd rhdh-chart
        
      2. Deploy the orchestrator-infra chart as a cluster admin on OCP:
        helm install my-orchestrator-infra charts/orchestrator-infra \
          --set serverlessLogicOperator.subscription.spec.installPlanApproval=Automatic \
          --set serverlessOperator.subscription.spec.installPlanApproval=Automatic
        
      3. As depicted in the docs, create a Secret with the following content:
        apiVersion: v1
        kind: Secret
        metadata:
          # name: <release_name>-dynamic-plugins-npmrc
          name: my-backstage-orch-1-dynamic-plugins-npmrc
        type: Opaque
        stringData:
          .npmrc: |
            registry=my-registry.example.com
            //my-registry.example.com:_authToken=foo
        
      4. Now try to deploy a simple Helm Release named my-backstage-orch-1) of RHDH with the Orchestrator enabled:
        helm upgrade --install my-backstage-orch-1 \
          --set orchestrator.enabled=true
        

      Actual results:

      Helm complains that the npmrc Secret already exists but has invalid ownership:

      Release "my-backstage-orch-1" does not exist. Installing it now.
      Error: rendered manifests contain a resource that already exists. 
        Unable to continue with install: 
          Secret "my-backstage-orch-1-dynamic-plugins-npmrc" in namespace "my-ns" exists and cannot be imported into the current release: 
            invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation 
            error: missing key "meta.helm.sh/release-name": must be set to "my-backstage-orch-1"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "my-ns"
      

      This makes it impossible for users to load additional plugins from their custom NPM registry while enabling the Orchestrator flavor.

      Expected results:

      It should work, i.e., create the RHDH Deployment mounting the custom npmrc created by the user.

      Reproducibility (Always/Intermittent/Only Once):

      Always

              rh-ee-fndlovu Fortune Ndlovu
              rh-ee-asoro Armel Soro
              RHIDP - Install
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: