Skip to content

Commit 98268d9

Browse files
committed
Allow SSL
1 parent 69d1935 commit 98268d9

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if and (eq .Values.backend "opensearch") (.Values.opensearchSecurity.generateAdminPassword | default false) }}
2+
{{- include "stac-fastapi.configureOpensearchSecurity" . -}}
3+
{{- $secretName := include "stac-fastapi.opensearchAdminSecretName" . -}}
4+
{{- $existing := lookup "v1" "Secret" .Release.Namespace $secretName -}}
5+
{{- $usernameKey := default "username" .Values.opensearchSecurity.usernameKey -}}
6+
{{- $passwordKey := default "password" .Values.opensearchSecurity.passwordKey -}}
7+
{{- $username := default "admin" .Values.opensearchSecurity.username -}}
8+
{{- $passwordLength := int (default 32 .Values.opensearchSecurity.passwordLength) -}}
9+
{{- $passwordB64 := "" -}}
10+
{{- if and $existing (hasKey $existing.data $passwordKey) }}
11+
{{- $passwordB64 = index $existing.data $passwordKey -}}
12+
{{- else }}
13+
{{- $passwordB64 = randAlphaNum $passwordLength | b64enc -}}
14+
{{- end }}
15+
{{- $usernameB64 := b64enc $username -}}
16+
apiVersion: v1
17+
kind: Secret
18+
metadata:
19+
name: {{ $secretName }}
20+
labels:
21+
{{- include "stac-fastapi.labels" . | nindent 4 }}
22+
{{- with .Values.opensearchSecurity.annotations }}
23+
annotations:
24+
{{- toYaml . | nindent 4 }}
25+
{{- end }}
26+
type: Opaque
27+
data:
28+
{{ $usernameKey }}: {{ $usernameB64 }}
29+
{{ $passwordKey }}: {{ $passwordB64 }}
30+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- /*
2+
This template doesn't create resources; it mutates values so the
3+
OpenSearch subchart receives the generated admin credentials.
4+
*/ -}}
5+
{{- include "stac-fastapi.configureOpensearchSecurity" . -}}
6+
{{- if (and (eq .Values.backend "opensearch") (.Values.opensearch.enabled) (.Values.opensearchSecurity.generateAdminPassword | default false)) }}
7+
# debug-extraEnvs-count: {{ len (default (list) .Values.opensearch.extraEnvs) }}
8+
{{- range $env := (default (list) .Values.opensearch.extraEnvs) }}
9+
# debug-extraEnv: {{ toYaml $env | replace "\n" " " | trim }}
10+
{{- end }}
11+
{{- end }}

helm-chart/stac-fastapi/values-opensearch.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ app:
6969
ENABLE_DATETIME_INDEX_FILTERING: "true" # Enable for large datasets
7070
DATETIME_INDEX_MAX_SIZE_GB: "50"
7171
STAC_FASTAPI_RATE_LIMIT: "1000/minute"
72+
ES_USE_SSL: "true"
73+
ES_VERIFY_CERTS: "false"
7274

7375
# Optional: pull connection credentials from a secret managed by the
7476
# OpenSearch chart (or provide plain values via username/password).

0 commit comments

Comments
 (0)