FIWARE / helm-charts

:globe_with_meridians: Kubernetes HELM Charts for FIWARE Generic Enablers for provisioning scalable, production-ready powered-by-FIWARE installations based around NGSI Context Brokers and other components
MIT License
23 stars 31 forks source link

Error in installation of Orion broker helm chart #125

Closed KeshavSoni2511 closed 1 year ago

KeshavSoni2511 commented 2 years ago

I am trying to deploy orion broker through helm and I am facing this issue :-

Error: INSTALLATION FAILED: template: orion/templates/test/orion-test.yaml:1:14: executing "orion/templates/test/orion-test.yaml" at <.Values.test.enabled>: nil pointer evaluating interface {}.enabled

The command which I am using to install it is :- sudo helm repo add fiware https://fiware.github.io/helm-charts sudo helm install fiware/orion --generate-name

I wasn't facing this issue earlier. Can you please help me to resolve it?

Thanks & Regards, Keshav

lopdan commented 1 year ago

Hi Keshav,

I just faced the same issue as you. This occurs because the .Values tree is populated based on the input provided through values.yaml, --values, --set, etc. It is not populated based on how the templates consume the input. If a value is not set, .Values has no knowledge of this sub-tree, and therefore it is evaluated as a nil object when rendered through text/template.

As you can see if you look into orion/templates/test/orion-test.yaml, there is a value which is not found on orion/values.yaml, the one triggering your error: <.Values.test.enabled>. To solve this the maintainer should add the value into the chart, until that happens the workaround is to deploy orion broker with the helm sources locally, adding the value manually.

  1. Clone this repository, edit the file orion/values.yaml and add this at the end of the file (you can change it to false):

    test:
    enabled: true
  2. Install the helm chart (from helm-charts/charts):

    helm install orion-chart orion/ --values orion/values.yaml
  3. After this the orion broker should be deployed and running:

    
    NAME                                     READY   STATUS    RESTARTS   AGE
    pod/orion-chart-9f9c6b8f6-x6hz8          1/1     Running   0          2m22s
    pod/orion-chart-mongo-5d46588547-wnz5q   1/1     Running   0          2m22s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/kubernetes ClusterIP 10.96.0.1 443/TCP 11m service/orion-chart ClusterIP 10.99.67.101 1026/TCP 2m22s service/orion-chart-mongo ClusterIP 10.100.71.166 27017/TCP 2m22s

NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/orion-chart 1/1 1 1 2m22s deployment.apps/orion-chart-mongo 1/1 1 1 2m22s

NAME DESIRED CURRENT READY AGE replicaset.apps/orion-chart-9f9c6b8f6 1 1 1 2m22s replicaset.apps/orion-chart-mongo-5d46588547 1 1 1 2m22s

wistefan commented 1 year ago

Hello, sorry, I forgot to set the default-value. Its fixed in the new 1.0.10 chart. Thanks @lopdan for pointing out a solution. Best