_diskover.tpl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. {{- define "add.user" -}}
  2. {{- $user := .Values.es_user -}}
  3. {{- printf "adduser %s -D;" $user -}}
  4. {{- end -}}
  5. {{- define "change.user.permissions" -}}
  6. {{- $user := .Values.es_user -}}
  7. {{- $mountPath := .Values.elasticSearchAppVolumeMounts.esdata.mountPath -}}
  8. {{- printf "chown -R %s:%s %s;" $user $user $mountPath -}}
  9. {{- end -}}
  10. {{- define "elasticsearch.IP" -}}
  11. {{ $envList := (default list) }}
  12. {{ $envList = mustAppend $envList (dict "name" "ES_HOST" "value" (printf "%s" (include "common.names.fullname" .))) }}
  13. {{ $envList = mustAppend $envList (dict "name" "ES_PORT" "value" "9200") }}
  14. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) }}
  15. {{- end -}}
  16. {{- define "elasticsearch.credentials" -}}
  17. {{ $envList := (default list) }}
  18. {{ $envList = mustAppend $envList (dict "name" "ES_USER" "valueFromSecret" true "secretName" "elastic-search-credentials" "secretKey" "es-username") }}
  19. {{ $envList = mustAppend $envList (dict "name" "ES_PASS" "valueFromSecret" true "secretName" "elastic-search-credentials" "secretKey" "es-password") }}
  20. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) }}
  21. {{- end -}}
  22. {{- define "config.file.path" -}}
  23. {{ $envList := (default list) }}
  24. {{ $envList = mustAppend $envList (dict "name" "DEST" "value" .mountPath) }}
  25. {{ $envList = mustAppend $envList (dict "name" "FILE" "value" .configFile) }}
  26. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) }}
  27. {{- end -}}