-
Notifications
You must be signed in to change notification settings - Fork 60
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
chatqna-ui helm chart - nginx reverse proxy #305
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "ui.fullname" . }}-nginx-conf | ||
labels: | ||
{{- include "ui.labels" . | nindent 4 }} | ||
data: | ||
default.conf: |- | ||
server { | ||
listen 80; | ||
|
||
gzip on; | ||
gzip_proxied any; | ||
gzip_comp_level 6; | ||
gzip_buffers 16 8k; | ||
gzip_http_version 1.1; | ||
gzip_types font/woff2 text/css application/javascript application/json application/font-woff application/font-tff image/gif image/png image/svg+xml application/octet-stream; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html =404; | ||
|
||
location ~* \.(gif|jpe?g|png|webp|ico|svg|css|js|mp4|woff2)$ { | ||
expires 1d; | ||
} | ||
} | ||
|
||
location {{ .Values.BACKEND_SERVICE_ENDPOINT }} { | ||
proxy_pass {{ .Values.backend.scheme }}://{{ .Release.Name }}-{{ .Values.backend.name }}:{{ .Values.backend.port }}/; | ||
} | ||
|
||
location {{ .Values.DATAPREP_SERVICE_ENDPOINT }} { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
proxy_pass {{ .Values.dataprep.scheme }}://{{ .Release.Name }}-{{ .Values.dataprep.name }}:{{ .Values.dataprep.port }}/; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,11 +62,21 @@ tolerations: [] | |
|
||
affinity: {} | ||
|
||
backend: | ||
scheme: http | ||
name: chatqna | ||
port: 8888 | ||
|
||
dataprep: | ||
scheme: http | ||
name: data-prep | ||
port: 6007 | ||
|
||
# chatQnA Mega service URL, e.g. http://<service-name>:<port> | ||
BACKEND_SERVICE_ENDPOINT: "" | ||
BACKEND_SERVICE_ENDPOINT: "/chatqna/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No change of this variable's meaning as said above. |
||
|
||
# data preparation service URL, http://<service-name>:<port> | ||
DATAPREP_SERVICE_ENDPOINT: "" | ||
DATAPREP_SERVICE_ENDPOINT: "/chatqna-data-prep/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
# data preparation get file service URL, http://<service-name>:<port> | ||
DATAPREP_GET_FILE_ENDPOINT: "" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer to keep the meaning of BACKEND_SERVICE_ENDPOINT as the same, because docker-compose is also using it.
Also, the {{ .Release.Name }} is not necessary part of the ENDPOINT, since it's possible chatqna-ui and backend have different release name. We need to give user options to change that.
Hardcode the location shouldn't be a problem, if that is, let's define a new variable to do that.
Recommend this way:
location "/chatqna/" {
{{- if .Values.BACKEND_SERVICE_ENDPOINT }}
proxy_pass {{ .Values.BACKEND_SERVICE_ENDPOINT }}
{{- else }}
proxy_pass {{ .Values.backend.scheme }}://{{ .Release.Name }}-{{ .Values.backend.name }}:{{ .Values.backend.port }}/;
}