Skip to content

Commit

Permalink
update toolset pulsar connect logic
Browse files Browse the repository at this point in the history
Signed-off-by: ericsyh <[email protected]>
  • Loading branch information
ericsyh committed Nov 27, 2023
1 parent bde9642 commit b94f9ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
8 changes: 0 additions & 8 deletions charts/sn-platform-slim/templates/toolset/_toolset.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,11 @@ Define the toolset web service url
*/}}
{{- define "toolset.web.service.url" -}}
{{- if not .Values.toolset.useProxy -}}
{{- if and .Values.tls.enabled .Values.tls.broker.enabled -}}
https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}:{{ .Values.broker.ports.https }}
{{- else -}}
http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}:{{ .Values.broker.ports.http }}
{{- end -}}
{{- else -}}
{{- if and .Values.tls.enabled .Values.tls.proxy.enabled -}}
https://{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}:{{ .Values.proxy.ports.https }}
{{- else -}}
http://{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}:{{ .Values.proxy.ports.http }}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Define pulsarctl config volume mount
Expand Down
33 changes: 1 addition & 32 deletions charts/sn-platform-slim/templates/toolset/toolset-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,13 @@ data:
{{- include "pulsar.bookkeeper.config.common" . | nindent 2 }}
{{- if not .Values.toolset.useProxy }}
# talk to broker
{{- if and .Values.tls.enabled .Values.tls.broker.enabled }}
webServiceUrl: "https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-headless:{{ .Values.broker.ports.https }}/"
brokerServiceUrl: "pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-headless:{{ .Values.broker.ports.pulsarssl }}/"
useTls: "true"
tlsAllowInsecureConnection: "false"
tlsTrustCertsFilePath: "/pulsar/certs/ca/ca.crt"
tlsEnableHostnameVerification: "false"
{{- else }}
webServiceUrl: "http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-headless:{{ .Values.broker.ports.http }}/"
brokerServiceUrl: "pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-headless:{{ .Values.broker.ports.pulsar }}/"
{{- end }}
{{- end }}
{{- if .Values.toolset.useProxy }}
{{- else }}
# talk to proxy
{{- if and .Values.tls.enabled .Values.tls.proxy.enabled }}
webServiceUrl: "https://{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}-headless:{{ .Values.proxy.ports.https }}/"
brokerServiceUrl: "pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}-headless:{{ .Values.proxy.ports.pulsarssl }}/"
useTls: "true"
tlsAllowInsecureConnection: "false"
{{- if .Values.tls.proxy.untrustedCa }}
tlsTrustCertsFilePath: "/pulsar/certs/proxy-ca/ca.crt"
{{- end }}
tlsEnableHostnameVerification: "false"
{{- end }}
{{- if not (and .Values.tls.enabled .Values.tls.proxy.enabled) }}
webServiceUrl: "http://{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}-headless:{{ .Values.proxy.ports.http }}/"
brokerServiceUrl: "pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}-headless:{{ .Values.proxy.ports.pulsar }}/"
{{- end }}
{{- end }}
# Authentication Settings
{{- if .Values.auth.authentication.enabled }}
{{- if eq .Values.auth.authentication.provider "jwt" }}
Expand All @@ -76,15 +54,6 @@ data:
auth-info:
default:
locationoforigin: /root/.config/pulsar/config
{{- if not .Values.toolset.useProxy }}
{{- if and .Values.tls.enabled .Values.tls.broker.enabled }}
tls_trust_certs_file_path: "/pulsar/certs/ca/ca.crt"
{{- end }}
{{- else }}
{{- if and .Values.tls.enabled (and .Values.tls.proxy.enabled .Values.tls.proxy.untrustedCa) }}
tls_trust_certs_file_path: "/pulsar/certs/proxy-ca/ca.crt"
{{- end }}
{{- end }}
tls_allow_insecure_connection: false
token: ""
{{- if .Values.auth.authentication.enabled }}
Expand Down

0 comments on commit b94f9ef

Please sign in to comment.