OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Helm chart fails when enabling elasticsearch trustStore

Open cristiancalugaru opened this issue 4 years ago • 1 comments

Affected module Backend

Describe the bug When setting trustStore.enabled=true in a custom helm values.yaml for the openmetadata deployment and trying to helm install, there is an error thrown: Error: INSTALLATION FAILED: template: openmetadata/templates/deployment.yaml:144:34: executing "openmetadata/templates/deployment.yaml" at <.password.secretRef>: nil pointer evaluating interface {}.secretRef

The reason is a check in the deployment template, which does the following:

{{- with .Values.global.elasticsearch.trustStore.password }}
 - name: ELASTICSEARCH_TRUST_STORE_PASSWORD
       valueFrom:
       secretKeyRef:
          name: {{ .password.secretRef }}
           key: {{ .password.secretKey }}

the with clause has password in the end of the path, while the valueFrom clause also looks for .password.secretRef and .password.secretKey. A wrong path is created where password is duplicated. The with clause should not contain the end .password section.

Another issue is the if clause which checks if the trustStore is present or not:

{{- if .Values.global.elasticsearch.trustStore.enabled -}}
- name: ELASTICSEARCH_TRUST_STORE_PATH

With the end "-}}" this will not generate a new line before the ELASTICSEARCH_TRUST_STORE_PATH variable. Example:

- name: ELASTICSEARCH_PASSWORD
   valueFrom:
     secretKeyRef:
       name: elasticsearch-secrets
       key: openmetadata-elasticsearch-password- name: ELASTICSEARCH_TRUST_STORE_PATH
   value: /opt/truststore.jks

A valid similar example which operates correctly can be seen here:

{{- if .Values.global.jwtTokenConfiguration.enabled }}
- name: RSA_PUBLIC_KEY_FILE_PATH
value: "{{ .Values.global.jwtTokenConfiguration.rsapublicKeyFilePath }}"

Notice the missing end "-" in the if section. The same should apply for the trustStore.enabled check.

To Reproduce Install the openmetadata helm chart by setting the trustStore to true, e.g. sample:

global:
  elasticsearch:
    host: es-cluster.com
    port: 9200
    scheme: https
    connectionTimeoutSecs: 5
    socketTimeoutSecs: 60
    batchSize: 10
    trustStore:
      enabled: true
      path: /opt/truststore.jks
      password:
        secretRef: elasticsearch-truststore-secrets
        secretKey: openmetadata-elasticsearch-truststore-password

Screenshots or steps to reproduce

Expected behavior The helm install should successfully install openmetadata chart. Version:

  • OS: Linux
  • OpenMetadata version: 0.12.2

cristiancalugaru avatar Oct 26 '22 22:10 cristiancalugaru

Re-created this as an openmetadata-helm-charts issue where it belongs.

cristiancalugaru avatar Oct 27 '22 10:10 cristiancalugaru