hyperledger-bevel / bevel

An automation framework for rapidly and consistently deploying production-ready DLT platforms
https://hyperledger-bevel.readthedocs.io/en/latest/
Apache License 2.0
346 stars 719 forks source link

Installing Helm Genesis job using local charts and ansible controller fails if helm repo empty on controller #2633

Open michaelkhalsa opened 1 week ago

michaelkhalsa commented 1 week ago

Describe the bug When playbook reaches step to install the Genesis job using helm, the Ansible helm component, first runs an update. If the repo is empty, then the job fails with an error.

Because the helm is being deployed from a local chart, there is no prior step where a CRD in installed.

FIX Either add the following option to the role task in platforms/shared/configuration/create/job_component/tasks/main.yaml on task Run helm install skip_crds: true

Or else include in the instructions to add an external helm chart to the repo if empty test by running in terminal: helm list I used (in case would need this in future) helm repo add kfs https://kfsoftware.github.io/hlf-helm-charts --force-update

To Reproduce Steps to reproduce the behavior:

  1. Use main or develop branch (1.10)
  2. On controller, install all prerequisites (latest) and copy over latest binaries to reference bin directory (the versions installed by playbook are hopelessly out of date). Update flux_version from 2.3--> 2.4 in setup-k8s-environment.yaml
  3. Use an ansible controller with an empty helm repo
  4. See error

TASK [/home/ubuntu/bevel/platforms/hyperledger-fabric/configuration/../../shared/configuration/roles/create/job_component : Helm install genesis] ***** fatal: [localhost]: FAILED! => {"changed": false, "command": "/home/ubuntu/bin/helm repo update", "msg": "Failure when executing Helm command. Exited 1.\nstdout: \nstderr: Error: no repositories found. You must add one before updating\n", "stderr": "Error: no repositories found. You must add one before updating\n", "stderr_lines": ["Error: no repositories found. You must add one before updating"], "stdout": "", "stdout_lines": []}

PLAY RECAP localhost : ok=331 changed=90 unreachable=0 failed=1 skipped=189 rescued=0 ignored=0

Expected behavior To install the helm chart without an error

Environment (please complete the following information):

Additional context For your info, the prior step, and results of a debug prior to the failure to check the install path.

TASK [/home/ubuntu/bevel/platforms/hyperledger-fabric/configuration/../../shared/configuration/roles/create/job_component : Check if helm release already exists in mainorg-net] ** ok: [localhost]

TASK [/home/ubuntu/bevel/platforms/hyperledger-fabric/configuration/../../shared/configuration/roles/create/job_component : Helm install job component diagnostics - MVK] ***** ok: [localhost] => { "msg": [ "Componant Name: genesis", "Release Namespace: mainorg-net", "Chart Ref: /home/ubuntu/bevel/platforms/hyperledger-fabric/configuration/../../../platforms/hyperledger-fabric/charts/fabric-genesis", "Value Files: /home/ubuntu/bevel/platforms/hyperledger-fabric/configuration/../../../platforms/hyperledger-fabric/releases/dev/mainorg/genesis.yaml", "Kube Config File: /home/ubuntu/.kube/config" ] }