-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helm chart: add nginx to avoid CORS issue
Signed-off-by: Ruoyu Ying <[email protected]>
- Loading branch information
Showing
6 changed files
with
125 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
apiVersion: v1 | ||
data: | ||
default.conf: |+ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
location /home { | ||
alias /usr/share/nginx/html/index.html; | ||
} | ||
location / { | ||
proxy_pass http://{{ include "ui.fullname" (index .Subcharts "chatqna-ui") }}:{{ index .Values "chatqna-ui" "service" "port" }}; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
location /v1/chatqna { | ||
proxy_pass http://{{ include "chatqna.fullname" . }}:{{ .Values.service.port }}; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
location /v1/dataprep { | ||
proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
location /v1/dataprep/get_file { | ||
proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
location /v1/dataprep/delete_file { | ||
proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
kind: ConfigMap | ||
metadata: | ||
name: nginx-default-config | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "chatqna.fullname" . }}-nginx | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ include "chatqna.fullname" . }}-nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ include "chatqna.fullname" . }}-nginx | ||
spec: | ||
containers: | ||
- image: nginx:1.27.1 | ||
imagePullPolicy: IfNotPresent | ||
name: nginx | ||
volumeMounts: | ||
- mountPath: /etc/nginx/conf.d | ||
name: nginx-config-volume | ||
securityContext: {} | ||
volumes: | ||
- configMap: | ||
defaultMode: 420 | ||
name: nginx-default-config | ||
name: nginx-config-volume | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "chatqna.fullname" . }}-nginx | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 80 | ||
selector: | ||
app: {{ include "chatqna.fullname" . }}-nginx | ||
type: NodePort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters