Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

feat: make HTTP config generic #67

Merged
merged 1 commit into from
Jan 11, 2024
Merged
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: 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
Loading