Skip to content

Commit

Permalink
feat: make HTTP config generic (#67)
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Haley <[email protected]>
  • Loading branch information
charlie-haley authored Jan 11, 2024
1 parent c4a1ac2 commit 25e6b09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 32 deletions.
22 changes: 3 additions & 19 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,10 @@ data:
tracer:
{{- toYaml . | nindent 6}}
{{- end }}
{{- with .Values.http }}
http:
enabled: {{ .Values.http.enabled }}
{{- if .Values.http.enabled }}
address: {{ .Values.http.address | default "0.0.0.0:4195" }}
root_path: {{ .Values.http.rootPath | default "/benthos" }}
debug_endpoints: {{ .Values.http.debugEndpoints | default false }}
{{- end -}}
{{ if and .Values.http.tls.enabled .Values.http.tls.secretName }}
cert_file: "/tls/tls.crt"
key_file: "/tls/tls.key"
{{- end -}}
{{ if and .Values.http.enabled .Values.http.cors.enabled }}
cors:
enabled: {{ .Values.http.cors.enabled }}
{{- if and .Values.http.cors.enabled .Values.http.cors.allowedOrigins }}
allowed_origins: {{- range .Values.http.cors.allowedOrigins }}
- {{ . }}
{{- end }}
{{- end }}
{{- end -}}
{{- toYaml . | nindent 6}}
{{- end }}
{{- if and .Values.config (ne .Values.streams.enabled true) }}
{{- tpl .Values.config . | nindent 4 }}
{{- else if and .Values.streams.enabled .Values.streams.streamsConfigMap }}
Expand Down
8 changes: 4 additions & 4 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ spec:
httpGet:
path: /ping
port: http
{{- if .Values.http.tls.enabled }}
{{- if and .Values.http.tls .Values.http.tls.enabled }}
scheme: HTTPS
{{- end }}
readinessProbe:
httpGet:
path: /ready
port: http
{{- if .Values.http.tls.enabled }}
{{- if and .Values.http.tls .Values.http.tls.enabled }}
scheme: HTTPS
{{- end }}
{{- end }}
Expand All @@ -111,7 +111,7 @@ spec:
mountPath: "/benthos.yaml"
subPath: "benthos.yaml"
readOnly: true
{{- if and .Values.http.tls.enabled .Values.http.tls.secretName }}
{{- if and .Values.http.tls .Values.http.tls.enabled .Values.http.tls.secretName }}
- name: tls
mountPath: "/tls"
readOnly: true
Expand Down Expand Up @@ -146,7 +146,7 @@ spec:
- name: config
configMap:
name: {{ template "benthos.fullname" . }}-config
{{- if and .Values.http.tls.enabled .Values.http.tls.secretName }}
{{- if and .Values.http.tls .Values.http.tls.enabled .Values.http.tls.secretName }}
- name: tls
secret:
secretName: {{ .Values.http.tls.secretName }}
Expand Down
13 changes: 4 additions & 9 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,14 @@ streams:
http:
# Disabling HTTP server will prevent service and ingress objects from being created.
enabled: true
### These are the current defaults for the following HTTP component parameters;
### uncomment and edit any that require adjustment
# address: 0.0.0.0:4195
# rootPath: /benthos
# debugEndpoints: false
address: "0.0.0.0:4195"
root_path: "/benthos"
debug_endpoints: false
cors:
enabled: false
# Uncomment and provide list when .Values.http.cors.enabled is true
# allowedOrigins: []
tls:
enabled: false
# Create a secret of type `kubernetes.io/tls` in the same namespace and add the name here
# secretName: ""


serviceMonitor:
enabled: false
Expand Down

0 comments on commit 25e6b09

Please sign in to comment.