Skip to content

Commit

Permalink
feat: add extraArgs for detector to support tls-auth (#1124)
Browse files Browse the repository at this point in the history
* feat: add extraArgs for detector

Signed-off-by: ericsyh <[email protected]>

* apply to sn-platform chart

Signed-off-by: ericsyh <[email protected]>

* update examples

Signed-off-by: ericsyh <[email protected]>

---------

Signed-off-by: ericsyh <[email protected]>
(cherry picked from commit 58076fb)
  • Loading branch information
ericsyh committed Nov 10, 2023
1 parent aba3187 commit 8471060
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,20 @@ spec:
image: "{{ .Values.images.pulsar_detector.repository }}:{{ .Values.images.pulsar_detector.tag }}"
imagePullPolicy: {{ .Values.images.pulsar_detector.pullPolicy }}
command: ["sh", "-c"]
{{- if .Values.pulsar_detector.extraArgs }}
args:
- >
bin/pulsar-detector -service-url {{ template "pulsar.detector.serviceUrl" . }} -webservice-url {{ template "pulsar.detector.webServiceUrl" . }} {{- if .Values.auth.authentication.enabled }} -auth-plugin token -auth-params "{\"token\":\"$brokerClientAuthenticationParameters\"}" {{- end }} {{- if .Values.pulsar_detector.extraArgs }} {{.Values.pulsar_detector.extraArgs }} {{- end }};
bin/pulsar-detector \
{{- range $key, $value := .Values.pulsar_detector.extraArgs }}
-{{ $key }} {{ $value }} \
{{- end }}
-service-url {{ template "pulsar.detector.serviceUrl" . }} \
-webservice-url {{ template "pulsar.detector.webServiceUrl" . }}};
{{- else }}
args:
- >
bin/pulsar-detector -service-url {{ template "pulsar.detector.serviceUrl" . }} -webservice-url {{ template "pulsar.detector.webServiceUrl" . }} {{- if .Values.auth.authentication.enabled }} -auth-plugin token -auth-params "{\"token\":\"$brokerClientAuthenticationParameters\"}" {{- end }};
{{- end }}
{{- if .Values.pulsar_detector.resources }}
resources: {{- toYaml .Values.pulsar_detector.resources | nindent 10 }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/sn-platform-slim/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,11 @@ pulsar_detector:
extraVolumes: []
extraVolumeMounts: []
extraEnv: []
## Additional pulsar_detector container arguments
extraArgs: {}
# Configure the tls auth for detector
# auth-plugin: "tls"
# auth-params: "{\"tlsCertFile\":\"/pulsar/certs/pulsar-detector/tls.crt\",\"tlsKeyFile\":\"/pulsar/certs/pulsar-detector/tls.key\"}"
## Proxy service
## templates/pulsar-detector-service.yaml
##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,20 @@ spec:
image: "{{ .Values.images.pulsar_detector.repository }}:{{ .Values.images.pulsar_detector.tag }}"
imagePullPolicy: {{ .Values.images.pulsar_detector.pullPolicy }}
command: ["sh", "-c"]
{{- if .Values.pulsar_detector.extraArgs }}
args:
- >
bin/pulsar-detector -service-url {{ template "pulsar.detector.serviceUrl" . }} -webservice-url {{ template "pulsar.detector.webServiceUrl" . }} {{- if .Values.auth.authentication.enabled }} -auth-plugin token -auth-params "{\"token\":\"$brokerClientAuthenticationParameters\"}" {{- end }} {{- if .Values.pulsar_detector.extraArgs }} {{.Values.pulsar_detector.extraArgs }} {{- end }};
bin/pulsar-detector \
{{- range $key, $value := .Values.pulsar_detector.extraArgs }}
-{{ $key }} {{ $value }} \
{{- end }}
-service-url {{ template "pulsar.detector.serviceUrl" . }} \
-webservice-url {{ template "pulsar.detector.webServiceUrl" . }}};
{{- else }}
args:
- >
bin/pulsar-detector -service-url {{ template "pulsar.detector.serviceUrl" . }} -webservice-url {{ template "pulsar.detector.webServiceUrl" . }} {{- if .Values.auth.authentication.enabled }} -auth-plugin token -auth-params "{\"token\":\"$brokerClientAuthenticationParameters\"}" {{- end }};
{{- end }}
{{- if .Values.pulsar_detector.resources }}
resources: {{- toYaml .Values.pulsar_detector.resources | nindent 10 }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/sn-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,11 @@ pulsar_detector:
extraVolumes: []
extraVolumeMounts: []
extraEnv: []
## Additional pulsar_detector container arguments
extraArgs: {}
# Configure the tls auth for detector
# auth-plugin: "tls"
# auth-params: "{\"tlsCertFile\":\"/pulsar/certs/pulsar-detector/tls.crt\",\"tlsKeyFile\":\"/pulsar/certs/pulsar-detector/tls.key\"}"
## Proxy service
## templates/pulsar-detector-service.yaml
##
Expand Down

0 comments on commit 8471060

Please sign in to comment.