8000 Add support for ElasticSearch mTLS by deni64k · Pull Request #656 · temporalio/helm-charts · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for ElasticSearch mTLS #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions charts/temporal/templates/_admintools-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,27 @@
value: {{ $driverConfig.version }}
- name: ES_VISIBILITY_INDEX
value: {{ $driverConfig.visibilityIndex }}
{{- with $driverConfig.tls }}
- name: ES_TLS
value: {{ .enabled | quote }}
{{- with .caFile }}
- name: ES_TLS_CA_FILE
value: {{ . }}
{{- end }}
{{- if and .certFile .keyFile }}
- name: ES_TLS_CERT_FILE
value: {{ .certFile }}
- name: ES_TLS_KEY_FILE
value: {{ .keyFile }}
{{- end }}
{{- with .serverName }}
- name: ES_TLS_SERVER_NAME
value: {{ . }}
{{- end }}
{{- with .enableHostVerification }}
- name: ES_TLS_ENABLE_HOST_VERIFICATION
value: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
24 changes: 23 additions & 1 deletion charts/temporal/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,31 @@ spec:
- name: check-elasticsearch-index
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
command: ['sh', '-c', 'until curl --silent --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT/$ES_VISIBILITY_INDEX 2>&1 > /dev/null; do echo waiting for elasticsearch index to become ready; sleep 1; done;']
command: ['sh', '-c']
args:
- |
CURL=curl;
if test "x${ES_TLS}" = "xtrue"; then
if test -n "$ES_TLS_CA_FILE"; then
CURL="$CURL --cacert $ES_TLS_CA_FILE";
fi;
if test -n "$ES_TLS_CERT_FILE" -a -n "$ES_TLS_KEY_FILE"; then
CURL="$CURL --cert $ES_TLS_CERT_FILE --key $ES_TLS_KEY_FILE";
fi;
if test "x${ES_TLS_ENABLE_HOST_VERIFICATION}" != "xtrue"; then
CURL="$CURL --insecure";
fi;
fi;
until $CURL --silent --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT/$ES_VISIBILITY_INDEX 2>&1 > /dev/null; do
echo waiting for elasticsearch index to become ready;
sleep 1;
done;
env:
{{- include "temporal.admintools-env" (list $ "visibility") | nindent 12 }}
{{- with $.Values.server.additionalVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
containers:
Expand Down
41 changes: 37 additions & 4 deletions charts/temporal/templates/server-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,26 @@ spec:
- name: check-elasticsearch
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
command: ['sh', '-c', 'until curl --silent --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT 2>&1 > /dev/null; do echo waiting for elasticsearch to start; sleep 1; done;']
command:
- sh
- -c
- |
CURL=curl;
if test "x${ES_TLS}" = "xtrue"; then
if test -n "$ES_TLS_CA_FILE"; then
CURL="$CURL --cacert $ES_TLS_CA_FILE";
fi;
if test -n "$ES_TLS_CERT_FILE" -a -n "$ES_TLS_KEY_FILE"; then
CURL="$CURL --cert $ES_TLS_CERT_FILE --key $ES_TLS_KEY_FILE";
fi;
if test "x${ES_TLS_ENABLE_HOST_VERIFICATION}" != "xtrue"; then
CURL="$CURL --insecure";
fi;
fi;
until $CURL --silent --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT 2>&1 > /dev/null; do
echo waiting for elasticsearch to start;
sleep 1;
done;
env:
{{- include "temporal.admintools-env" (list $ "visibility") | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -80,9 +99,23 @@ spec:
{{- else if eq $driver "elasticsearch" }}
command: ['sh', '-c']
args:
- 'curl -X PUT --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT/_template/temporal_visibility_v1_template -H "Content-Type: application/json" --data-binary "@schema/elasticsearch/visibility/index_template_$ES_VERSION.json" 2>&1 &&
curl --head --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT/$ES_VISIBILITY_INDEX 2>&1 ||
curl -X PUT --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT/$ES_VISIBILITY_INDEX 2>&1'
- |
CURL=curl;
if test "x${ES_TLS}" = "xtrue"; then
if test -n "$ES_TLS_CA_FILE"; then
CURL="$CURL --cacert $ES_TLS_CA_FILE";
fi;
if test -n "$ES_TLS_CERT_FILE" -a -n "$ES_TLS_KEY_FILE"; then
CURL="$CURL --cert $ES_TLS_CERT_FILE --key $ES_TLS_KEY_FILE";
fi;
if test "x${ES_TLS_ENABLE_HOST_VERIFICATION}" != "xtrue"; then
CURL="$CURL --insecure";
fi;
fi;
$CURL -X PUT --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT/_template/temporal_visibility_v1_template \
-H "Content-Type: application/json" --data-binary "@schema/elasticsearch/visibility/index_template_$ES_VERSION.json" 2>&1 &&
$CURL --head --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT/$ES_VISIBILITY_INDEX 2>&1 ||
$CURL -X PUT --fail --user "$ES_USER:$ES_PWD" $ES_SCHEME://$ES_HOST:$ES_PORT/$ES_VISIBILITY_INDEX 2>&1
{{- end }}
env:
{{- include "temporal.admintools-env" (list $ $store) | nindent 12 }}
Expand Down
0