diff --git a/helm-charts/common/chatqna-ui/templates/deployment.yaml b/helm-charts/common/chatqna-ui/templates/deployment.yaml index f201a58b..46e4c8ac 100644 --- a/helm-charts/common/chatqna-ui/templates/deployment.yaml +++ b/helm-charts/common/chatqna-ui/templates/deployment.yaml @@ -50,9 +50,15 @@ spec: volumeMounts: - mountPath: /tmp name: tmp + - mountPath: /etc/nginx/conf.d + name: nginx-configuration volumes: - name: tmp emptyDir: {} + - name: nginx-configuration + configMap: + name: {{ include "ui.fullname" . }}-nginx-conf + optional: false {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/helm-charts/common/chatqna-ui/templates/nginx-conf.yaml b/helm-charts/common/chatqna-ui/templates/nginx-conf.yaml new file mode 100644 index 00000000..e67b6b8e --- /dev/null +++ b/helm-charts/common/chatqna-ui/templates/nginx-conf.yaml @@ -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 }} { + proxy_pass {{ .Values.dataprep.scheme }}://{{ .Release.Name }}-{{ .Values.dataprep.name }}:{{ .Values.dataprep.port }}/; + } + } diff --git a/helm-charts/common/chatqna-ui/values.yaml b/helm-charts/common/chatqna-ui/values.yaml index bb28851f..dd68926b 100644 --- a/helm-charts/common/chatqna-ui/values.yaml +++ b/helm-charts/common/chatqna-ui/values.yaml @@ -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://: -BACKEND_SERVICE_ENDPOINT: "" +BACKEND_SERVICE_ENDPOINT: "/chatqna/" # data preparation service URL, http://: -DATAPREP_SERVICE_ENDPOINT: "" +DATAPREP_SERVICE_ENDPOINT: "/chatqna-data-prep/" # data preparation get file service URL, http://: DATAPREP_GET_FILE_ENDPOINT: ""